Re: Re: Why all the different string types?
Jens Miltner <[email protected]> Thu, 9 Mar 2006 09:47:43 +0100
| Newsgroups | gmane.comp.version-control.cvs.gui.devel |
|---|---|
| Message-ID | <[email protected]> |
Am 09.03.2006 um 01:48 schrieb kaczoroj:
> UStr is same as CStr. CString is an MFC classs used on Windows-
> specific code. std::string used by me recently as I was trying to see
> how would that go if we tried to replace the above string classes with
> std::string. Mixed feelings about that one - std::string is by far the
> most crappy string class even invented. Unfortunately we can't use
> CString (which is superb) so we are stuck with UStr for now. I want to
> phase out UPStr (and consquently PCPStr) eventually.
>
Can you elaborate a bit on your (apparently bad) experience with=20=20
std::string?
Also, we could probably implement the MFC CString class API for the=20=20
other platforms and then use that class
(if it's really superior - convince me ;-)
> I would advise to use CStr rather than CPStr.
>
> I am still not sure about the migration to std::string so for now you
> can use either one whichever looks more comfortable. Any input on
> that? This will require writing and re-writing some tool routines and
> since std::string doesn't take NULLs it will cause some crashes until
> it's wired properly. But if the general feeling is to go with the
> standard we could do that.
>
> I will see if I can organize all that a little bit better but if I do
> then it will break gCvs and MacCvs compilation so be prepared for a
> little catch-up ;)
>
Personally, I wouldn't mind playing a little catch up if it reduces=20=20
the string class proliferation. I understand Guy's feelings/confusion=20=20
about the string classes and IMHO, a good many of them are just=20=20
leftovers from older days and/or expose unnecessary implementation=20=20
details (like the CPxxx classes, which, IIRC, use Pascal-style=20=20
strings for storage). Such implementation details shouldn't surface=20=20
in multiple classes but rather in different accessors for a single=20=20
string class.
Personally, since std::string is available on all platforms, I'd=20=20
suggest either migrating to std::string, or if this requires lots of=20=20
conversions due to the way strings need to be passed to the OS,=20=20
design a single string class that combines the requirements of all=20=20
platforms and has a standardized API (which is one of the things I=20=20
like about the STL containers), using OS-provided string classes as=20=20
the underlying storage wherever possible...
Just my =80.02
</jum>
=20
Yahoo! Groups Links
<*> To visit your group on the web, go to:
http://groups.yahoo.com/group/cvsgui-dev/
<*> To unsubscribe from this group, send an email to:
[email protected]
<*> Your use of Yahoo! Groups is subject to:
http://docs.yahoo.com/info/terms/
=20