std::basic_streambuf::seekoff
性病:基本[医]Streambuf::pubsekoff,std::basic[医]流光::寻找
pos_type pubseekoff( off_type off, std::ios_base::seekdir dir, std::ios_base::openmode which = ios_base::in | ios_base::out | (1) | |
---|---|---|
protected: virtual pos_type seekoff( off_type off, std::ios_base::seekdir dir, std::ios_base::openmode which = ios_base::in | ios_base::out | (2) | |
设置相对于其他位置的输入和/或输出序列的位置指示符。
1%29次电话seekoff(off, dir, which)
最派生的类。
2%29此函数的基类版本没有任何影响。派生类可以重写此函数以允许位置指示器的相对定位。
参数
off | - | relative position to set the position indicator to. |
---|---|---|
dir | - | defines base position to apply the relative offset to. It can be one of the following constants: Constant Explanation beg the beginning of a stream end the ending of a stream cur the current position of stream position indicator |
Constant | Explanation | |
beg | the beginning of a stream | |
end | the ending of a stream | |
cur | 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: Constant Explanation in affect the input sequence out affect the output sequence |
Constant | Explanation | |
in | affect the input sequence | |
out | affect the output sequence |
注
并非所有参数组合都可能有效,请参阅seekoff
关于细节。
返回值
1%29seekoff(off, dir, which)
...
2%29由位置指示器定义的最终绝对位置。基类版本返回pos_type(off_type(-1))
...
例
另见
pubseekpos | invokes seekpos() (public member function) |
---|---|
seekoff virtual | repositions the file position, using relative addressing (virtual protected member function of std::basic_filebuf) |
seekoff virtual | repositions the next pointer in the input sequence, output sequence, or both, using relative addressing (virtual protected member function of std::basic_stringbuf) |
seekoff virtual | repositions the next pointer in the input sequence, output sequence, or both, using relative addressing (virtual protected member function of std::strstreambuf) |
© cppreference.com
在CreativeCommonsAttribution下授权-ShareAlike未移植许可v3.0。