Commit Graph

13 Commits

Author SHA1 Message Date
Michael Meeks
328e2263fb targetted re-work of cppunit pieces. 2012-06-27 19:13:11 +01:00
Olivier Hallot
81e50fb2e3 Fix for fdo43460 Part XXXIX getLength() to isEmpty()
Part XXXIX
Modules
testtools, toolkit, tools
2012-01-16 18:49:04 -02:00
Caolán McNamara
94a8737a54 drop strange embedded null handling behaviour 2012-01-16 15:40:53 +00:00
Caolán McNamara
9790e4457f document with unit test rather suspicious eof handling
ReadLine differs from std::getline with respect to final lines
that end at EOF with no EOL.

i.e. see Export::ConvertLineEnds in l10ntools/source/export2.cxx
which doesn't make a massive amount of sense the way things currently are.
2012-01-16 10:21:56 +00:00
Caolán McNamara
456853e96c document with unit test rather odd embedded null handling 2012-01-16 10:21:56 +00:00
Caolán McNamara
c4f0efc237 convert ReadByteString/WriteByteString from ByteString to OString
Nobody ever used the return values anyway, so for reading just
return the string and for writing the number of bytes written

Doesn't need to be members, make standalone functions

Rename  to
read_lenPrefixed_uInt8s_ToO[U]String and
write_lenPrefixed_uInt8s_FromO[U]String, lengthy,
but much less unambiguous, seeing as a lot of users of it don't
seem to be aware that they read/write pascal-style length
prefixed strings, which isn't surprising given the
apparent simplicity of their original name.

added a unit test
2011-12-21 13:44:52 +00:00
Caolán McNamara
6708977331 needs more work first
This reverts commit 92f396733e.
2011-12-21 10:30:10 +00:00
Caolán McNamara
92f396733e convert ReadByteString/WriteByteString from ByteString to OString
Nobody ever used the return values anyway, so for reading just
return the string and for writing the number of bytes written

Doesn't need to be members, make standalone functions

Rename  to
read_lenPrefixed_uInt8s_ToO[U]String and
write_lenPrefixed_uInt8s_FromO[U]String, lengthy,
but much less unambiguous, seeing as a lot of users of it don't
seem to be aware that they read/write pascal-style length
prefixed strings, which isn't surprising given the
apparent simplicity of their original name.

added a unit test
2011-12-21 10:10:58 +00:00
Caolán McNamara
66c3655a07 convert ReadCString from ByteString to OString
Nobody ever checked the return value anyway, so just return the string
and use the stream state bits if necessary to find failures.

Doesn't need to be a member, make a standalone function

Rename it to read_zeroTerminated_uInt8s_AsO[U]String, stupid perhaps,
but *shrug*, unambiguous.

Drop misleading overloaded String variants use:
read_zeroTerminated_uInt8s_AsOString or
read_zeroTerminated_uInt8s_AsOUString

added a unit test, valgrinded it, found and fixed invalid read
in original implementation.
2011-12-15 12:22:49 +00:00
Norbert Thiebaud
5f7649aead remove include of pch header from tools 2011-11-27 13:25:56 -06:00
Stephan Bergmann
d996328cd5 sb140: #i113503# mixing system CppUnit and OOo STLport does not work, backed out a6913c9677c2
For LibO, that just means replacing sal/cppunit.h with sal/precppunit.hxx.
2011-09-12 22:47:50 +02:00
Caolán McNamara
e99a072c0e add a fairly efficient read_LEuInt16s_AsOUString, merge similar things 2011-09-05 10:54:19 +01:00
Caolán McNamara
0ee8ec18c4 add a way to better construct an OString of len X from a SvStream 2011-09-02 09:54:18 +01:00