diff options
Diffstat (limited to 'cpp/include')
-rw-r--r-- | cpp/include/Ice/Ice.h | 4 | ||||
-rw-r--r-- | cpp/include/Ice/IconvStringConverter.h | 2 | ||||
-rwxr-xr-x | cpp/include/Ice/StringConverter.h | 29 |
3 files changed, 30 insertions, 5 deletions
diff --git a/cpp/include/Ice/Ice.h b/cpp/include/Ice/Ice.h index 4d8f53a8703..85de61f222e 100644 --- a/cpp/include/Ice/Ice.h +++ b/cpp/include/Ice/Ice.h @@ -34,4 +34,8 @@ #include <Ice/Router.h> #include <Ice/DispatchInterceptor.h> +#ifndef _WIN32 +#include <Ice/IconvStringConverter.h> +#endif + #endif diff --git a/cpp/include/Ice/IconvStringConverter.h b/cpp/include/Ice/IconvStringConverter.h index 185a2bb4b8e..8b532c8739e 100644 --- a/cpp/include/Ice/IconvStringConverter.h +++ b/cpp/include/Ice/IconvStringConverter.h @@ -10,7 +10,7 @@ #ifndef ICE_ICONV_STRING_CONVERTER #define ICE_ICONV_STRING_CONVERTER -#include <Ice/Ice.h> +#include <Ice/StringConverter.h> #include <algorithm> #include <iconv.h> diff --git a/cpp/include/Ice/StringConverter.h b/cpp/include/Ice/StringConverter.h index d2aa1dffa7a..2b59c622e8b 100755 --- a/cpp/include/Ice/StringConverter.h +++ b/cpp/include/Ice/StringConverter.h @@ -70,11 +70,32 @@ class ICE_API UnicodeWstringConverter : public WstringConverter { public: - virtual Byte* toUTF8(const wchar_t* sourceStart, const wchar_t* sourceEnd, - UTF8Buffer&) const; + virtual Byte* toUTF8(const wchar_t*, const wchar_t*, UTF8Buffer&) const; - virtual void fromUTF8(const Byte* sourceStart, const Byte* sourceEnd, - std::wstring& target) const; + virtual void fromUTF8(const Byte*, const Byte*, std::wstring&) const; }; + +#ifdef _WIN32 + +// +// Converts to/from UTF-8 using MultiByteToWideChar and WideCharToMultiByte +// + +class ICE_API WindowsStringConverter : public StringConverter +{ +public: + + explicit WindowsStringConverter(unsigned int); + + virtual Byte* toUTF8(const char*, const char*, UTF8Buffer&) const; + + virtual void fromUTF8(const Byte*, const Byte*, std::string& target) const; + +private: + unsigned int _cp; + UnicodeWstringConverter _unicodeWstringConverter; +}; +#endif + } #endif |