39#ifndef BLOCXX_BinarySerialization_HPP_
40#define BLOCXX_BinarySerialization_HPP_
41#include "blocxx/BLOCXX_config.h"
57namespace BinarySerialization
99 template <
typename Handler,
typename ReaderFunc>
101 std::streambuf & istrm, Handler & result,
102 const ReaderFunc &
read,
const UInt8 beginsig,
const UInt8 endsig)
110 result.handle(
read(istrm));
121 BLOCXX_COMMON_API
void write(
122 std::streambuf & ostrm,
const void * dataOut,
size_t dataOutLen
125 inline void write(std::streambuf & ostrm, Int32 val)
131 inline void write(std::streambuf & ostrm, UInt32 val)
137 BLOCXX_COMMON_API
void writeLen(std::streambuf & ostrm, UInt32 len);
144 inline void write(std::streambuf & ostrm, UInt16 val)
150 inline void write(std::streambuf & ostrm, Int16 val)
156 inline void write(std::streambuf & ostrm, UInt64 val)
162 inline void write(std::streambuf & ostrm, Int64 val)
185 BLOCXX_COMMON_API
void readLen(std::streambuf & istrm, UInt32 & len);
188 template <
typename T>
197 for (UInt32
i = 0;
i < len;
i++)
199 typename T::value_type x;
206 template <
typename T>
210 UInt32 len =
static_cast<UInt32
>(a.size());
212 for (UInt32
i = 0;
i < len;
i++)
214 a.operator[](
i).writeObject(ostrm);
227 std::streambuf & ostrm,
const StringArray * propertyList
231 BLOCXX_COMMON_API
void read(
232 std::streambuf & istrm,
void * dataIn,
size_t dataInLen
240 inline void read(std::streambuf & istrm, UInt64 & val)
246 inline void read(std::streambuf & istrm, Int64 & val)
252 inline void read(std::streambuf & istrm, Int32 & val)
258 inline void read(std::streambuf & istrm, UInt32 & val)
264 inline void read(std::streambuf & istrm, UInt16 & val)
270 inline void read(std::streambuf & istrm, Int16 & val)
The Bool class is an abstraction for the boolean data type.
void readObject(std::streambuf &istrm)
Read this object from an input stream.
void writeObject(std::streambuf &ostrm) const
Write this object to an output stream.
This String class is an abstract data type that represents as NULL terminated string of characters.
void writeObject(std::streambuf &ostrm) const
Write this String object to the given ostream.
void readObject(std::streambuf &istrm)
Read this String object from the given istream.
void readLen(std::streambuf &istrm, UInt32 &len)
void verifySignature(std::streambuf &istrm, UInt8 validSig)
void writeString(std::streambuf &ostrm, const String &str)
void read(std::streambuf &istrm, void *dataIn, size_t dataInLen)
void readArray(std::streambuf &istr, T &a)
void writeStringArray(std::streambuf &ostrm, const StringArray *propertyList)
const UInt8 END_STRINGENUM
void write(std::streambuf &ostrm, void const *dataOut, size_t dataOutLen)
const UInt8 BIN_EXCEPTION
const UInt32 MinBinaryProtocolVersion
String readString(std::streambuf &istrm)
void writeArray(std::streambuf &ostrm, const T &a)
void readEnum(std::streambuf &istrm, Handler &result, const ReaderFunc &read, const UInt8 beginsig, const UInt8 endsig)
void writeLen(std::streambuf &ostrm, UInt32 len)
StringArray readStringArray(std::streambuf &istrm)
const UInt32 BinaryProtocolVersion
const UInt8 BIN_LOG_MESSAGE
const UInt8 BINSIG_STRINGENUM
void writeBool(std::streambuf &ostrm, Bool arg)
const UInt8 BINSIG_STRARRAY
Bool readBool(std::streambuf &istrm)