Re: [C++] Options for string handling in SDO
Just to emphasise that point, the SDO for PHP implementation depends on the C-style string interfaces in Tuscany C++. It already has to copy strings from Tuscany to the internal PHP format for string data, so another level of indirection would be most unwelcome. I imagine that other wrappers for Tuscany C++ might have the same issue. Simon Laws [EMAIL PROTECTED] wrote on 12/05/2006 15:53:26: Also why is this an either/or? It would seem like a useful thing to have an interface that allows string objects to be used but not sure I would want to loose the ability to use C strings as well. -- Caroline
[C++] Options for string handling in SDO
Much of the string data in SDO for C++ is handled as C style, null-terminated arrays of characters. I'm trying to move that to a style where most string data is represented as true string objects. The painless (less painful) way to do that is to leave the externals alone and to introduce string objects internally, converting between string objects and C-style strings at the earliest convenient point when called and the last convenient point on return. The alternative is to extend the public interface with extra methods that take string objects as arguments rather than C-style strings. In this case we would have to publicise a new string class as well. Does anyone have any opinions on which of these is preferable (or any other alternatives)? We could of course make the internal only changes first and add an extended public interface later. Regards, Geoff.
Re: [C++] Options for string handling in SDO
Hi Geoff When you talk about string objects do you mean instances of the ANSI string class (basic_string) or is this a special SDO designed string class? Also why is this an either/or? It would seem like a useful thing to have an interface that allows string objects to be used but not sure I would want to loose the ability to use C strings as well. Simon On 5/12/06, Geoffrey Winn [EMAIL PROTECTED] wrote: Much of the string data in SDO for C++ is handled as C style, null-terminated arrays of characters. I'm trying to move that to a style where most string data is represented as true string objects. The painless (less painful) way to do that is to leave the externals alone and to introduce string objects internally, converting between string objects and C-style strings at the earliest convenient point when called and the last convenient point on return. The alternative is to extend the public interface with extra methods that take string objects as arguments rather than C-style strings. In this case we would have to publicise a new string class as well. Does anyone have any opinions on which of these is preferable (or any other alternatives)? We could of course make the internal only changes first and add an extended public interface later. Regards, Geoff.
Re: [C++] Options for string handling in SDO
To pick up on both these responses. On 12/05/06, Simon Laws [EMAIL PROTECTED] wrote: Hi Geoff When you talk about string objects do you mean instances of the ANSI string class (basic_string) or is this a special SDO designed string class? I didn't include enough detail. I meant a class that we will define that will be a wrapper (prety much) for the basic_string class. Also why is this an either/or? It would seem like a useful thing to have an interface that allows string objects to be used but not sure I would want to loose the ability to use C strings as well. You are right. It wasn't my intention to remove the existing interface. My question was whether to make the changes purely to the internals (so no user visible use of string objects at all) or to add (as you describe) additional methods that take string objects as arguments. On 12/05/06, Edward Slattery [EMAIL PROTECTED] wrote: FWIW I would think of creating an SDO string class which can be constructed from a char* or a std::string, and make the methods use the SDO string, such that either char* or std::string can be input. Makes sense to me. I'll go that route. Geoff.