[#bsl-basic_stringbuf-str-0d9]
= xref:bsl.adoc[bsl]::xref:bsl/basic_stringbuf.adoc[basic&lowbar;stringbuf]::str
:relfileprefix: ../../
:mrdocs:

`str` overloads

== Synopses

Declared in `&lt;bslstl&lowbar;stringbuf&period;h&gt;`

Return the currently buffered sequence of characters&period; If this object was created only in input mode, the resultant `StringType` contains the character sequence in the range `&lsqb;eback(), egptr())&rsqb;`&period; If `modeBitMask &amp; ios&lowbar;base&colon;&colon;out` specified at construction is nonzero then the resultant `StringType` contains the character sequence in the range `&lsqb;pbase(), high&lowbar;mark)&rsqb;`, where `high&lowbar;mark` represents the position one past the highest initialized character in the buffer&period; Otherwise this object has been created in neither input nor output mode and a zero length `StringType` is returned&period; This object is left in an empty state&period;


[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
xref:bsl/basic_stringbuf.adoc[basic&lowbar;stringbuf&lt;CHAR&lowbar;TYPE, CHAR&lowbar;TRAITS, ALLOCATOR&gt;::StringType]
xref:bsl/basic_stringbuf/str-0cb.adoc[str]() &amp;&amp;;
----

[.small]#xref:bsl/basic_stringbuf/str-0cb.adoc[_» more&period;&period;&period;_]#

Return the currently buffered sequence of characters&period; If this object was created only in input mode, the resultant `StringType` contains the character sequence in the range `&lsqb;eback(), egptr())&rsqb;`&period; If `modeBitMask &amp; ios&lowbar;base&colon;&colon;out` specified at construction is nonzero then the resultant `StringType` contains the character sequence in the range `&lsqb;pbase(), high&lowbar;mark)&rsqb;`, where `high&lowbar;mark` represents the position one past the highest initialized character in the buffer&period; Otherwise this object has been created in neither input nor output mode and a zero length `StringType` is returned&period;


[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
xref:bsl/basic_stringbuf.adoc[basic&lowbar;stringbuf&lt;CHAR&lowbar;TYPE, CHAR&lowbar;TRAITS, ALLOCATOR&gt;::StringType]
xref:bsl/basic_stringbuf/str-09.adoc[str]() const &amp;;
----

[.small]#xref:bsl/basic_stringbuf/str-09.adoc[_» more&period;&period;&period;_]#

Same as the `str` overload taking `const StringType&amp;`&period;


[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
void
xref:bsl/basic_stringbuf/str-0cf.adoc[str](xref:BloombergLP/bslmf/MovableRef.adoc[BloombergLP::bslmf::MovableRef&lt;StringType&gt;] value);
----

[.small]#xref:bsl/basic_stringbuf/str-0cf.adoc[_» more&period;&period;&period;_]#

Reset the internally buffered sequence of characters to the specified `value`&period; 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&period; If `value` is passed by `MovableRef`, then it is left in an unspecified but valid state&period;


[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&period;&period;&period;_]#

Return the currently buffered sequence of characters in a `basic&lowbar;string` that uses the specified `allocator`&period; If this object was created only in input mode, the resultant `basic&lowbar;string` contains the character sequence in the range `&lsqb;eback(), egptr())&rsqb;`&period; If `modeBitMask &amp; ios&lowbar;base&colon;&colon;out` specified at construction is nonzero then the resultant `basic&lowbar;string` contains the character sequence in the range `&lsqb;pbase(), high&lowbar;mark)&rsqb;`, where `high&lowbar;mark` represents the position one past the highest initialized character in the buffer&period; Otherwise this object has been created in neither input nor output mode and a zero length `basic&lowbar;string` is returned&period;


[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
template&lt;class SALLOC&gt;
xref:bsl/basic_string-0faf.adoc[basic&lowbar;string&lt;CHAR&lowbar;TYPE, CHAR&lowbar;TRAITS, SALLOC&gt;]
xref:bsl/basic_stringbuf/str-03.adoc[str](SALLOC const& allocator) const
requires bsl&colon;&colon;IsStdAllocator&lt;SALLOC&gt;&colon;&colon;value;
----

[.small]#xref:bsl/basic_stringbuf/str-03.adoc[_» more&period;&period;&period;_]#

Reset the internally buffered sequence of characters to the specified `value` (of a type convertible to `basic&lowbar;string&lowbar;view&lt;CHAR&lowbar;TYPE, CHAR&lowbar;TRAITS&gt;` but not to `const CHAR&lowbar;TYPE &ast;`)&period;


[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
template&lt;class STRING&lowbar;VIEW&lowbar;LIKE&lowbar;TYPE&gt;
void
xref:bsl/basic_stringbuf/str-0dd.adoc[str](STRING&lowbar;VIEW&lowbar;LIKE&lowbar;TYPE const& value);
----

[.small]#xref:bsl/basic_stringbuf/str-0dd.adoc[_» more&period;&period;&period;_]#

Same as the `str` overload taking `const StringType&amp;`&period;


[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
template&lt;class SALLOC&gt;
void
xref:bsl/basic_stringbuf/str-07.adoc[str](xref:bsl/basic_string-0faf.adoc[basic&lowbar;string&lt;CHAR&lowbar;TYPE, CHAR&lowbar;TRAITS, SALLOC&gt;] const& value)
requires !bsl&colon;&colon;is&lowbar;same&lt;ALLOCATOR, SALLOC&gt;&colon;&colon;value;
----

[.small]#xref:bsl/basic_stringbuf/str-07.adoc[_» more&period;&period;&period;_]#


[.small]#Created with https://www.mrdocs.com[MrDocs]#
