diff options
Diffstat (limited to 'cppe/src/IceE/StringConverter.cpp')
-rw-r--r-- | cppe/src/IceE/StringConverter.cpp | 66 |
1 files changed, 33 insertions, 33 deletions
diff --git a/cppe/src/IceE/StringConverter.cpp b/cppe/src/IceE/StringConverter.cpp index 837773b8e03..adf1c6d319a 100644 --- a/cppe/src/IceE/StringConverter.cpp +++ b/cppe/src/IceE/StringConverter.cpp @@ -23,8 +23,8 @@ namespace Ice Byte* UnicodeWstringConverter::toUTF8(const wchar_t* sourceStart, - const wchar_t* sourceEnd, - UTF8Buffer& buffer) const + const wchar_t* sourceEnd, + UTF8Buffer& buffer) const { // // The "chunk size" is the maximum of the number of characters in the @@ -38,51 +38,51 @@ UnicodeWstringConverter::toUTF8(const wchar_t* sourceStart, ConversionResult result; while((result = - convertUTFWstringToUTF8(sourceStart, sourceEnd, - targetStart, targetEnd, lenientConversion)) - == targetExhausted) + convertUTFWstringToUTF8(sourceStart, sourceEnd, + targetStart, targetEnd, lenientConversion)) + == targetExhausted) { - targetStart = buffer.getMoreBytes(chunkSize, targetStart); - targetEnd = targetStart + chunkSize; + targetStart = buffer.getMoreBytes(chunkSize, targetStart); + targetEnd = targetStart + chunkSize; } - + switch(result) { - case conversionOK: - break; - case sourceExhausted: - throw StringConversionException(__FILE__, __LINE__, "wide string source exhausted"); - case sourceIllegal: - throw StringConversionException(__FILE__, __LINE__, "wide string source illegal"); - default: - { - assert(0); - throw StringConversionException(__FILE__, __LINE__); - } + case conversionOK: + break; + case sourceExhausted: + throw StringConversionException(__FILE__, __LINE__, "wide string source exhausted"); + case sourceIllegal: + throw StringConversionException(__FILE__, __LINE__, "wide string source illegal"); + default: + { + assert(0); + throw StringConversionException(__FILE__, __LINE__); + } } return targetStart; } void UnicodeWstringConverter::fromUTF8(const Byte* sourceStart, const Byte* sourceEnd, - wstring& target) const + wstring& target) const { ConversionResult result = - convertUTF8ToUTFWstring(sourceStart, sourceEnd, target, lenientConversion); + convertUTF8ToUTFWstring(sourceStart, sourceEnd, target, lenientConversion); switch(result) - { - case conversionOK: - 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__); - } + { + case conversionOK: + 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__); + } } } |