|
| basic_stringbuf (const allocator_type &allocator=allocator_type()) |
|
| basic_stringbuf (ios_base::openmode modeBitMask, const allocator_type &allocator=allocator_type()) |
|
| basic_stringbuf (const StringType &initialString, const allocator_type &allocator=allocator_type()) |
|
| basic_stringbuf (const StringType &initialString, ios_base::openmode modeBitMask, const allocator_type &allocator=allocator_type()) |
|
| basic_stringbuf (BloombergLP::bslmf::MovableRef< StringType > initialString) |
|
| basic_stringbuf (BloombergLP::bslmf::MovableRef< StringType > initialString, const allocator_type &allocator) |
|
| basic_stringbuf (BloombergLP::bslmf::MovableRef< StringType > initialString, ios_base::openmode modeBitMask) |
|
| basic_stringbuf (BloombergLP::bslmf::MovableRef< StringType > initialString, ios_base::openmode modeBitMask, const allocator_type &allocator) |
|
template<class SALLOC > |
| basic_stringbuf (const bsl::basic_string< CHAR_TYPE, CHAR_TRAITS, SALLOC > &initialString, const allocator_type &allocator=allocator_type(), typename bsl::enable_if< !bsl::is_same< ALLOCATOR, SALLOC >::value, void * >::type=0) |
|
template<class SALLOC > |
| basic_stringbuf (const bsl::basic_string< CHAR_TYPE, CHAR_TRAITS, SALLOC > &initialString, ios_base::openmode modeBitMask, const allocator_type &allocator=allocator_type(), typename bsl::enable_if< !bsl::is_same< ALLOCATOR, SALLOC >::value, void * >::type=0) |
|
| ~basic_stringbuf () |
| Destroy this object.
|
|
void | str (const StringType &value) |
|
void | str (BloombergLP::bslmf::MovableRef< StringType > value) |
| Note: implemented inline due to Sun CC compilation error.
|
|
template<class SALLOC > |
bsl::enable_if<!bsl::is_same< ALLOCATOR, SALLOC >::value, void >::type | str (const basic_string< CHAR_TYPE, CHAR_TRAITS, SALLOC > &value) |
|
void | swap (basic_stringbuf &other) |
|
allocator_type | get_allocator () const BSLS_KEYWORD_NOEXCEPT |
| Return the allocator used by the underlying string to supply memory.
|
|
StringType | str () const |
|
template<class SALLOC > |
bsl::enable_if< bsl::IsStdAllocator< SALLOC >::value, basic_string< CHAR_TYPE, CHAR_TRAITS, SALLOC > >::type | str (const SALLOC &allocator) const |
|
ViewType | view () const BSLS_KEYWORD_NOEXCEPT |
|
template<class CHAR_TYPE, class CHAR_TRAITS, class ALLOCATOR>
class bsl::basic_stringbuf< CHAR_TYPE, CHAR_TRAITS, ALLOCATOR >
This class implements a standard stream buffer providing an unformatted character input sequence and an unformatted character output sequence that may be initialized or accessed using a string value.
template<class CHAR_TYPE , class CHAR_TRAITS , class ALLOCATOR >
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.
template<class CHAR_TYPE , class CHAR_TRAITS , class ALLOCATOR >
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.
template<class CHAR_TYPE , class CHAR_TRAITS , class ALLOCATOR >
template<class SALLOC >
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 CHAR_TYPE , class CHAR_TRAITS , class ALLOCATOR >
template<class SALLOC >
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.
Note: implemented inline due to Sun CC compilation error.
template<class CHAR_TYPE , class CHAR_TRAITS , class ALLOCATOR >
Append the specified character
to the output sequence of this stream buffer at the current output position (pptr
), and advance the output position by one. This operation may update the end of output area (epptr
) to allow for additional writes (e.g., by the base basic_streambuf type) to the output sequence without calling a method on this type. Return the written character on success, and traits_type::eof()
if character
is traits_type::eof()
or this stream buffer was not opened for writing.
template<class CHAR_TYPE , class CHAR_TRAITS , class ALLOCATOR >
Put back the specified character
into the input sequence so that the next character read from the input sequence will be character
. If character
is either traits_type::eof()
or is the same as the previously read character from the input sequence, then adjust the current input position, gptr
, back one position. If character
is neither traits_type::eof()
nor the character previously read from the input sequence, but this string buffer was opened for writing (ios_base::out
), then adjust the input sequence back one position and write character
to that position. Return the character that was put back on success and traits_type::eof()
if either the input position is currently at the beginning of the sequence or if the previous character in the input sequence is not character
and this buffer was not opened for writing.
template<class CHAR_TYPE , class CHAR_TRAITS , class ALLOCATOR >
Set the current input position or the current output position (or both) to the specified offset
from the specified whence
location. Optionally specify a modeBitMask
indicating whether to set the current input position, current output position, or both. If whence
is ios_base::beg
, set the current position to the indicated offset
from the beginning of the stream; if whence
is ios_base::end
, set the current position to the indicated offset
from the end of the stream; and if whence
is ios_base::cur
, set the current input or output position to the indicated offset
from its current position. If whence
is ios_base::cur
, then modeBitMask
may be either ios_base::in
or ios_base::out
, but not both. Return the offset of the new position on success, and pos_type(off_type(-1))
otherwise.
template<class CHAR_TYPE , class CHAR_TRAITS , class ALLOCATOR >
Set the current input position or the current output position (or both) to the specified absoluteOffset
from the beginning of the stream. Optionally specify a modeBitMask
indicating whether to set the current input position, current output position, or both. Return the offset of the new position on success, and pos_type(off_type(-1))
otherwise.
template<class CHAR_TYPE , class CHAR_TRAITS , class ALLOCATOR >
Return the currently buffered sequence of characters. If this object was created only in input mode, the resultant StringType
contains the character sequence in the range [eback(), egptr())
. If modeBitMask & ios_base::out
specified at construction is nonzero then the resultant StringType
contains the character sequence in the range [pbase(), high_mark)
, where high_mark represents the position one past the highest initialized character in the buffer. Otherwise this object has been created in neither input nor output mode and a zero length StringType
is returned.
template<class CHAR_TYPE , class CHAR_TRAITS , class ALLOCATOR >
template<class SALLOC >
Return the currently buffered sequence of characters in a basic_string that uses the specified allocator
. If this object was created only in input mode, the resultant basic_string contains the character sequence in the range [eback(), egptr())
. If modeBitMask & ios_base::out
specified at construction is nonzero then the resultant basic_string contains the character sequence in the range [pbase(), high_mark)
, where high_mark represents the position one past the highest initialized character in the buffer. Otherwise this object has been created in neither input nor output mode and a zero length basic_string is returned.
Note: implemented inline due to Sun CC compilation error.
template<class CHAR_TYPE , class CHAR_TRAITS , class ALLOCATOR >
Reset the internally buffered sequence of characters to the specified value
. Update the beginning and end of both the input and output sequences to be the beginning and end of the updated buffer, update the current input position to be the beginning of the updated buffer, and update the current output position to be the end of the updated buffer. If value
is passed by MovableRef
, then it is left in an unspecified but valid state.
template<class CHAR_TYPE , class CHAR_TRAITS , class ALLOCATOR >
Return the character at the current input position and advance the input position by 1. If no character is available at the current input position, return traits_type::eof()
. Update the end of the input area, egptr
, if additional characters are available (as may occur if additional characters have been written to the string buffer). Note that this operation is similar to underflow
, but advances the current input position.
template<class CHAR_TYPE , class CHAR_TRAITS , class ALLOCATOR >
Return the character at the current input position, if a character is available, and traits_type::eof()
otherwise. Update the end of the input area, egptr
, if additional characters are available (as may occur if additional characters have been written to the string buffer). Note that this operation is similar to uflow
, but does not advance the current input position.
template<class CHAR_TYPE , class CHAR_TRAITS , class ALLOCATOR >
Return a string_view containing the currently buffered sequence of characters. If this object was created only in input mode, the resultant ViewType
contains the character sequence in the range [eback(), egptr())
. If modeBitMask & ios_base::out
specified at construction is nonzero then the resultant StringType
contains the character sequence in the range [pbase(), high_mark)
, where high_mark represents the position one past the highest initialized character in the buffer. Otherwise this object has been created in neither input nor output mode and a zero length ViewType
is returned.