共用方式為


<sstream>

定義支援在配置陣列物件儲存的 iostreams 作業的範本類別。 這類序列加入至樣板類別可自動轉換為 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> 盡量。

Typedef

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

操作工具

交換

若要在兩個 sstream 物件之間的值。

類別

basic_stringbuf

往返於陣列物件中的元素順序描述控制項型別 Elem的項目傳輸,性格特性類別取決於 Tr資料流緩衝區。

basic_istringstream

描述物件項目的控制項擷取並輸入從類別 basic_stringbuf<ElemTrAlloc>資料流緩衝區的物件,其中含有型別 Elem的元素,類別取決於性格特性 Tr,因此,項目會依類別配置 Alloc配置器。

basic_ostringstream

描述物件項目的控制項插入並輸入物件的類別 basic_stringbuf<ElemTrAlloc>資料流緩衝區,以型別 Elem的元素,類別取決於性格特性 Tr,因此,項目會依類別配置 Alloc配置器。

basic_stringstream

描述物件控制項目的插入和擷取並輸入物件使用 basic_stringbuf<類別,ElemTrAlloc>資料流緩衝區,以型別 Elem的元素,類別取決於性格特性 Tr,因此,項目會依類別配置 Alloc配置器。

需求

  • 標題: <sstream>

  • 命名空間: std

請參閱

參考

C++ 標準程式庫中的執行緒安全

iostream 程式設計

iostreams 慣例

其他資源

C++ 標準程式庫標頭檔