std::basic_ospanstream
來自 cppreference.com
定義於標頭檔案 <spanstream> |
||
template< class CharT, |
(C++23 起) | |
類模板 std::basic_ospanstream
實現在基於固定緩衝區的流上的輸出操作。
在底層,該類本質上是將 std::basic_spanbuf 的原始裝置實現包裝到 std::basic_ostream 的更高階介面中。提供了對 std::basic_spanbuf 獨有成員的完整介面。
繼承圖
提供了用於常見字元型別的幾個 typedef
定義於標頭檔案
<spanstream> | |
型別 | 定義 |
std::ospanstream
|
std::basic_ospanstream<char> |
std::wospanstream
|
std::basic_ospanstream<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 |
[編輯] 資料成員
成員物件 | 定義 |
sb (私有) |
封裝的 std::basic_spanbuf。 (僅用於闡釋的成員物件*) |
[編輯] 成員函式
構造 basic_ospanstream (公開成員函式) | |
(解構函式) [虛] |
銷燬 basic_ospanstream (虛公共成員函式) |
移動賦值 basic_ospanstream (公開成員函式) | |
交換兩個 basic_ospanstream 物件(公開成員函式) | |
獲取封裝的原始 span 裝置物件的地址(公開成員函式) | |
底層緩衝區操作 | |
獲取或設定封裝的 span 裝置物件的底層緩衝區(公開成員函式) |
[編輯] 非成員函式
特化 std::swap 演算法 (函式模板) |
繼承自 std::basic_ostream
成員函式
格式化輸出 | |
插入格式化資料 ( std::basic_ostream<CharT,Traits> 的公開成員函式) | |
非格式化輸出 | |
插入一個字元 ( std::basic_ostream<CharT,Traits> 的公開成員函式) | |
插入字元塊 ( std::basic_ostream<CharT,Traits> 的公開成員函式) | |
定位 | |
返回輸出位置指示器 ( std::basic_ostream<CharT,Traits> 的公開成員函式) | |
設定輸出位置指示器 ( std::basic_ostream<CharT,Traits> 的公開成員函式) | |
雜項 | |
與底層儲存裝置同步 ( std::basic_ostream<CharT,Traits> 的公開成員函式) |
成員類
實現流為輸出操作準備的基本邏輯 ( std::basic_ostream<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 操作可用 ( std::basic_ios<CharT,Traits> 的公開成員函式) | |
檢查是否已到達檔案末尾 ( std::basic_ios<CharT,Traits> 的公開成員函式) | |
檢查是否發生錯誤 ( std::basic_ios<CharT,Traits> 的公開成員函式) | |
檢查是否發生不可恢復的錯誤 ( std::basic_ios<CharT,Traits> 的公開成員函式) | |
檢查是否發生錯誤(fail() 的同義詞) ( std::basic_ios<CharT,Traits> 的公開成員函式) | |
檢查是否沒有發生錯誤(! fail() 的同義詞)( std::basic_ios<CharT,Traits> 的公開成員函式) | |
返回狀態標誌 ( std::basic_ios<CharT,Traits> 的公開成員函式) | |
設定狀態標誌 ( std::basic_ios<CharT,Traits> 的公開成員函式) | |
修改狀態標誌 ( std::basic_ios<CharT,Traits> 的公開成員函式) | |
格式化 | |
複製格式化資訊 ( std::basic_ios<CharT,Traits> 的公開成員函式) | |
管理填充字元 ( std::basic_ios<CharT,Traits> 的公開成員函式) | |
雜項 | |
管理異常掩碼 ( std::basic_ios<CharT,Traits> 的公開成員函式) | |
設定區域設定 ( std::basic_ios<CharT,Traits> 的公開成員函式) | |
管理關聯的流緩衝區 ( std::basic_ios<CharT,Traits> 的公開成員函式) | |
管理繫結的流 ( std::basic_ios<CharT,Traits> 的公開成員函式) | |
窄化字元 ( std::basic_ios<CharT,Traits> 的公開成員函式) | |
寬化字元 ( std::basic_ios<CharT,Traits> 的公開成員函式) |
繼承自 std::ios_base
成員函式
格式化 | |
管理格式標誌 ( std::ios_base 的公開成員函式) | |
設定特定格式標誌 ( std::ios_base 的公開成員函式) | |
清除特定格式標誌 ( std::ios_base 的公開成員函式) | |
管理浮點運算的十進位制精度 ( std::ios_base 的公開成員函式) | |
管理欄位寬度 ( std::ios_base 的公開成員函式) | |
區域設定 | |
設定區域設定 ( std::ios_base 的公開成員函式) | |
返回當前區域設定 ( std::ios_base 的公開成員函式) | |
內部可擴充套件陣列 | |
[靜態] |
返回一個程式範圍內的唯一整數,可安全用作 pword() 和 iword() 的索引 ( std::ios_base 的公開靜態成員函式) |
如有必要,調整私有儲存的大小,並訪問給定索引處的 long 元素 ( std::ios_base 的公開成員函式) | |
如有必要,調整私有儲存的大小,並訪問給定索引處的 void* 元素 ( std::ios_base 的公開成員函式) | |
雜項 | |
註冊事件回撥函式 ( std::ios_base 的公開成員函式) | |
[靜態] |
設定 C++ 和 C I/O 庫是否可互操作 ( std::ios_base 的公開靜態成員函式) |
成員類 | |
流異常 ( std::ios_base 的公開成員類) | |
初始化標準流物件 ( std::ios_base 的公開成員類) |
成員型別和常量 | |||||||||||||||||||||||||||||||||||||||
型別 | 解釋 | ||||||||||||||||||||||||||||||||||||||
流開啟模式型別 還定義了以下常量
(typedef) | |||||||||||||||||||||||||||||||||||||||
格式化標誌型別 還定義了以下常量
(typedef) | |||||||||||||||||||||||||||||||||||||||
流狀態型別 還定義了以下常量
(typedef) | |||||||||||||||||||||||||||||||||||||||
定位方向型別 還定義了以下常量
(typedef) | |||||||||||||||||||||||||||||||||||||||
指定事件型別 (enum) | |||||||||||||||||||||||||||||||||||||||
回撥函式型別 (typedef) |
[編輯] 注意
特性測試宏 | 值 | 標準 | 特性 |
---|---|---|---|
__cpp_lib_spanstream |
202106L |
(C++23) | std::spanbuf, std::spanstream |