39 #ifndef BLOCXX_BinarySerialization_HPP_
40 #define BLOCXX_BinarySerialization_HPP_
41 #include "blocxx/BLOCXX_config.h"
54 namespace BLOCXX_NAMESPACE
57 namespace 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)
309 #endif // BLOCXX_BinarySerialization_HPP_