8#ifndef INCLUDED_BSLSTL_OSYNCSTREAM
9#define INCLUDED_BSLSTL_OSYNCSTREAM
128#include <bslscm_version.h>
137#ifdef BSLS_LIBRARYFEATURES_HAS_CPP11_STREAM_MOVE
153template <
class CHAR_TYPE,
class CHAR_TRAITS,
class ALLOCATOR>
157 typedef std::basic_ostream<CHAR_TYPE, CHAR_TRAITS> Base;
188 const ALLOCATOR&
allocator = ALLOCATOR());
200 std::basic_ostream<CHAR_TYPE, CHAR_TRAITS>& stream,
201 const ALLOCATOR&
allocator = ALLOCATOR());
206#ifdef BSLS_LIBRARYFEATURES_HAS_CPP11_STREAM_MOVE
219#ifdef BSLS_LIBRARYFEATURES_HAS_CPP11_STREAM_MOVE
257template <class CHAR, class TRAITS, class ALLOCATOR>
262#ifndef BSLS_LIBRARYFEATURES_STDCPP_LIBCSTD
271#ifdef BSLS_LIBRARYFEATURES_STDCPP_LIBCSTD
272 this->init(&d_syncbuf);
276template <
class CHAR,
class TRAITS,
class ALLOCATOR>
278 std::basic_ostream<CHAR,TRAITS>& stream,
281#ifndef BSLS_LIBRARYFEATURES_STDCPP_LIBCSTD
286#ifdef BSLS_LIBRARYFEATURES_STDCPP_LIBCSTD
287 this->init(&d_syncbuf);
291#ifdef BSLS_LIBRARYFEATURES_HAS_CPP11_STREAM_MOVE
292template <
class CHAR,
class TRAITS,
class ALLOCATOR>
295: Base(std::move(original))
296, d_syncbuf(std::move(original.d_syncbuf))
298 this->set_rdbuf(&d_syncbuf);
301template <
class CHAR,
class TRAITS,
class ALLOCATOR>
303 basic_osyncstream&& original,
305: Base(std::move(original))
306, d_syncbuf(std::move(original.d_syncbuf), allocator)
308 this->set_rdbuf(&d_syncbuf);
313template <
class CHAR,
class TRAITS,
class ALLOCATOR>
316 typename Base::sentry ok(*
this);
318 this->setstate(ios_base::badbit);
321 if (!d_syncbuf.
emit()) {
322 this->setstate(ios_base::badbit);
328template <
class CHAR,
class TRAITS,
class ALLOCATOR>
336template <
class CHAR,
class TRAITS,
class ALLOCATOR>
345template <
class CHAR,
class TRAITS,
class ALLOCATOR>
Definition bslma_bslallocator.h:580
Definition bslstl_osyncstream.h:154
basic_syncbuf< CHAR_TYPE, CHAR_TRAITS, ALLOCATOR > syncbuf_type
Definition bslstl_osyncstream.h:169
ALLOCATOR allocator_type
Definition bslstl_osyncstream.h:166
void emit()
Definition bslstl_osyncstream.h:314
basic_osyncstream(streambuf_type *wrapped, const ALLOCATOR &allocator=ALLOCATOR())
Definition bslstl_osyncstream.h:258
streambuf_type * get_wrapped() const BSLS_KEYWORD_NOEXCEPT
Return the wrapped buffer.
Definition bslstl_osyncstream.h:339
CHAR_TRAITS::off_type off_type
Definition bslstl_osyncstream.h:164
syncbuf_type * rdbuf() const BSLS_KEYWORD_NOEXCEPT
Definition bslstl_osyncstream.h:348
allocator_type get_allocator() const BSLS_KEYWORD_NOEXCEPT
Return the allocator used to supply memory.
Definition bslstl_osyncstream.h:330
CHAR_TRAITS::int_type int_type
Definition bslstl_osyncstream.h:162
CHAR_TRAITS traits_type
Definition bslstl_osyncstream.h:165
basic_osyncstream(std::basic_ostream< CHAR_TYPE, CHAR_TRAITS > &stream, const ALLOCATOR &allocator=ALLOCATOR())
~basic_osyncstream()=default
CHAR_TYPE char_type
Definition bslstl_osyncstream.h:161
std::basic_streambuf< CHAR_TYPE, CHAR_TRAITS > streambuf_type
Definition bslstl_osyncstream.h:168
CHAR_TRAITS::pos_type pos_type
Definition bslstl_osyncstream.h:163
Definition bslstl_syncbuf.h:152
bool emit()
Definition bslstl_syncbuf.h:372
allocator_type get_allocator() const BSLS_KEYWORD_NOEXCEPT
Return the allocator used to supply memory.
Definition bslstl_syncbuf.h:464
streambuf_type * get_wrapped() const BSLS_KEYWORD_NOEXCEPT
Return the wrapped buffer supplied at construction.
Definition bslstl_syncbuf.h:473
#define BSLS_IDENT(str)
Definition bsls_ident.h:195
#define BSLS_KEYWORD_NOEXCEPT
Definition bsls_keyword.h:632
Definition bdlb_printmethods.h:283