cplusplus
.com
教程
參考
文章
論壇
C++
教程
參考
文章
論壇
參考
C 庫
<cassert> (assert.h)
<cctype> (ctype.h)
<cerrno> (errno.h)
C++11
<cfenv> (fenv.h)
<cfloat> (float.h)
C++11
<cinttypes> (inttypes.h)
<ciso646> (iso646.h)
<climits> (limits.h)
<clocale> (locale.h)
<cmath> (math.h)
<csetjmp> (setjmp.h)
<csignal> (signal.h)
<cstdarg> (stdarg.h)
C++11
<cstdbool> (stdbool.h)
<cstddef> (stddef.h)
C++11
<cstdint> (stdint.h)
<cstdio> (stdio.h)
<cstdlib> (stdlib.h)
<cstring> (string.h)
C++11
<ctgmath> (tgmath.h)
<ctime> (time.h)
C++11
<cuchar> (uchar.h)
<cwchar> (wchar.h)
<cwctype> (wctype.h)
容器
C++11
<array>
<deque>
C++11
<forward_list>
<list>
<map>
<queue>
<set>
<stack>
C++11
<unordered_map>
C++11
<unordered_set>
<vector>
輸入/輸出
<fstream>
<iomanip>
<ios>
<iosfwd>
<iostream>
<istream>
<ostream>
<sstream>
<streambuf>
多執行緒
C++11
<atomic>
C++11
<condition_variable>
C++11
<future>
C++11
<mutex>
C++11
<thread>
其他
<algorithm>
<bitset>
C++11
<chrono>
C++11
<codecvt>
<complex>
<exception>
<functional>
C++11
<initializer_list>
<iterator>
<limits>
<locale>
<memory>
<new>
<numeric>
C++11
<random>
C++11
<ratio>
C++11
<regex>
<stdexcept>
<string>
C++11
<system_error>
C++11
<tuple>
C++11
<type_traits>
C++11
<typeindex>
<typeinfo>
<utility>
<valarray>
<sstream>
類模板
basic_istringstream
basic_ostringstream
basic_stringbuf
basic_stringstream
類
istringstream
ostringstream
stringbuf
stringstream
wistringstream
wostringstream
wstringbuf
wstringstream
stringbuf
stringbuf::stringbuf
公有成員
stringbuf::str
虛擬成員
stringbuf::overflow
stringbuf::pbackfail
stringbuf::seekoff
stringbuf::seekpos
stringbuf::setbuf
stringbuf::underflow
參考
<sstream>
stringbuf
類
<sstream>
std
::stringbuf
typedef basic_stringbuf<char> stringbuf;
字串流緩衝區
streambuf
stringbuf
用於從
string
物件讀取和寫入的流緩衝區。
此類物件在其內部維護一個字元序列,它們將此序列用作其
關聯輸入序列
和/或
關聯輸出序列
。內部序列可以從
string
物件初始化,或複製到
string
物件中,方法是使用成員函式
str
。
透過此類重寫的、從
streambuf
繼承而來的虛成員提供的介面,流可以訪問內部字元序列。
成員型別
該類聲明瞭以下成員型別
成員型別
定義
char_type
char
traits_type
char_traits
<char>
allocator_type
allocator
<char>
int_type
int
pos_type
streampos
off_type
streamoff
公開成員函式
(建構函式)
構造一個字串流緩衝區物件(
公共成員函式
)
str
獲取/設定字串內容(
公共成員函式
)
從
streambuf
繼承的公共成員函式
區域設定
:
pubimbue
注入 locale
(公開成員函式)
getloc
獲取當前 locale
(公開成員函式)
緩衝區管理和定位
:
pubsetbuf
設定緩衝區陣列
(公有成員函式)
pubseekoff
將內部位置指標設定為相對位置
(公有成員函式)
pubseekpos
將內部位置指標設定為絕對位置
(公有成員函式)
pubsync
同步流緩衝區
(公有成員函式)
輸入函式 (get)
:
in_avail
獲取可供讀取的字元數
(公有成員函式)
snextc
前進到下一個位置並獲取字元
(公有成員函式)
sbumpc
獲取當前字元並前進到下一個位置
(公有成員函式)
sgetc
獲取當前字元
(公有成員函式)
sgetn
獲取字元序列
(公有成員函式)
sputbackc
放回字元
(公共成員函式)
sungetc
後退當前位置
(公有成員函式)
輸出函式 (put)
:
sputc
在當前放置位置儲存字元並增加放置指標
(公有成員函式)
sputn
放置字元序列
(公有成員函式)
受保護的虛擬函式重寫
setbuf
設定緩衝區
(保護虛成員函式)
seekoff
將位置指標設定到相對位置
(受保護的虛成員函式)
seekpos
將位置指標設定為絕對位置
(受保護的虛成員函式)
underflow
獲取字元(受保護的虛成員函式)
pbackfail
放回字元
(受保護的虛成員函式)
overflow
寫入字元(
受保護的虛成員函式
)
該類還繼承了其他非虛的或未被重寫的受保護成員。有關更多詳細資訊,請參閱基類
streambuf
。