I've added to tools
rtl::OString read_uInt8s_AsOString(SvStream& rStr, sal_Size nLen);
rtl::OUString read_LEuInt16s_AsOUString(SvStream& rStr, sal_Size nLen);
which read nLen 8bit units or 16bit units from a SvStream into a
O[UString]. They should be reasonably efficient and drop the usual extra
intermediate buffer of the various methods and functions I
merged/replaced with these.
Down in sw I replaced, split out, refactored some various horrors with
a)
String read_uInt8_PascalString(SvStream& rStrm, rtl_TextEncoding eEnc);
String read_LEuInt16_PascalString(SvStream& rStrm);
which read pascal-style strings where the non-NULL terminated string on
disk is preceded by the len, and in passing fixed at least one case
where we passed "0" as the encoding of a string.
and b)
String read_uInt8_BeltAndBracesString(SvStream& rStrm, rtl_TextEncoding
eEnc);
String read_LEuInt16_BeltAndBracesString(SvStream& rStrm);
which read the common msword pattern of null-terminated pascal-style
strings. Spolsky has amusing terminology for these FWIW
http://www.joelonsoftware.com/articles/fog0000000319.html
C.
Context
- [Libreoffice] some binary string reading methods, generally msword related · Caolán McNamara
Privacy Policy |
Impressum (Legal Info) |
Copyright information: Unless otherwise specified, all text and images
on this website are licensed under the
Creative Commons Attribution-Share Alike 3.0 License.
This does not include the source code of LibreOffice, which is
licensed under the Mozilla Public License (
MPLv2).
"LibreOffice" and "The Document Foundation" are
registered trademarks of their corresponding registered owners or are
in actual use as trademarks in one or more countries. Their respective
logos and icons are also subject to international copyright laws. Use
thereof is explained in our
trademark policy.