在线文档教程
C++
输入/输出 | Input/output

std::basic_streambuf::pubseekoff

性病:基本[医]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
ConstantExplanation
begthe beginning of a stream
endthe ending of a stream
curthe 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
ConstantExplanation
inaffect the input sequence
outaffect the output sequence

并非所有参数组合都可能有效,请参阅seekoff关于细节。

返回值

1%29seekoff(off, dir, which)...

2%29由位置指示器定义的最终绝对位置。基类版本返回pos_type(off_type(-1))...

另见

pubseekposinvokes seekpos() (public member function)
seekoff virtualrepositions the file position, using relative addressing (virtual protected member function of std::basic_filebuf)
seekoff virtualrepositions the next pointer in the input sequence, output sequence, or both, using relative addressing (virtual protected member function of std::basic_stringbuf)
seekoff virtualrepositions 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。

http://en.cppreference.com/w/cpp/io/basic[医]流光/公共设施