次の方法で共有


<sstream>

割り当てられた配列オブジェクトに格納されているシーケンスの操作だけをサポートする複数のテンプレート クラスを定義します。このようなシーケンスは、テンプレート クラス basic_stringのオブジェクトとして簡単に変換されます。

namespace std {
template<class CharType,
    class Traits = char_traits<CharType>,
    class Allocator = allocator<CharType> >
    class basic_stringbuf;
typedef basic_stringbuf<char> stringbuf;
typedef basic_stringbuf<wchar_t> wstringbuf;

template<class CharType,
    class Traits = char_traits<CharType>,
    class Allocator = allocator<CharType> >
    class basic_istringstream;
typedef basic_istringstream<char> istringstream;
typedef basic_istringstream<wchar_t> wistringstream;

template<class CharType,
    class Traits = char_traits<CharType>,
    class Allocator = allocator<CharType> >
    class basic_ostringstream;
typedef basic_ostringstream<char> ostringstream;
typedef basic_ostringstream<wchar_t> wostringstream;

template<class CharType,
    class Traits = char_traits<CharType>,
    class Allocator = allocator<CharType> >
    class basic_stringstream;
typedef basic_stringstream<char> stringstream;
typedef basic_stringstream<wchar_t> wstringstream;

        // TEMPLATE FUNCTIONS
template<class CharType, class Traits, class Allocator>
    void swap(
        basic_stringbuf<CharType, Traits, Allocator>& _Left,
        basic_stringbuf<CharType, Traits, Allocator>& _Right
    ); 
template<class CharType, class Traits, class Allocator>
    void swap(
        basic_istringstream<CharType, Traits, Allocator>& _Left,
        basic_istringstream<CharType, Traits, Allocator>& _Right
    );
template<class CharType, class Traits, class Allocator>
    void swap(
        basic_ostringstream<CharType, Traits, Allocator>& _Left,
        basic_ostringstream<CharType, Traits, Allocator>& _Right
    );
template<class CharType, class Traits, class Allocator>
    void swap (
        basic_stringstream<CharType, Traits, Allocator>& _Left,
        basic_stringstream<CharType, Traits, Allocator>& _Right
    );
}  // namespace std

パラメーター

パラメーター

説明

_Left

sstream のオブジェクトへの参照。

_Right

sstream のオブジェクトへの参照。

解説

型のオブジェクト char *、オーバーフローに対して <strstream> の機能を使用できます。ただし、<strstream> は推奨されておらず、<sstream> の使用は推奨します。

kb1es779.collapse_all(ja-jp,VS.110).gifTypedef

istringstream

char のテンプレート パラメーターに特化された型 basic_istringstream を作成します。

ostringstream

char のテンプレート パラメーターに特化された型 basic_ostringstream を作成します。

stringbuf

char のテンプレート パラメーターに特化された型 basic_stringbuf を作成します。

stringstream

char のテンプレート パラメーターに特化された型 basic_stringstream を作成します。

wistringstream

wchar_t のテンプレート パラメーターに特化された型 basic_istringstream を作成します。

wostringstream

wchar_t のテンプレート パラメーターに特化された型 basic_ostringstream を作成します。

wstringbuf

wchar_t のテンプレート パラメーターに特化された型 basic_stringbuf を作成します。

wstringstream

wchar_t のテンプレート パラメーターに特化された型 basic_stringstream を作成します。

kb1es779.collapse_all(ja-jp,VS.110).gifマニピュレーター

swap

2 sstream の二つのオブジェクトの値を交換します。

kb1es779.collapse_all(ja-jp,VS.110).gifClasses

basic_stringbuf

文字クラスのプロパティを Trによって決定される、型 Elemの要素の伝送を制御する配列オブジェクトに格納されている要素のシーケンスに対してストリームのバッファーを記述します。

basic_istringstream

オブジェクトを使用してクラス basic_stringbuf<ElemTr特性が、文字クラス Trによって決定され、要素が Allocのアロケーター クラスによって割り当てられた型 Elemの要素で Alloc> ストリームのバッファーからの要素とエンコードされたオブジェクトのコントロールの抽出、ついて説明します。

basic_ostringstream

クラス basic_stringbuf<ElemTr特性が、文字クラス Trによって決定され、要素が Allocのアロケーター クラスによって割り当てられた型 Elemの要素で Alloc> ストリームのバッファーするオブジェクトを要素とエンコードされたオブジェクトのコントロールの挿入、ついて説明します。

basic_stringstream

クラス basic_stringbuf<ElemTr特性が、文字クラス Trによって決定され、要素が Allocのアロケーター クラスによって割り当てられた型 Elemの要素で Alloc> ストリームのバッファーを使用してオブジェクトを、要素およびエンコードされたオブジェクトのコントロールの挿入および抽出、ついて説明します。

必要条件

  • ヘッダー: <sstream>

  • 名前空間: std

参照

関連項目

C++ の標準ライブラリのスレッド セーフ

入出力ストリームのプログラミング

入出力ストリームの規則

その他の技術情報

ヘッダー ファイル