What to do after Python?

Rainer Deyke root at rainerdeyke.com
Mon Feb 19 11:54:54 EST 2001


"Kenneth Loafman" <ken at lt.com> wrote in message
news:mailman.982589543.7737.python-list at python.org...
> Rainer Deyke wrote:
> > The following is the correct ways of doing this in C++:
> >
> > s = std::string(s.begin(), s.end() - 1);
> >
> > Not using 'std::string' in C++ is analogous to not using the built-in
string
> > type in Python.
>
> They were using CString under M$VC.  I don't think std::string existst
> on the M$ compilers.  Would make it too easy to port to the heathen UNIX
> boxen <grin>.

I've used 'std::string' under Visual C++.  I'm not familiar with 'CString',
but it would probably not be too hard to convert between real strings and
'CString'.  Something like this:

std::string s(zxczcCString.GetTheStupidCharacterArrayPointer());
s = std::string(s.begin(), s.end() - 1);
zxczcCString = CString(s.c_str());

This would obviously be bad for performance, but at least it minimizes
dependence on proprietary classes.  This is for when the API demands
'CString'.


--
Rainer Deyke (root at rainerdeyke.com)
Shareware computer games           -           http://rainerdeyke.com
"In ihren Reihen zu stehen heisst unter Feinden zu kaempfen" - Abigor





More information about the Python-list mailing list