bsl::basic_stringbuf::basic_stringbuf

Constructors

Synopses

Declared in <bslstl_stringbuf.h>

Create a basic_stringbuf object having the same value as the specified original object by moving the contents of original to the newly-created object. Optionally specify the allocator used to supply memory. original is left in a valid but unspecified state.

basic_stringbuf(basic_stringbuf&& original);
» more...

Create a basic_stringbuf object. Use the specified initialString indicating the initial sequence of characters that this buffer will access or manipulate. Optionally specify a modeBitMask indicating whether this buffer may be read from, written to, or both. If modeBitMask is not supplied, this buffer is created with ios_base::in | ios_base::out. Optionally specify the allocator used to supply memory. If allocator is not supplied, the allocator in initialString is used. initialString is left in a valid but unspecified state.

explicit
basic_stringbuf(BloombergLP::bslmf::MovableRef<StringType> initialString);
» more...

Create a basic_stringbuf object. Optionally specify a modeBitMask indicating whether this buffer may be read from, written to, or both. If modeBitMask is not supplied, this buffer is created with ios_base::in | ios_base::out. Optionally specify an initialString indicating the initial sequence of characters that this buffer will access or manipulate. If initialString is not supplied, the initial sequence of characters will be empty. Optionally specify the allocator used to supply memory. If allocator is not supplied, a default-constructed object of the (template parameter) ALLOCATOR type is used. If the ALLOCATOR argument is of type bsl::allocator (the default), then allocator, if supplied, shall be convertible to bslma::Allocator *. If the ALLOCATOR argument is of type bsl::allocator and allocator is not supplied, the currently installed default allocator will be used to supply memory.

explicit
basic_stringbuf(allocator_type const& allocator = allocator_type());
» more...

Create a basic_stringbuf object. Use the specified initialString (of a type convertible to basic_string_view<CHAR_TYPE, CHAR_TRAITS> but not to const CHAR_TYPE *) indicating the initial sequence of characters that this buffer will access or manipulate. Optionally specify the allocator used to supply memory. If allocator is not supplied, a default-constructed object of the (template parameter) ALLOCATOR type is used. If the ALLOCATOR argument is of type bsl::allocator (the default), then allocator, if supplied, shall be convertible to bslma::Allocator *. If the ALLOCATOR argument is of type bsl::allocator and allocator is not supplied, the currently installed default allocator will be used to supply to supply memory. This buffer is created with ios_base::in | ios_base::out.

template<class STRING_VIEW_LIKE_TYPE>
explicit
basic_stringbuf(STRING_VIEW_LIKE_TYPE const& initialString);
» more...

Same as the constructor taking const allocator_type&.

explicit
basic_stringbuf(
    std::ios_base::openmode modeBitMask,
    allocator_type const& allocator = allocator_type());
» more...

Create a basic_stringbuf object. Use the specified initialString indicating the initial sequence of characters that this buffer will access or manipulate. Optionally specify a modeBitMask indicating whether this buffer may be read from, written to, or both. initialString is left in a valid but unspecified state.

basic_stringbuf(
    BloombergLP::bslmf::MovableRef<StringType> initialString,
    std::ios_base::openmode modeBitMask);
» more...

Create a basic_stringbuf object. Use the specified initialString indicating the initial sequence of characters that this buffer will access or manipulate. Optionally specify the allocator used to supply memory. initialString is left in a valid but unspecified state.

basic_stringbuf(
    BloombergLP::bslmf::MovableRef<StringType> initialString,
    allocator_type const& allocator);
» more...

Same as the constructor taking const allocator_type&.

explicit
basic_stringbuf(
    StringType const& initialString,
    allocator_type const& allocator = allocator_type());
» more...

Same as the move constructor taking basic_stringbuf&&.

basic_stringbuf(
    basic_stringbuf&& original,
    allocator_type const& allocator);
» more...

Create a basic_stringbuf object. Use the specified initialString (of a type convertible to basic_string_view<CHAR_TYPE, CHAR_TRAITS> but not to const CHAR_TYPE *) indicating the initial sequence of characters that this buffer will access or manipulate. Use the specified modeBitMask to indicate whether this buffer may be read from, written to, or both. Optionally specify the allocator used to supply memory. If allocator is not supplied, a default-constructed object of allocator_type is used. If the ALLOCATOR argument is of type bsl::allocator (the default), then allocator`, if supplied, shall be convertible to bslma::Allocator *. If the ALLOCATOR argument is of type bsl::allocator and allocator is not supplied, the currently installed default allocator will be used to supply memory.

template<class STRING_VIEW_LIKE_TYPE>
basic_stringbuf(
    STRING_VIEW_LIKE_TYPE const& initialString,
    std::ios_base::openmode modeBitMask);
» more...

Create a basic_stringbuf object. Use the specified initialString indicating the initial sequence of characters that this buffer will access or manipulate. Optionally specify the allocator used to supply memory. If allocator is not supplied, a default-constructed object of the (template parameter) ALLOCATOR type is used. If the ALLOCATOR argument is of type bsl::allocator (the default), then allocator, if supplied, shall be convertible to bslma::Allocator *. If the ALLOCATOR argument is of type bsl::allocator and allocator is not supplied, the currently installed default allocator will be used to supply memory.

template<class SALLOC>
explicit
basic_stringbuf(
    bsl::basic_string<CHAR_TYPE, CHAR_TRAITS, SALLOC> const& initialString,
    allocator_type const& allocator = allocator_type())
requires !bsl::is_same<ALLOCATOR, SALLOC>::value;
» more...

Create a basic_stringbuf object. Use the specified initialString indicating the initial sequence of characters that this buffer will access or manipulate. Optionally specify a modeBitMask indicating whether this buffer may be read from, written to, or both. If modeBitMask is not supplied, this buffer is created with ios_base::in | ios_base::out. Optionally specify the allocator used to supply memory. initialString is left in a valid but unspecified state.

basic_stringbuf(
    BloombergLP::bslmf::MovableRef<StringType> initialString,
    std::ios_base::openmode modeBitMask,
    allocator_type const& allocator);
» more...

Same as the constructor taking const StringType& and const allocator_type&.

basic_stringbuf(
    StringType const& initialString,
    std::ios_base::openmode modeBitMask,
    allocator_type const& allocator = allocator_type());
» more...

Create a basic_stringbuf object. Use the specified initialString indicating the initial sequence of characters that this buffer will access or manipulate. Use the specified modeBitMask to indicate whether this buffer may be read from, written to, or both. Optionally specify the allocator used to supply memory. If allocator is not supplied, a default-constructed object of the (template parameter) allocator_type is used. If the ALLOCATOR argument is of type bsl::allocator (the default), then allocator, if supplied, shall be convertible to bslma::Allocator *. If the ALLOCATOR argument is of type bsl::allocator and allocator is not supplied, the currently installed default allocator will be used to supply memory.

template<class SALLOC>
basic_stringbuf(
    bsl::basic_string<CHAR_TYPE, CHAR_TRAITS, SALLOC> const& initialString,
    std::ios_base::openmode modeBitMask,
    allocator_type const& allocator = allocator_type())
requires !bsl::is_same<ALLOCATOR, SALLOC>::value;
» more...