summaryrefslogtreecommitdiff
path: root/include
diff options
context:
space:
mode:
authorNoel Grandin <noel@peralex.com>2014-02-06 12:44:59 +0200
committerMichael Stahl <mstahl@redhat.com>2014-02-12 15:32:11 +0000
commitb2878af3223c438abeecc77d9976e56db31a5b49 (patch)
tree74ccf2cfdbec9093671eb98cb58dfe57f27461f1 /include
parent15535e32ddcfee451d4dbc9be9de0b8c9f9d78d4 (diff)
more SvStream:operator>> conversion
Convert the template based read_lenPrefixed methods to regular methods. Change-Id: Ifd0e93aca055e55a0575e4377ec2b8e266dfb019 Reviewed-on: https://gerrit.libreoffice.org/7895 Reviewed-by: Michael Stahl <mstahl@redhat.com> Tested-by: Michael Stahl <mstahl@redhat.com>
Diffstat (limited to 'include')
-rw-r--r--include/tools/inetmsg.hxx4
-rw-r--r--include/tools/stream.hxx46
2 files changed, 37 insertions, 13 deletions
diff --git a/include/tools/inetmsg.hxx b/include/tools/inetmsg.hxx
index 1f9e47715e71..0e954ca82792 100644
--- a/include/tools/inetmsg.hxx
+++ b/include/tools/inetmsg.hxx
@@ -73,8 +73,8 @@ public:
friend SvStream& ReadINetMessageHeader (
SvStream& rStrm, INetMessageHeader& rHdr)
{
- rHdr.m_aName = read_lenPrefixed_uInt8s_ToOString<sal_uInt16>(rStrm);
- rHdr.m_aValue = read_lenPrefixed_uInt8s_ToOString<sal_uInt16>(rStrm);
+ rHdr.m_aName = read_uInt16_lenPrefixed_uInt8s_ToOString(rStrm);
+ rHdr.m_aValue = read_uInt16_lenPrefixed_uInt8s_ToOString(rStrm);
return rStrm;
}
};
diff --git a/include/tools/stream.hxx b/include/tools/stream.hxx
index 670416376293..81ef96f86361 100644
--- a/include/tools/stream.hxx
+++ b/include/tools/stream.hxx
@@ -550,11 +550,17 @@ TOOLS_DLLPUBLIC OUString read_uInt16s_ToOUString(SvStream& rStrm,
/// Attempt to read a pascal-style length (of type prefix) prefixed sequence of
/// 16bit units to an OUString, returned OString's length is number of
/// units successfully read.
-template<typename prefix>
-OUString read_lenPrefixed_uInt16s_ToOUString(SvStream& rStrm)
+TOOLS_DLLPUBLIC inline OUString read_uInt16_lenPrefixed_uInt16s_ToOUString(SvStream& rStrm)
{
- prefix nUnits = 0;
- rStrm >> nUnits;
+ sal_uInt16 nUnits = 0;
+ rStrm.ReadUInt16( nUnits );
+ return read_uInt16s_ToOUString(rStrm, nUnits);
+}
+
+TOOLS_DLLPUBLIC inline OUString read_uInt32_lenPrefixed_uInt16s_ToOUString(SvStream& rStrm)
+{
+ sal_uInt32 nUnits = 0;
+ rStrm.ReadUInt32( nUnits );
return read_uInt16s_ToOUString(rStrm, nUnits);
}
@@ -595,21 +601,39 @@ 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.
-template<typename prefix>
-OString read_lenPrefixed_uInt8s_ToOString(SvStream& rStrm)
+TOOLS_DLLPUBLIC inline OString read_uInt16_lenPrefixed_uInt8s_ToOString(SvStream& rStrm)
+{
+ sal_uInt16 nUnits = 0;
+ rStrm.ReadUInt16( nUnits );
+ return read_uInt8s_ToOString(rStrm, nUnits);
+}
+
+TOOLS_DLLPUBLIC inline OString read_uInt8_lenPrefixed_uInt8s_ToOString(SvStream& rStrm)
{
- prefix nUnits = 0;
- rStrm >> nUnits;
+ sal_uInt8 nUnits = 0;
+ rStrm.ReadUChar( nUnits );
+ return read_uInt8s_ToOString(rStrm, nUnits);
+}
+
+TOOLS_DLLPUBLIC inline OString read_uInt32_lenPrefixed_uInt8s_ToOString(SvStream& rStrm)
+{
+ sal_uInt32 nUnits = 0;
+ rStrm.ReadUInt32( 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
-template<typename prefix>
-OUString read_lenPrefixed_uInt8s_ToOUString(SvStream& rStrm,
+TOOLS_DLLPUBLIC inline OUString read_uInt16_lenPrefixed_uInt8s_ToOUString(SvStream& rStrm,
+ rtl_TextEncoding eEnc)
+{
+ return OStringToOUString(read_uInt16_lenPrefixed_uInt8s_ToOString(rStrm), eEnc);
+}
+
+TOOLS_DLLPUBLIC inline OUString read_uInt8_lenPrefixed_uInt8s_ToOUString(SvStream& rStrm,
rtl_TextEncoding eEnc)
{
- return OStringToOUString(read_lenPrefixed_uInt8s_ToOString<prefix>(rStrm), eEnc);
+ return OStringToOUString(read_uInt8_lenPrefixed_uInt8s_ToOString(rStrm), eEnc);
}
/// Attempt to write a prefixed sequence of nUnits 8bit units from an OString,