名前空間
変種
操作

std::basic_ostream::seekp

提供: cppreference.com
< cpp‎ | io‎ | basic ostream

 
 
入力/出力ライブラリ
I / Oのマニピュレータ
CスタイルのI / O
バッファ
Original:
Buffers
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.
basic_streambuf
basic_filebuf
basic_stringbuf
strstreambuf(廃止予定)
ストリーム
Original:
Streams
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.
抽象化
Original:
Abstractions
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.
ios_base
basic_ios
basic_istream
basic_ostream
basic_iostream
ファイルI / O
Original:
File I/O
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.
basic_ifstream
basic_ofstream
basic_fstream
文字列I / O
Original:
String I/O
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.
basic_istringstream
basic_ostringstream
basic_stringstream
アレイのI / O
Original:
Array I/O
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.
istrstream(廃止予定)
ostrstream(廃止予定)
strstream(廃止予定)
タイプ
Original:
Types
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.
streamoff
streamsize
fpos
エラーカテゴリインターフェース
Original:
Error category interface
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.
iostream_category(C++11)
io_errc(C++11)
 
std::basic_ostream
グローバルオブジェクト
Original:
Global objects
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.
メンバ関数
Original:
Member functions
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.
basic_ostream::basic_ostream
basic_ostream::~basic_ostream
basic_ostream::operator=(C++11)
書式付き入力
Original:
Formatted input
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.
basic_ostream::operator<<
書式なし入力
Original:
Unformatted input
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.
basic_ostream::put
basic_ostream::write
ポジショニング
Original:
Positioning
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.
basic_ostream::tellp
basic_ostream::seekp
その他
Original:
Miscellaneous
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.
basic_ostream::flush
basic_ostream::swap(C++11)
メンバークラス
Original:
Member classes
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.
basic_ostream::sentry
非メンバ関数
Original:
Non-member functions
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.
operator<<(std::basic_ostream)
 
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.
まず、エラーとフラッシュのtie() 'dは出力ストリームの流れをチェックしsentryオブジェクトを作成します。 (C++11およびそれ以降)その後、
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.
1)
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.
2)
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.

目次

[編集] パラメータ

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:
Constant
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.
Explanation
beg
ストリームの先頭
Original:
the beginning of a stream
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.
end
ストリームのエンディング
Original:
the ending of a stream
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.
cur
ストリームの位置インジケータの現在位置
Original:
the current position of stream 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:
defines base position to apply the relative offset to. It can be one of the following constants:
定数
Original:
Constant
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.
Explanation
beg
ストリームの先頭
Original:
the beginning of a stream
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.
end
ストリームのエンディング
Original:
the ending of a stream
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.
cur
ストリームの位置インジケータの現在位置
Original:
the current position of stream position indicator
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.
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をスローすることがあります.
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.
2)
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.

[編集]

#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.

(パブリックメンバ関数) [edit]
入力位置インジケータを返します
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) [edit]
sets the input position indicator
(パブリックメンバ関数of std::basic_istream) [edit]