14 #ifndef STREAMWRAPPER_H
15 #define STREAMWRAPPER_H
31 INLINE
void acquire();
32 INLINE
void release();
35 INLINE
void ref()
const;
36 INLINE
bool unref()
const;
43 mutable AtomicAdjust::Integer _ref_count = 1;
66 INLINE std::istream *get_istream()
const;
67 MAKE_PROPERTY(std::istream, get_istream);
70 void read(
char *buffer, std::streamsize num_bytes);
71 void read(
char *buffer, std::streamsize num_bytes, std::streamsize &read_bytes);
72 void read(
char *buffer, std::streamsize num_bytes, std::streamsize &read_bytes,
bool &eof);
73 void seek_read(std::streamsize pos,
char *buffer, std::streamsize num_bytes, std::streamsize &read_bytes,
bool &eof);
75 std::streamsize seek_gpos_eof();
78 std::istream *_istream;
88 INLINE
OStreamWrapper(std::ostream *stream,
bool owns_pointer,
bool stringstream_hack =
false);
93 INLINE std::ostream *get_ostream()
const;
94 MAKE_PROPERTY(std::ostream, get_ostream);
97 void write(
const char *buffer, std::streamsize num_bytes);
98 void write(
const char *buffer, std::streamsize num_bytes,
bool &fail);
99 void seek_write(std::streamsize pos,
const char *buffer, std::streamsize num_bytes,
bool &fail);
100 void seek_eof_write(
const char *buffer, std::streamsize num_bytes,
bool &fail);
101 INLINE
bool put(
char c);
102 std::streamsize seek_ppos_eof();
105 std::ostream *_ostream;
114 bool _stringstream_hack;
124 INLINE
StreamWrapper(std::iostream *stream,
bool owns_pointer,
bool stringstream_hack =
false);
129 INLINE std::iostream *get_iostream()
const;
130 MAKE_PROPERTY(std::iostream, get_iostream);
133 std::iostream *_iostream;