Issue 1971: Extraction of strings from an Any (cxx_revision) Source: (, ) Nature: Uncategorized Issue Severity: Summary: Summary: What happens if I write CORBA::Any a = ...; const char *p; a >>= p; and the type code in the Any indicates a *bounded* string? Does the extraction succeed or fail? The mapping doesn"t say. Resolution: Revised Text: Actions taken: September 17, 1998: received issue Discussion: deferred in June 2011 to the next RTF End of Annotations:===== Return-Path: X-Authentication-Warning: fatcat.dstc.edu.au: michi owned process doing -bs Date: Thu, 17 Sep 1998 11:43:26 +1000 (EST) From: Michi Henning To: issues@omg.org, cxx_revision@omg.org Subject: Extraction of strings from an Any What happens if I write CORBA::Any a = ...; const char *p; a >>= p; and the type code in the Any indicates a *bounded* string? Does the extraction succeed or fail? The mapping doesn't say. According to the new TypeCode::equivalent section, the extraction should fail, because it says that when extracting from an Any, equivalent() determines success of failure. The problem I have is that I think it would be easier for the above extraction to succeed because the C++ mapping forces me to deal with bounded strings as char * throughout. In particular, without a generic extraction for strings, I can't easily pass a string<10> that I receive from one place as a string<20> to another operation, even though the string value fits. I think we should decide what to do here and specify the behavior. Cheers, Michi. -- Michi Henning +61 7 33654310 DSTC Pty Ltd +61 7 33654311 (fax) University of Qld 4072 michi@dstc.edu.au AUSTRALIA http://www.dstc.edu.au/BDU/staff/michi-henning.html Date: Mon, 28 May 2001 14:50:04 +1000 (EST) From: Michi Henning Reply-To: C++ Revision Task Force To: C++ Revision Task Force Subject: Proposal for 1971 Message-ID: Organization: IONA Technologies MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII X-UIDL: 9')e9mWj!!>J%e96_od9 Status: RO While it would be nice to be able to generically extract and insert bounded strings via (const) char *, the feature isn't essential. So, in essence, I'd like to close the issue without adding the new feature. However, the spec doesn't say what the behavior should be if the bound value doesn't match for extraction, so I think we should add a sentence for clarification. Proposal: Insert the following para in 1.16.4, following the para beginning with "A bound value of zero passed to the appropriate helper type...": For successful extraction of bounded strings with to_string, the bound value supplied to the constructor must match the bound in the Any's TypeCode; otherwise, the constructor fails and subsequent extraction with operator>>= returns false. Cheers, Michi. -- Michi Henning +61 7 3324 9633 Chief CORBA Scientist +61 4 1118 2700 (mobile) IONA Technologies +61 7 3324 9799 (fax) Total Business Integration http://www.ooc.com.au/staff/michi