std::basic_streambuf::seekoff
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  | 
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  | ||
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。
本文档系腾讯云开发者社区成员共同维护,如有问题请联系 cloudcommunity@tencent.com

