diff options
author | Caolán McNamara <caolanm@redhat.com> | 2017-04-06 15:08:45 +0100 |
---|---|---|
committer | Caolán McNamara <caolanm@redhat.com> | 2017-04-07 09:02:45 +0000 |
commit | 9b77f8142bf665a47c3a179e3fe3f82623a99f8a (patch) | |
tree | 6aee5ab0ec475499fa20f0485bdcb16853b5a79f /include/tools/stream.hxx | |
parent | 60aac84fc83ca6d527d06cf4ce031d7ef5ffee48 (diff) |
ditch ReadRawUniString
This thing is defined by MS-OSHARED, there FWIW, the 8 bit encoding is "ANSI",
which is somewhat useless, use the same GetCharSetFromLanguage() attempt we use
elsewhere when that problem arises
Change-Id: I6d8efdbec0daf7f3439283f2be0473b6fad1fb17
Reviewed-on: https://gerrit.libreoffice.org/36214
Tested-by: Jenkins <ci@libreoffice.org>
Reviewed-by: Caolán McNamara <caolanm@redhat.com>
Tested-by: Caolán McNamara <caolanm@redhat.com>
Diffstat (limited to 'include/tools/stream.hxx')
-rw-r--r-- | include/tools/stream.hxx | 20 |
1 files changed, 16 insertions, 4 deletions
diff --git a/include/tools/stream.hxx b/include/tools/stream.hxx index ef7091e98eba..f78e8afc5e7f 100644 --- a/include/tools/stream.hxx +++ b/include/tools/stream.hxx @@ -498,30 +498,42 @@ TOOLS_DLLPUBLIC OUString read_zeroTerminated_uInt8s_ToOUString(SvStream& rStrm, /// Attempt to read a pascal-style length (of type prefix) prefixed sequence of /// 8bit units to an OString, returned OString's length is number of units /// successfully read. +inline OString read_uInt32_lenPrefixed_uInt8s_ToOString(SvStream& rStrm) +{ + sal_uInt32 nUnits = 0; + rStrm.ReadUInt32(nUnits); + return read_uInt8s_ToOString(rStrm, nUnits); +} inline OString read_uInt16_lenPrefixed_uInt8s_ToOString(SvStream& rStrm) { sal_uInt16 nUnits = 0; - rStrm.ReadUInt16( nUnits ); + rStrm.ReadUInt16(nUnits); return read_uInt8s_ToOString(rStrm, nUnits); } inline OString read_uInt8_lenPrefixed_uInt8s_ToOString(SvStream& rStrm) { sal_uInt8 nUnits = 0; - rStrm.ReadUChar( nUnits ); + rStrm.ReadUChar(nUnits); return read_uInt8s_ToOString(rStrm, nUnits); } /// Attempt to read a pascal-style length (of type prefix) prefixed sequence of /// 8bit units to an OUString +inline OUString read_uInt32_lenPrefixed_uInt8s_ToOUString(SvStream& rStrm, + rtl_TextEncoding eEnc) +{ + return OStringToOUString(read_uInt32_lenPrefixed_uInt8s_ToOString(rStrm), eEnc); +} + inline OUString read_uInt16_lenPrefixed_uInt8s_ToOUString(SvStream& rStrm, - rtl_TextEncoding eEnc) + rtl_TextEncoding eEnc) { return OStringToOUString(read_uInt16_lenPrefixed_uInt8s_ToOString(rStrm), eEnc); } inline OUString read_uInt8_lenPrefixed_uInt8s_ToOUString(SvStream& rStrm, - rtl_TextEncoding eEnc) + rtl_TextEncoding eEnc) { return OStringToOUString(read_uInt8_lenPrefixed_uInt8s_ToOString(rStrm), eEnc); } |