std::basic_stringbuf<CharT,Traits,Allocator>::seekpos (3) - Linux Manuals
std::basic_stringbuf<CharT,Traits,Allocator>::seekpos: std::basic_stringbuf<CharT,Traits,Allocator>::seekpos
NAME
std::basic_stringbuf<CharT,Traits,Allocator>::seekpos - std::basic_stringbuf<CharT,Traits,Allocator>::seekpos
Synopsis
protected:
virtual pos_type seekpos(pos_type sp,
std::ios_base::openmode which = std::ios_base::in | std::ios_base::out );
Repositions std::basic_streambuf::gptr and/or std::basic_streambuf::pptr, if possible, to the position indicated by sp
Effectively executes seekoff(off_type(sp), std::ios_base::beg, which)
Parameters
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
sp    - stream position, such as one obtained by seekoff() or seekpos()
 
which - Constant Explanation
 
 Return value
sp on success or pos_type(off_type(-1)) on failure.
Notes
seekpos() is called by std::basic_streambuf::pubseekpos(), which is called by the single-argument versions of std::basic_istream::seekg() and std::basic_ostream::seekp()
Example
// Run this code
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 Output:
 
 
 See also
 
pubseekpos (public member function of std::basic_streambuf<CharT,Traits>)
seekoff    repositions the next pointer in the input sequence, output sequence, or both, using relative addressing
 
[virtual]
seekpos    repositions the file position, using absolute addressing
 
[virtual]
seekpos    repositions the next pointer in the input sequence, output sequence, or both using absolute addressing
 
[virtual]