diff options
author | Bernard Normier <bernard@zeroc.com> | 2006-06-14 15:42:33 +0000 |
---|---|---|
committer | Bernard Normier <bernard@zeroc.com> | 2006-06-14 15:42:33 +0000 |
commit | 983775d2c76d289de2721ee54771dc7fdd5bcf79 (patch) | |
tree | 81aaa7c7bd3d59ea315abf6e1029f147c0c82869 /cpp/src/Ice/StringConverter.cpp | |
parent | minor code harness changes. (diff) | |
download | ice-983775d2c76d289de2721ee54771dc7fdd5bcf79.tar.bz2 ice-983775d2c76d289de2721ee54771dc7fdd5bcf79.tar.xz ice-983775d2c76d289de2721ee54771dc7fdd5bcf79.zip |
Removed fromUTF8/freeTarget
Diffstat (limited to 'cpp/src/Ice/StringConverter.cpp')
-rwxr-xr-x | cpp/src/Ice/StringConverter.cpp | 42 |
1 files changed, 0 insertions, 42 deletions
diff --git a/cpp/src/Ice/StringConverter.cpp b/cpp/src/Ice/StringConverter.cpp index 98ce92adf59..994985581a7 100755 --- a/cpp/src/Ice/StringConverter.cpp +++ b/cpp/src/Ice/StringConverter.cpp @@ -59,48 +59,6 @@ UnicodeWstringConverter::toUTF8(const wchar_t* sourceStart, return targetStart; } -void -UnicodeWstringConverter::fromUTF8(const Byte* sourceStart, const Byte* sourceEnd, - const wchar_t*& targetStart, const wchar_t*& targetEnd) const -{ - size_t size = static_cast<size_t>(sourceEnd - sourceStart); - - wchar_t* outBuf = new wchar_t[size]; - wchar_t* tStart = outBuf; - - ConversionResult result = convertUTF8ToUTFWstring( - sourceStart, sourceEnd, tStart, outBuf + size, - lenientConversion); - - switch(result) - { - case conversionOK: - { - targetStart = outBuf; - targetEnd = tStart; - break; - } - case sourceExhausted: - throw StringConversionException(__FILE__, __LINE__, "UTF-8 string source exhausted"); - case sourceIllegal: - throw StringConversionException(__FILE__, __LINE__, "UTF-8 string source illegal"); - default: - { - assert(0); - throw StringConversionException(__FILE__, __LINE__); - } - } -} - -void -UnicodeWstringConverter::freeTarget(const wchar_t* targetStart) const -{ -#if defined(_MSC_VER) && _MSC_VER < 1300 - delete[] const_cast<wchar_t*>(targetStart); -#else - delete[] targetStart; -#endif -} void UnicodeWstringConverter::fromUTF8(const Byte* sourceStart, const Byte* sourceEnd, |