EPICS Controls Argonne National Laboratory

Experimental Physics and
Industrial Control System

2002  2003  2004  <20052006  2007  2008  2009  2010  2011  2012  2013  2014  2015  2016  2017  2018  2019  2020  2021  2022  2023  2024  Index 2002  2003  2004  <20052006  2007  2008  2009  2010  2011  2012  2013  2014  2015  2016  2017  2018  2019  2020  2021  2022  2023  2024 
<== Date ==> <== Thread ==>

Subject: Re: [Fwd: RE: Standard String]
From: Kay-Uwe Kasemir <[email protected]>
To: EPICS Core Talk <[email protected]>
Date: Mon, 18 Jul 2005 10:31:02 -0400
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  <20052006  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  <20052006  2007  2008  2009  2010  2011  2012  2013  2014  2015  2016  2017  2018  2019  2020  2021  2022  2023  2024 
ANJ, 02 Feb 2012 Valid HTML 4.01! · Home · News · About · Base · Modules · Extensions · Distributions · Download ·
· Search · EPICS V4 · IRMIS · Talk · Bugs · Documents · Links · Licensing ·