Reference
C Library
IOstream Library
Strings library
STL Containers
STL Algorithms
Miscellaneous
IOstream Library
manipulators
classes:
filebuf
fstream
ifstream
ios
iostream
ios_base
istream
istringstream
ofstream
ostream
ostringstream
streambuf
stringbuf
stringstream
objects:
cerr
cin
clog
cout
types:
fpos
streamoff
streampos
streamsize
stringbuf
stringbuf::stringbuf
public members:
stringbuf::str
virtual members:
stringbuf::overflow
stringbuf::pbackfail
stringbuf::seekoff
stringbuf::seekpos
stringbuf::setbuf
stringbuf::underflow


stringbuf::seekpos

virtual protected member function
streampos seekpos ( streampos sp, ios_base::openmode which = ios_base::in | ios_base::out );

Set internal position pointer to absolute position

Sets the absolute new position sp for the position pointers specified by parameter which.

Parameters

sp
New absolute position for the position pointer.
This is an object of class streampos (or traits::pos_type for other traits). streampos objects may be constructed indirectly from integral values representing a relative position from the beginning of the stream.
which
Determines which of the internal position pointers shall be modified: the input pointer, the output pointer, or both. It is an object of type ios_base::openmode that for this function may take any combination of the following significant constant values:
valueposition pointer affected
ios_base::ininput position pointer
ios_base::outoutput position pointer

Return Value

The new position value of the modified position pointer.
In case of error, the value returned is -1.

Basic template member declaration

( basic_stringbuf<charT,traits,Allocator> )
1
2
typedef traits::pos_type pos_type;
pos_type seekpos (pos_type sp, ios_base which = ios_base::in | ios_base::out );


See also