2 #ifndef CHEPREP_DEFLATEOUTPUTSTREAMBUF_H
3 #define CHEPREP_DEFLATEOUTPUTSTREAMBUF_H
10 #ifndef CHEPREP_NO_ZLIB
12 #endif // CHEPREP_NO_ZLIB
34 #ifndef CHEPREP_NO_ZLIB
36 #endif // CHEPREP_NO_ZLIB
38 inline void putUI(
unsigned int ui) {
39 unsigned char* ucp =
reinterpret_cast<unsigned char *
>(&ui);
40 unsigned int i = (
static_cast<unsigned int>(ucp[ 3 ]) << 24) +
41 (
static_cast<unsigned int>(ucp[ 2 ]) << 16) +
42 (
static_cast<unsigned int>(ucp[ 1 ]) << 8 ) +
43 (
static_cast<unsigned int>(ucp[ 0 ]));
44 buffer->sputn(reinterpret_cast<char *>(&i),
sizeof(
unsigned int));
48 unsigned char* ucp =
reinterpret_cast<unsigned char *
>(&
us);
49 unsigned short s = (
static_cast<unsigned short>(ucp[ 1 ]) << 8 ) +
50 (
static_cast<unsigned short>(ucp[ 0 ]));
51 buffer->sputn(reinterpret_cast<char *>(&s),
sizeof(
unsigned short));
54 inline void putUB(
unsigned char ub) {
58 inline void putS(
const std::string
s) {
59 buffer->sputn(s.c_str(), s.length());
62 inline std::streampos
pos() {
63 std::ostream os(buffer);
82 #ifndef CHEPREP_NO_ZLIB
83 static const unsigned int inSize = 1000;
89 std::vector<char>
out;
90 #endif // CHEPREP_NO_ZLIB
98 #endif // CHEPREP_DEFLATEOUTPUTSTREAMBUF_H