名前空間
変種
操作

std::basic_istringstream::basic_istringstream

提供: cppreference.com

 
 
入力/出力ライブラリ
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_istringstream
メンバ関数
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_istringstream::basic_istringstream
basic_istringstream::operator=
basic_istringstream::swap
basic_istringstream::rdbuf
文字列操作
Original:
String operations
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.
basic_istringstream::str
 
basic_istringstream( ios_base::openmode mode = ios_base::in );
(1)
basic_istringstream( const std::basic_string<CharT,Traits,Allocator>& str,
                     ios_base::openmode mode = ios_base::in );
(2)
basic_istringstream( basic_istringstream&& other );
(3) (C++11およびそれ以降)
新しい文字列ストリームを構築し.
Original:
Constructs new string stream.
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.
1)
新たな基盤となる文字列のデバイスを構築します。基礎basic_stringbufオブジェクトはbasic_stringbuf<Char,Traits,Allocator>(mode | ios_base::in).として構成されている
Original:
Constructs new underlying string device. The underlying basic_stringbuf object is constructed as basic_stringbuf<Char,Traits,Allocator>(mode | ios_base::in).
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.
2)
基になる文字列デバイスの初期コンテンツとしてstrのコピーを使用します。基礎basic_stringbufオブジェクトはbasic_stringbuf<Char,Traits,Allocator>(str, mode | ios_base::in).として構成されている
Original:
Uses a copy of str as initial contents of the underlying string device. The underlying basic_stringbuf object is constructed as basic_stringbuf<Char,Traits,Allocator>(str, mode | ios_base::in).
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.
3)
コンストラクタを移動します。ムーブセマンティクスを使用してotherの状態とファイルストリームを構築します.
Original:
Move constructor. Constructs the file stream with the state of other using move semantics.
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.

[編集] パラメータ

str -
文字列ストリームの最初のコンテンツとして使用する文字列
Original:
string to use as initial contents of the string stream
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.
mode -
ストリームのオープンモードを指定します。それはビットマスク型ですが、以下の定数が定義されています:
定数
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
app
各書き込みの前にストリームの末尾にシーク
Original:
seek to the end of stream before each write
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.
binary
バイナリモードで開きます
Original:
open in binary mode
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.
in
読み込み用に開きます
Original:
open for reading
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.
out
書き込み用に開きます
Original:
open for writing
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.
trunc
開封ストリームの内容を破棄します
Original:
discard the contents of the stream when opening
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.
ate
すぐにオープンした後、ストリームの末尾にシーク
Original:
seek to the end of stream immediately after open
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.
Original:
specifies stream open mode. It is bitmask type, the following constants are defined:
定数
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
app
各書き込みの前にストリームの末尾にシーク
Original:
seek to the end of stream before each write
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.
binary
バイナリモードで開きます
Original:
open in binary mode
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.
in
読み込み用に開きます
Original:
open for reading
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.
out
書き込み用に開きます
Original:
open for writing
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.
trunc
開封ストリームの内容を破棄します
Original:
discard the contents of the stream when opening
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.
ate
すぐにオープンした後、ストリームの末尾にシーク
Original:
seek to the end of stream immediately after open
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.
other -
ソースとして使用する別の文字列ストリーム
Original:
another string stream to use as source
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.

[編集]

#include <iostream>
#include <sstream>
int main()
{
    // default constructor (input/output stream)
    std::stringstream buf1;
    buf1 << 7;
    int n = 0;
    buf1 >> n;
    std::cout << "buf1 = " << buf1.str() << " n = " << n << '\n';
 
    // input stream
    std::istringstream inbuf("-10");
    inbuf >> n;
    std::cout << "n = " << n << '\n';
 
    // output stream in append mode (C++11)
    std::ostringstream buf2("test", std::ios_base::ate);
    buf2 << '1';
    std::cout << buf2.str() << '\n';
}

Output:

buf1 = 7 n = 7
n = -10
test1

[編集] も参照してください

基になる文字列デバイスオブジェクトの内容を取得または設定します
Original:
gets or sets the contents of underlying string device object
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.

(パブリックメンバ関数) [edit]
basic_stringbufオブジェクトを作成します
Original:
constructs a basic_stringbuf object
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_stringbuf) [edit]