From: Christian P. <cp...@us...> - 2005-07-01 13:55:30
|
Update of /cvsroot/pclasses/pclasses2/include/pclasses/Unicode In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv18224/include/pclasses/Unicode Modified Files: String.h Log Message: - Added Traits::LexT<StringList<std::string> >, Traits::LexT<StringList<Unicode::String> >, Traits::LexT<Unicode::String> Index: String.h =================================================================== RCS file: /cvsroot/pclasses/pclasses2/include/pclasses/Unicode/String.h,v retrieving revision 1.8 retrieving revision 1.9 diff -u -d -r1.8 -r1.9 --- String.h 22 Jun 2005 11:33:17 -0000 1.8 +++ String.h 1 Jul 2005 13:55:10 -0000 1.9 @@ -25,6 +25,8 @@ #include <pclasses/BasicTypes.h> #include <pclasses/Alloc.h> #include <pclasses/SharedPtr.h> +#include <pclasses/LexT.h> +#include <pclasses/StringList.h> #include <pclasses/Unicode/UnicodeError.h> #include <pclasses/Unicode/Char.h> @@ -85,6 +87,8 @@ size_t size() const throw(); size_t capacity() const throw(); + void reserve(size_t sz); + void resize(size_t sz); Char at(size_t index) const; @@ -156,12 +160,18 @@ static String fromUtf8(const char* str, size_t count = npos) throw(OutOfMemory, UnicodeError); + static String fromUtf8(const std::string& str) + throw(OutOfMemory, UnicodeError); + std::string toCodepage(const char* codepage = 0) const throw(OutOfMemory, UnicodeError); static String fromCodepage(const char* str, size_t count = npos, const char* codepage = 0) throw(OutOfMemory, UnicodeError); + static String fromCodepage(const std::string& str, + const char* codepage = 0) throw(OutOfMemory, UnicodeError); + void acquire(uchar16_t* str, size_t size, size_t length) throw(OutOfMemory); @@ -183,6 +193,27 @@ } // !namespace Unicode + +namespace Traits { + +template < > +struct PUNICODE_EXPORT LexT<Unicode::String> { + static std::string toString(const Unicode::String& val); + static Unicode::String fromString(const std::string& str) + throw(ConversionError); +}; + +template < > +struct PUNICODE_EXPORT LexT<StringList<Unicode::String> > { + static std::string toString(const StringList<Unicode::String>& val); + static StringList<Unicode::String> fromString(const std::string& str) + throw(ConversionError); +}; + + +} // !namespace Traits + + } // !namespace P #endif |