[#bsl-basic_stringbuf-str-0d9] = xref:bsl.adoc[bsl]::xref:bsl/basic_stringbuf.adoc[basic_stringbuf]::str :relfileprefix: ../../ :mrdocs: `str` overloads == Synopses Declared in `<bslstl_stringbuf.h>` 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. This object is left in an empty state. [source,cpp,subs="verbatim,replacements,macros,-callouts"] ---- xref:bsl/basic_stringbuf.adoc[basic_stringbuf<CHAR_TYPE, CHAR_TRAITS, ALLOCATOR>::StringType] xref:bsl/basic_stringbuf/str-0cb.adoc[str]() &&; ---- [.small]#xref:bsl/basic_stringbuf/str-0cb.adoc[_» more..._]# 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. [source,cpp,subs="verbatim,replacements,macros,-callouts"] ---- xref:bsl/basic_stringbuf.adoc[basic_stringbuf<CHAR_TYPE, CHAR_TRAITS, ALLOCATOR>::StringType] xref:bsl/basic_stringbuf/str-09.adoc[str]() const &; ---- [.small]#xref:bsl/basic_stringbuf/str-09.adoc[_» more..._]# Same as the `str` overload taking `const StringType&`. [source,cpp,subs="verbatim,replacements,macros,-callouts"] ---- void xref:bsl/basic_stringbuf/str-0cf.adoc[str](xref:BloombergLP/bslmf/MovableRef.adoc[BloombergLP::bslmf::MovableRef<StringType>] value); ---- [.small]#xref:bsl/basic_stringbuf/str-0cf.adoc[_» more..._]# 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. [source,cpp,subs="verbatim,replacements,macros,-callouts"] ---- void xref:bsl/basic_stringbuf/str-0c4.adoc[str](xref:bsl/basic_stringbuf.adoc[StringType] const& value); ---- [.small]#xref:bsl/basic_stringbuf/str-0c4.adoc[_» more..._]# 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. [source,cpp,subs="verbatim,replacements,macros,-callouts"] ---- template<class SALLOC> xref:bsl/basic_string-0faf.adoc[basic_string<CHAR_TYPE, CHAR_TRAITS, SALLOC>] xref:bsl/basic_stringbuf/str-03.adoc[str](SALLOC const& allocator) const requires bsl::IsStdAllocator<SALLOC>::value; ---- [.small]#xref:bsl/basic_stringbuf/str-03.adoc[_» more..._]# Reset the internally buffered sequence of characters to the specified `value` (of a type convertible to `basic_string_view<CHAR_TYPE, CHAR_TRAITS>` but not to `const CHAR_TYPE *`). [source,cpp,subs="verbatim,replacements,macros,-callouts"] ---- template<class STRING_VIEW_LIKE_TYPE> void xref:bsl/basic_stringbuf/str-0dd.adoc[str](STRING_VIEW_LIKE_TYPE const& value); ---- [.small]#xref:bsl/basic_stringbuf/str-0dd.adoc[_» more..._]# Same as the `str` overload taking `const StringType&`. [source,cpp,subs="verbatim,replacements,macros,-callouts"] ---- template<class SALLOC> void xref:bsl/basic_stringbuf/str-07.adoc[str](xref:bsl/basic_string-0faf.adoc[basic_string<CHAR_TYPE, CHAR_TRAITS, SALLOC>] const& value) requires !bsl::is_same<ALLOCATOR, SALLOC>::value; ---- [.small]#xref:bsl/basic_stringbuf/str-07.adoc[_» more..._]# [.small]#Created with https://www.mrdocs.com[MrDocs]#