[#bsl-basic_stringbuf-seekpos-00]
= xref:bsl.adoc[bsl]::xref:bsl/basic_stringbuf.adoc[basic&lowbar;stringbuf]::seekpos
:relfileprefix: ../../
:mrdocs:

Set the current stream position&period;

== Synopsis

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

[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
virtual
xref:bsl/basic_stringbuf/pos_type.adoc[basic&lowbar;stringbuf&lt;CHAR&lowbar;TYPE, CHAR&lowbar;TRAITS, ALLOCATOR&gt;::pos&lowbar;type]
seekpos(
    xref:bsl/basic_stringbuf/pos_type.adoc[pos&lowbar;type] absoluteOffset,
    std::ios&lowbar;base::openmode modeBitMask = ios&lowbar;base&colon;&colon;in &verbar; ios&lowbar;base&colon;&colon;out);
----

== Description

Set the current input position or the current output position (or both) to the specified `absoluteOffset` from the beginning of the stream&period; Optionally specify a `modeBitMask` indicating whether to set the current input position, current output position, or both&period; Return the offset of the new position on success, and `pos&lowbar;type(off&lowbar;type(&hyphen;1))` otherwise&period;

== Return Value

offset of the new position, or `pos&lowbar;type(off&lowbar;type(&hyphen;1))` on failure

== Parameters

[cols="1,4"]
|===
| Name| Description
| *absoluteOffset*
| absolute position from the beginning of the stream
| *modeBitMask*
| whether to adjust the input position, output position, or both
|===


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