std::basic_ostream::seekp
提供:cppreference.com
< cpp | io | basic ostream
|
|
This page has been machine-translated from the English version of the wiki using Google Translate.
The translation may contain errors and awkward wording. Hover over text to see the original version. You can help to fix errors and improve the translation. For instructions click here. |
| basic_ostream& seekp( pos_type pos ); |
(1) | |
| basic_ostream& seekp( off_type off, std::ios_base::seekdir dir); |
(2) | |
現在関連
streambufオブジェクトの出力位置インジケータを設定. Original:
Sets the output position indicator of the current associated
streambuf object. The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.
You can help to correct and verify the translation. Click here for instructions.
まず、エラーとフラッシュのtie() 'dは出力ストリームの流れをチェックしsentryオブジェクトを作成します。 (C + + 11以来)その後、
1) Original:
First, constructs a sentry object which checks the stream for errors and flushes the tie()'d output streams. (C + + 11以来) Afterwards,
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.
You can help to correct and verify the translation. Click here for instructions.
posを呼び出すことにより、絶対的な(ファイルの先頭からの相対)値rdbuf()->pubseekoff(pos, std::ios_base::out)に出力位置インジケータを設定します。コールが(pos_type)-1を返した場合、setstate(failbit)を実行.Original:
sets the output position indicator to absolute (relative to the beginning of the file) value
pos by calling rdbuf()->pubseekoff(pos, std::ios_base::out). If the call returns (pos_type)-1, executes setstate(failbit).The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.
You can help to correct and verify the translation. Click here for instructions.
offを呼び出すことによってdirrdbuf()->pubseekoff(off, dir, std::ios_base::out)に相対を相殺するための出力位置インジケータを設定します。エラーを報告しません.Original:
sets the output position indicator to offset
off relative to dir by calling rdbuf()->pubseekoff(off, dir, std::ios_base::out). Does not report errors.The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.
You can help to correct and verify the translation. Click here for instructions.
目次 |
[編集] パラメータ
| pos | - | への出力位置インジケータを設定するには、絶対位置.
Original: absolute position to set the output position indicator to. The text has been machine-translated via Google Translate. You can help to correct and verify the translation. Click here for instructions. | ||||||||||||||||||||||||||||||||
| off | - | への出力位置インジケータを設定するには、相対位置.
Original: relative position to set the output position indicator to. The text has been machine-translated via Google Translate. You can help to correct and verify the translation. Click here for instructions. | ||||||||||||||||||||||||||||||||
| dir | - | に相対的なオフセットを適用するためのベースの位置を定義します。それは、次の定数のいずれかを指定できます。
Original: defines base position to apply the relative offset to. It can be one of the following constants:
The text has been machine-translated via Google Translate. You can help to correct and verify the translation. Click here for instructions. | ||||||||||||||||||||||||||||||||
[編集] 値を返します
*this
[編集] 例外
1)std::ios_base::failure場合、障害が発生した場合にexceptions() & failbit != 0をスローすることがあります.
2) Original:
May throw std::ios_base::failure in case of failure, if exceptions() & failbit != 0.
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.
You can help to correct and verify the translation. Click here for instructions.
rdbuf()->pubseekoff()をスローしない限りスローされません
Original:
Does not throw unless rdbuf()->pubseekoff() throws
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.
You can help to correct and verify the translation. Click here for instructions.
[編集] 例
#include <sstream> #include <iostream> int main() { std::ostringstream os("hello, world"); os.seekp(7); os << 'W'; os.seekp(0, std::ios_base::end); os << '!'; os.seekp(0); os << 'H'; std::cout << os.str() << '\n'; }
Output:
Hello, World!
[編集] も参照してください
| 出力位置標識を戻します Original: returns the output position indicator The text has been machine-translated via Google Translate. You can help to correct and verify the translation. Click here for instructions. (パブリックメンバ関数) | |
| 入力位置インジケータを返します Original: returns the input position indicator The text has been machine-translated via Google Translate. You can help to correct and verify the translation. Click here for instructions. (パブリックメンバ関数of std::basic_istream)
| |
| sets the input position indicator (パブリックメンバ関数of std::basic_istream)
| |