diff options
author | Caolán McNamara <caolanm@redhat.com> | 2011-12-21 10:45:54 +0000 |
---|---|---|
committer | Caolán McNamara <caolanm@redhat.com> | 2011-12-21 13:44:52 +0000 |
commit | 5c24789ca33d7b2b0c39626208cf0708fb470d95 (patch) | |
tree | a58015a4f6cafb9d567ca24831a442a4e976d972 /tools/inc | |
parent | c4f0efc2378cebc3b581bc949da70a2b2f149961 (diff) |
disentangle Read/WriteByteString OUString variants
The ones which use a definite 8-bit encoding read/write pascal-style
strings with a 16bit length prefix.
The ones which use a definite 16-bit encoding read/write pascal-style
UTF-16 strings with a 32bit length prefix, i.e. not ByteStrings at all
The "I dunno" ones might be UTF-16 strings or 8-bit strings, depending
on the charset. Rename to ReadUniOrByteString like the other
similar horrors to flag this misery
Diffstat (limited to 'tools/inc')
-rw-r--r-- | tools/inc/tools/stream.hxx | 11 |
1 files changed, 6 insertions, 5 deletions
diff --git a/tools/inc/tools/stream.hxx b/tools/inc/tools/stream.hxx index e6e939bbbd1b..4d316708b152 100644 --- a/tools/inc/tools/stream.hxx +++ b/tools/inc/tools/stream.hxx @@ -363,11 +363,6 @@ public: SvStream& operator<<( const unsigned char* pBuf ); SvStream& operator<<( SvStream& rStream ); - SvStream& ReadByteString( UniString& rStr, rtl_TextEncoding eSrcCharSet ); - SvStream& ReadByteString( UniString& rStr ) { return ReadByteString( rStr, GetStreamCharSet() ); } - SvStream& WriteByteString( const UniString& rStr, rtl_TextEncoding eDestCharSet ); - SvStream& WriteByteString( const UniString& rStr ) { return WriteByteString( rStr, GetStreamCharSet() ); } - SvStream& WriteNumber( sal_uInt32 nUInt32 ); SvStream& WriteNumber( sal_Int32 nInt32 ); @@ -412,6 +407,12 @@ public: /// Read a line of Unicode sal_Bool ReadUniStringLine( String& rStr ); + /// Read a 32bit length prefixed sequence of utf-16 if eSrcCharSet==RTL_TEXTENCODING_UNICODE, + /// otherwise read a 16bit length prefixed sequence of bytes and convert from eSrcCharSet + SvStream& ReadUniOrByteString( UniString& rStr, rtl_TextEncoding eSrcCharSet ); + /// Write a 32bit length prefixed sequence of utf-16 if eSrcCharSet==RTL_TEXTENCODING_UNICODE, + /// otherwise convert to eSrcCharSet and write a 16bit length prefixed sequence of bytes + SvStream& WriteUniOrByteString( const UniString& rStr, rtl_TextEncoding eDestCharSet ); /// Read a line of Unicode if eSrcCharSet==RTL_TEXTENCODING_UNICODE, /// otherwise read a line of Bytecode and convert from eSrcCharSet sal_Bool ReadUniOrByteStringLine( String& rStr, rtl_TextEncoding eSrcCharSet ); |