Hi:
Jeff wrote:
2) I'm not terribly fond of interfaces that hand off handles to
internal
data. I'm not enamored, for example, with "std::string::c_str()" and
"EpicsString::expose".
In principle, I agree that c_str violates everything you learn
about using interfaces and hiding the internal data.
In fully OO languages like Java where a string constant "blah" is
interchangeable with a String class and all library functions understand
this, we'd be fine.
In reality, however, I'm afraid that many C and C++ APIs still require
text as (const char *), so whatever String class we use needs to
convert to/from char * as efficiently as possible,
and c_str does that for 'reading' the String.
So just like std::string and MFC::CString and probably most of the other
C++ string classes, I doubt you can avoid char *.
-Kay
- Replies:
- RE: [Fwd: RE: Standard String] Jeff Hill
- References:
- [Fwd: RE: Standard String] Marty Kraimer
- Navigate by Date:
- Prev:
[Fwd: Re: Standard String] Marty Kraimer
- Next:
RE: [Fwd: RE: Standard String] Jeff Hill
- Index:
2002
2003
2004
<2005>
2006
2007
2008
2009
2010
2011
2012
2013
2014
2015
2016
2017
2018
2019
2020
2021
2022
2023
2024
- Navigate by Thread:
- Prev:
[Fwd: RE: Standard String] Marty Kraimer
- Next:
RE: [Fwd: RE: Standard String] Jeff Hill
- Index:
2002
2003
2004
<2005>
2006
2007
2008
2009
2010
2011
2012
2013
2014
2015
2016
2017
2018
2019
2020
2021
2022
2023
2024
|