std::basic_istringstream
來自 cppreference.com
定義於標頭檔案 <sstream> |
||
template< class CharT, |
||
類模板 std::basic_istringstream
對基於字串的流實現輸入操作。它有效地儲存 std::basic_string 的例項並對其執行輸入操作。
在底層,該類實際上將 std::basic_stringbuf 的原始字串裝置實現封裝到 std::basic_istream 的高階介面中。提供了 std::basic_stringbuf 唯一成員的完整介面。
繼承圖
提供了用於常見字元型別的幾個 typedef
定義於標頭檔案
<sstream> | |
型別 | 定義 |
std::istringstream
|
std::basic_istringstream<char> |
std::wistringstream
|
std::basic_istringstream<wchar_t> |
目錄 |
[編輯] 成員型別
成員型別 | 定義 |
char_type
|
CharT |
traits_type
|
Traits ;若 Traits::char_type 非 CharT 則程式非良構。 |
int_type
|
Traits::int_type |
pos_type
|
Traits::pos_type |
off_type
|
Traits::off_type |
allocator_type
|
Allocator |
[編輯] 僅供說明的成員
名稱 | 定義 |
sb |
用作底層緩衝區的 std::basic_stringbuf<CharT, Traits, Allocator> (僅用於闡釋的成員物件*) |
[編輯] 成員函式
構造字串流 (public member function) | |
(C++11) |
移動字串流 (public member function) |
(C++11) |
交換兩個字串流 (public member function) |
返回底層原始字串裝置物件 (public member function) | |
字串操作 | |
獲取或設定底層字串裝置物件的內容 (public member function) | |
(C++20) |
獲取底層字串裝置物件內容的檢視 (public member function) |
[編輯] 非成員函式
特化 std::swap 演算法 (function template) |
繼承自 std::basic_istream
成員函式
格式化輸入 | |
提取格式化資料 (public member function of std::basic_istream<CharT,Traits> ) | |
非格式化輸入 | |
提取字元 (public member function of std::basic_istream<CharT,Traits> ) | |
讀取下一個字元而不提取它 (public member function of std::basic_istream<CharT,Traits> ) | |
取消提取字元 (public member function of std::basic_istream<CharT,Traits> ) | |
將字元放入輸入流 (public member function of std::basic_istream<CharT,Traits> ) | |
提取字元直到找到給定字元 (public member function of std::basic_istream<CharT,Traits> ) | |
提取並丟棄字元直到找到給定字元 (public member function of std::basic_istream<CharT,Traits> ) | |
提取字元塊 (public member function of std::basic_istream<CharT,Traits> ) | |
提取已有的字元塊 (public member function of std::basic_istream<CharT,Traits> ) | |
返回上次未格式化輸入操作提取的字元數 (public member function of std::basic_istream<CharT,Traits> ) | |
定位 | |
返回輸入位置指示符 (public member function of std::basic_istream<CharT,Traits> ) | |
設定輸入位置指示符 (public member function of std::basic_istream<CharT,Traits> ) | |
雜項 | |
與底層儲存裝置同步 (public member function of std::basic_istream<CharT,Traits> ) |
成員類
為輸入操作準備流實現基本邏輯 (public member class of std::basic_istream<CharT,Traits> ) |
繼承自 std::basic_ios
成員型別
成員型別 | 定義 |
char_type
|
CharT
|
traits_type
|
特性
|
int_type
|
Traits::int_type
|
pos_type
|
Traits::pos_type
|
off_type
|
Traits::off_type
|
成員函式
狀態函式 | |
檢查是否沒有發生錯誤,即 I/O 操作可用 (public member function of std::basic_ios<CharT,Traits> ) | |
檢查是否已到達檔案末尾 (public member function of std::basic_ios<CharT,Traits> ) | |
檢查是否發生錯誤 (public member function of std::basic_ios<CharT,Traits> ) | |
檢查是否發生不可恢復的錯誤 (public member function of std::basic_ios<CharT,Traits> ) | |
檢查是否發生錯誤(fail() 的同義詞) (public member function of std::basic_ios<CharT,Traits> ) | |
檢查是否沒有發生錯誤(! fail() 的同義詞)(public member function of std::basic_ios<CharT,Traits> ) | |
返回狀態標誌 (public member function of std::basic_ios<CharT,Traits> ) | |
設定狀態標誌 (public member function of std::basic_ios<CharT,Traits> ) | |
修改狀態標誌 (public member function of std::basic_ios<CharT,Traits> ) | |
格式化 | |
複製格式化資訊 (public member function of std::basic_ios<CharT,Traits> ) | |
管理填充字元 (public member function of std::basic_ios<CharT,Traits> ) | |
雜項 | |
管理異常掩碼 (public member function of std::basic_ios<CharT,Traits> ) | |
設定區域設定 (public member function of std::basic_ios<CharT,Traits> ) | |
管理關聯的流緩衝區 (public member function of std::basic_ios<CharT,Traits> ) | |
管理繫結的流 (public member function of std::basic_ios<CharT,Traits> ) | |
窄化字元 (public member function of std::basic_ios<CharT,Traits> ) | |
寬化字元 (public member function of std::basic_ios<CharT,Traits> ) |
繼承自 std::ios_base
成員函式
格式化 | |
管理格式標誌 (public member function of std::ios_base ) | |
設定特定格式標誌 (public member function of std::ios_base ) | |
清除特定格式標誌 (public member function of std::ios_base ) | |
管理浮點運算的十進位制精度 (public member function of std::ios_base ) | |
管理欄位寬度 (public member function of std::ios_base ) | |
區域設定 | |
設定區域設定 (public member function of std::ios_base ) | |
返回當前區域設定 (public member function of std::ios_base ) | |
內部可擴充套件陣列 | |
[靜態] |
返回一個程式範圍內的唯一整數,可安全用作 pword() 和 iword() 的索引 (public static member function of std::ios_base ) |
如有必要,調整私有儲存的大小,並訪問給定索引處的 long 元素 (public member function of std::ios_base ) | |
如有必要,調整私有儲存的大小,並訪問給定索引處的 void* 元素 (public member function of std::ios_base ) | |
雜項 | |
註冊事件回撥函式 (public member function of std::ios_base ) | |
[靜態] |
設定 C++ 和 C I/O 庫是否可互操作 (public static member function of std::ios_base ) |
成員類 | |
流異常 (public member class of std::ios_base ) | |
初始化標準流物件 (public member class of std::ios_base ) |
成員型別和常量 | |||||||||||||||||||||||||||||||||||||||
型別 | 解釋 | ||||||||||||||||||||||||||||||||||||||
流開啟模式型別 還定義了以下常量
(typedef) | |||||||||||||||||||||||||||||||||||||||
格式化標誌型別 還定義了以下常量
(typedef) | |||||||||||||||||||||||||||||||||||||||
流狀態型別 還定義了以下常量
(typedef) | |||||||||||||||||||||||||||||||||||||||
定位方向型別 還定義了以下常量
(typedef) | |||||||||||||||||||||||||||||||||||||||
指定事件型別 (enum) | |||||||||||||||||||||||||||||||||||||||
回撥函式型別 (typedef) |