std::basic_...:pubseekoff,(3)
π
std::basic_...:pubseekoff,(3)
okay so weβre in the C++ Standard Libary manual, bestie β yes, βLibary,β thatβs literally how itβs spelled up top β and this page is all about std::basic_streambuf::pubseekoff. Itβs giving βmove the stream position, but make it relative.β π₯
πΈ NAME
std::basic_streambuf::pubseekoff, β std::basic_streambuf::pubseekoff,
(yep, the trailing commas are literally part of the NAME line, no cap π)
β¨ Synopsis
(1) public:
pos_type pubseekoff( off_type off, std::ios_base::seekdir dir,
std::ios_base::openmode which = ios_base::in |
ios_base::out );
(2) protected:
virtual pos_type seekoff( off_type off, std::ios_base::seekdir dir,
std::ios_base::openmode which = ios_base::in |
ios_base::out );
So whatβs the vibe? It sets the position indicator of the input and/or output sequence relative to some other position. π―
- Calls
seekoff(off, dir, which)of the most derived class. - The base class version of this function has no effect. The derived classes may override this function to allow relative positioning of the position indicator.
π Parameters
offβ relative position to set the position indicator to.dirβ defines the base position to apply the relative offset to. It can be one of the following constants:begβ the beginning of a streamendβ the ending of a streamcurβ the current position of stream position indicator
whichβ defines which of the input and/or output sequences to affect. It can be one or a combination of the following constants:inβ affect the input sequenceoutβ affect the output sequence
π«Ά Note
Not all combinations of parameters may be valid, bestie β see the derived versions of seekoff for details. π
π Return value
- The return value of
seekoff(off, dir, which). - The resulting absolute position as defined by the position indicator. The base class version returns
pos_type(off_type(-1)).
π¦ Example
This section is incomplete. Reason: no example.
literally the placeholder is giving βtrust me broβ energy ππ«
π©Ή Defect reports
The following behavior-changing defect reports were applied retroactively to previously published C++ standards.
- DR:
LWG 55 - Applied to:
C++98 - Behavior as published: the base class version of
seekoffreturned an undefined invalid stream position - Correct behavior: returns
pos_type(off_type(-1))
π See also
pubseekposβ invokesseekpos()(public member function)seekoffβ repositions the file position, using relative addressing[virtual](virtual protected member function ofstd::basic_filebuf<CharT,Traits>)seekoffβ repositions the next pointer in the input sequence, output sequence, or both, using relative addressing[virtual](virtual protected member function ofstd::basic_stringbuf<CharT,Traits,Allocator>)seekoffβ repositions the next pointer in the input sequence, output sequence, or both, using relative addressing[virtual](virtual protected member function ofstd::strstreambuf)
π Category
- Todo no example
source: cppreference.com Β· version/date: 2024.06.10 Β· page tag: std::basic_...:pubseekoff,(3) β periodt, bestie πβ¨
π¦ where this page comes from
- nixpkgs unstable: stdman 2024.07.05
- opensuse-leap 16.0: stdman 2024.07.05-bp160.1.9 Β· MIT
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash-1017 on : a language model's rewrite of the original, under its terms