diff options
author | Bernard Normier <bernard@zeroc.com> | 2006-01-09 22:35:30 +0000 |
---|---|---|
committer | Bernard Normier <bernard@zeroc.com> | 2006-01-09 22:35:30 +0000 |
commit | 7d8fd91fd6fd1b89ce886fb09d92607157484f11 (patch) | |
tree | 2d49ace40d9367daaffc6c5d2a8e7b5538850b90 /cpp/include/IceUtil/Unicode.h | |
parent | Fixed unicode / string converter commit (diff) | |
download | ice-7d8fd91fd6fd1b89ce886fb09d92607157484f11.tar.bz2 ice-7d8fd91fd6fd1b89ce886fb09d92607157484f11.tar.xz ice-7d8fd91fd6fd1b89ce886fb09d92607157484f11.zip |
Added UTFConversionException to Unicode
Diffstat (limited to 'cpp/include/IceUtil/Unicode.h')
-rw-r--r-- | cpp/include/IceUtil/Unicode.h | 26 |
1 files changed, 26 insertions, 0 deletions
diff --git a/cpp/include/IceUtil/Unicode.h b/cpp/include/IceUtil/Unicode.h index 8e85c93b49e..4e78dbdfd92 100644 --- a/cpp/include/IceUtil/Unicode.h +++ b/cpp/include/IceUtil/Unicode.h @@ -11,6 +11,7 @@ #define ICE_UTIL_UNICODE_H #include <IceUtil/Config.h> +#include <IceUtil/Exception.h> namespace IceUtil { @@ -102,6 +103,7 @@ enum ConversionResult sourceIllegal /* source sequence is illegal/malformed */ }; + enum ConversionFlags { strictConversion = 0, @@ -125,6 +127,30 @@ ICE_UTIL_API ConversionResult convertUTF8ToUTFWstring(const Byte*& sourceStart, const Byte* sourceEnd, std::wstring& target, ConversionFlags flags); + + + +// +// UTFConversionException is raised by wstringToString() or stringToWstring() +// to report a conversion error +// +class ICE_UTIL_API UTFConversionException : public Exception +{ +public: + + UTFConversionException(const char*, int, ConversionResult); + virtual const std::string ice_name() const; + virtual void ice_print(std::ostream&) const; + virtual Exception* ice_clone() const; + virtual void ice_throw() const; + + ConversionResult conversionResult() const; +private: + + const ConversionResult _conversionResult; + static const char* _name; +}; + } #endif |