std::basic_istringstream
来自cppreference.com
|
|
该页由英文版wiki使用Google Translate机器翻译而来。
该翻译可能存在错误或用词不当。鼠标停留在文本上可以看到原版本。你可以帮助我们修正错误或改进翻译。参见说明请点击这里. |
| 在头文件 <sstream> 中定义
|
||
| template< class CharT, |
(至 C++11) | |
| template< class CharT, |
(C++11 起) | |
类模板
basic_istringstream实现内存(std::basic_string)基于流的输入操作。它实质上是包装一个原始字符串的设备实施(basic_stringbuf)到更高级别接口(basic_istream)。独特的basic_stringbuf成员提供完整的接口.原文:
The class template
basic_istringstream implements input operations on memory (std::basic_string) based streams. It essentially wraps a raw string device implementation (basic_stringbuf) into a higher-level interface (basic_istream). The complete interface to unique basic_stringbuf members is provided.常见的字符类型也定义两个专业
原文:
Two specializations for common character types are also defined:
| 在头文件
<sstream> 中定义 | |
| 类型
|
Definition |
istringstream
|
basic_istringstream<char> |
wistringstream
|
basic_istringstream<wchar_t> |
[编辑] 会员类型
| 会员类型
|
Definition |
char_type
|
CharT |
traits_type
|
Traits |
int_type
|
Traits::int_type |
pos_type
|
Traits::pos_type |
off_type
|
Traits::off_type |
allocator_type
|
Allocator (C++11 起) |
[编辑] 成员函数
| 构造字符串流 (公共成员函数) | |
| (C++11) |
移动字符串流 (公共成员函数) |
| (C++11) |
swaps two string streams (公共成员函数) |
| 底层的原始字符串返回的设备对象 原文: returns the underlying raw string device object (公共成员函数) | |
| |
| 获取或设置字符串设备对象相关的内容 原文: gets or sets the contents of underlying string device object (公共成员函数) | |
Inherited from std::basic_istream
Member functions
| |
| 提取物格式的数据 (公共成员函数of std::basic_istream)
| |
| |
| 提取字符 (公共成员函数of std::basic_istream)
| |
| 读取下一个字符,而不提取 原文: reads the next character without extracting it (公共成员函数of std::basic_istream)
| |
| unextracts一个字符 (公共成员函数of std::basic_istream)
| |
| 字符到输入流 (公共成员函数of std::basic_istream)
| |
| 提取字符,直到给定的字符被发现 原文: extracts characters until the given character is found (公共成员函数of std::basic_istream)
| |
| 提取物和丢弃给定字符的字符,直到被发现 原文: extracts and discards characters until the given character is found (公共成员函数of std::basic_istream)
| |
| 提取的字符块 (公共成员函数of std::basic_istream)
| |
| 提取已经可用块的字符 原文: extracts already available blocks of characters (公共成员函数of std::basic_istream)
| |
| 通过上次未格式化输入操作提取的字符数返回 原文: returns number of characters extracted by last unformatted input operation (公共成员函数of std::basic_istream)
| |
| |
| 返回输入位置指示器 原文: returns the input position indicator (公共成员函数of std::basic_istream)
| |
| sets the input position indicator (公共成员函数of std::basic_istream)
| |
| |
| 与底层存储设备同步 原文: synchronizes with the underlying storage device (公共成员函数of std::basic_istream)
| |
Member classes
| implements basic logic for preparation of the stream for input operations (公共成员类of std::basic_istream)
| |
Inherited from std::basic_ios
Member types
| 会员类型
|
Definition |
char_type
|
CharT |
traits_type
|
Traits |
int_type
|
Traits::int_type |
pos_type
|
Traits::pos_type |
off_type
|
Traits::off_type |
| |
| 检查,如果没有错误发生,即I / O操作都可以 原文: checks if no error has occurred i.e. I/O operations are available (公共成员函数of std::basic_ios)
| |
| 如果最终文件的检查已经达到了 原文: checks if end-of-file has been reached (公共成员函数of std::basic_ios)
| |
| 如果已经发生可恢复的错误检查 原文: checks if a recoverable error has occurred (公共成员函数of std::basic_ios)
| |
| 检查,如果已经发生了不可恢复的错误 原文: checks if a non-recoverable error has occurred (公共成员函数of std::basic_ios)
| |
| (公共成员函数of std::basic_ios)
| |
| (至 C++11) (C++11 起) |
检查,如果没有发生错误(同义词!fail()) 原文: checks if no error has occurred (synonym of !fail()) (公共成员函数of std::basic_ios)
|
| 返回状态标志 (公共成员函数of std::basic_ios)
| |
| 设置状态标志 (公共成员函数of std::basic_ios)
| |
| 清除错误和EOF标志 (公共成员函数of std::basic_ios)
| |
| |
| 格式化信息的副本 (公共成员函数of std::basic_ios)
| |
| 管理的填充字符 (公共成员函数of std::basic_ios)
| |
| |
| manages exception mask (公共成员函数of std::basic_ios)
| |
| 设置语言环境 (公共成员函数of std::basic_ios)
| |
| 管理相关的流缓冲 (公共成员函数of std::basic_ios)
| |
| 管理绑流 (公共成员函数of std::basic_ios)
| |
| 缩小字符 (公共成员函数of std::basic_ios)
| |
| widens characters (公共成员函数of std::basic_ios)
| |
Inherited from std::ios_base
Member functions
| |
| 管理格式的标志 (公共成员函数of std::ios_base)
| |
| 设置特定格式的标志 (公共成员函数of std::ios_base)
| |
| clears specific format flag (公共成员函数of std::ios_base)
| |
| 管理小数精度浮点运算 原文: manages decimal precision of floating point operations (公共成员函数of std::ios_base)
| |
| manages field width (公共成员函数of std::ios_base)
| |
| |
| 设置场景 (公共成员函数of std::ios_base)
| |
| 返回当前的区域设置 (公共成员函数of std::ios_base)
| |
| |
| [静态的]</div></div>
|
返回一个程序范围内唯一的整数,它是安全使用指数PWORD()和iword() 原文: returns a program-wide unique integer that is safe to use as index to pword() and iword() (公共静态成员函数of std::ios_base)
|
| 调整大小的私人存储,如果必要的,访问long元素在给定的索引 原文: resizes the private storage if necessary and access to the long element at the given index (公共成员函数of std::ios_base)
| |
| 调整大小的私人存储,如果必要的,访问void*元素在给定的索引 原文: resizes the private storage if necessary and access to the void* element at the given index (公共成员函数of std::ios_base)
| |
| |
| registers event callback function (公共成员函数of std::ios_base)
| |
| [静态的]</div></div>
|
C + +和C IO库的设置是否是可互操作的 原文: sets whether C++ and C IO libraries are interoperable (公共静态成员函数of std::ios_base)
|
| |
| 流异常 (公共成员类of std::ios_base)
| |
| 标准流对象进行初始化 原文: initializes standard stream objects (公共成员类of std::ios_base)
| |
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 类型
|
Explanation | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 流开放的模式类型
有以下常量的定义:
原文: stream open mode type
The following constants are also defined:
(typedef) | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 格式化标志类型
有以下常量的定义:
原文: formatting flags type
The following constants are also defined:
(typedef) | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 流类型的状态
有以下常量的定义:
(typedef) | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| seeking direction type
The following constants are also defined:
(typedef) | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 指定事件类型 (枚举) | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 回调函数类型 (typedef) | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
</div>
