21 INLINE StreamWrapperBase::
78 INLINE IStreamWrapper::
79 IStreamWrapper(istream *stream,
bool owns_pointer) :
81 _owns_pointer(owns_pointer)
90 INLINE IStreamWrapper::
91 IStreamWrapper(istream &stream) :
116 result = _istream->get();
127 INLINE OStreamWrapper::
128 OStreamWrapper(ostream *stream,
bool owns_pointer,
bool stringstream_hack) :
130 _owns_pointer(owns_pointer)
132 , _stringstream_hack(stringstream_hack)
142 INLINE OStreamWrapper::
143 OStreamWrapper(ostream &stream) :
147 , _stringstream_hack(
false)
173 success = !_ostream->bad();
183 INLINE StreamWrapper::
184 StreamWrapper(iostream *stream,
bool owns_pointer,
bool stringstream_hack) :
188 _owns_pointer(owns_pointer)
197 INLINE StreamWrapper::
198 StreamWrapper(iostream &stream) :
ostream * get_ostream() const
Returns the ostream this object is wrapping.
iostream * get_iostream() const
Returns the iostream this object is wrapping.
int get()
Atomically reads a single character from the stream.
void release()
Releases the internal lock.
This class provides a locking wrapper around an arbitrary istream pointer.
istream * get_istream() const
Returns the istream this object is wrapping.
bool put(char c)
Atomically writes a single character to the stream.
void acquire()
Acquires the internal lock.
This class provides a locking wrapper around an arbitrary ostream pointer.