std::basic_...buf::seekoff(3)
π std::basic_spanbuf::seekoff π
okay so this is the C++ Standard Libary manual, section 3, and the whole page is about std::basic_spanbuf::seekoff. bestie, itβs giving protected member function realness, and weβre about to get into pointer-repositioning. periodt. β¨
β¨ NAME β¨
std::basic_spanbuf::seekoff β std::basic_spanbuf::seekoff
π Synopsis π
protected:
pos_type seekoff( off_type off, std::ios_base::seekdir dir,
std::ios_base::openmode which =
(since C++23)
std::ios_base::in | std::ios_base::out )
override;
okay so what does it even do? It repositions the next pointer to get and/or put area, if possible, to the position that corresponds to exactly off characters from beginning, end, or current position of the get and/or put area of the buffer. π
Let n be the number of CharT elements in underlying buffer, or 0 when there is no underlying buffer, this function fails if:
- the next pointer to the get and/or put area to reposition is null and the computed
newoff(see below) is not zero, which may occur if there is no underlying buffer, or the*thisis not opened in the mode required bywhich, or dirisstd::ios_base::curand bothstd::ios_base::inandstd::ios_base::outare set inwhich, or- the computed
newoffis not representable inoff_type, less than zero, or greater thann.
newoff is computed as below:
- If
dirisstd::ios_base::beg,newoffisoff. - If
dirisstd::ios_base::cur,newoffis:pptr() - pbase() + offifstd::ios_base::outis set inwhich, orgptr() - eback() + offifstd::ios_base::inis set inwhich.
- If
dirisstd::ios_base::end,newoffis:pptr() - pbase() + offifstd::ios_base::outbut notstd::ios_base::inis set in the open mode of*this,- otherwise,
off + n.
This function repositions the next pointer to get and/or put area to pbuf + newoff on success if std::ios_base::in and/or std::ios_base::out is correspondingly set in which, where pbuf is the pointer to the beginning of the underlying buffer, or the null pointer value if there is no underlying buffer.
π Parameters π
offβ relative position to set the next pointer(s) to.dirβ defines 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 whether the input sequences, the output sequence, or both are affected. It can be one or a combination of the following constants:inβ affect the input sequenceoutβ affect the output sequence
π Return value π
pos_type(newoff) on success, pos_type(off_type(-1)) on failure.
πΈ Example πΈ
This section is incomplete.
Reason: no example.
bestie, the example section really said βnot todayβ π no example means no example, and we respect the iconique incompleteness.
π¦ See also π¦
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: http://cppreference.com Β· version/date: 2024.06.10 Β· page: std::basic_...buf::seekoff(3) β slay and goodbye, 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