std::strstreambuf
来自cppreference.com
|
|
该页由英文版wiki使用Google Translate机器翻译而来。
该翻译可能存在错误或用词不当。鼠标停留在文本上可以看到原版本。你可以帮助我们修正错误或改进翻译。参见说明请点击这里. |
| 在头文件 <strstream> 中定义
|
||
| class strstreambuf : public std::basic_streambuf<char> |
(已弃用) | |
std::strstreambuf是一个std::basic_streambuf,其相应的字符序列是一个字符数组,这可能是常数(如:字符串文本),modifyable,但不是动态的(如堆栈分配的数组),或动态,在这种情况下,std::strstreambuf可能被允许重新分配将数组作为必要的,以适应输出(例如,通过调用delete[]和new[]或用户提供的功能).原文:
std::strstreambuf is a std::basic_streambuf whose associated character sequence is a character array, which may be constant (e.g. a string literal), modifyable but not dynamic (e.g. a stack-allocated array), or dynamic, in which case the std::strstreambuf may be allowed to reallocate the array as necessary to accomodate output (e.g. by calling delete[] and new[] or user-provided functions).std::strstreambuf一个典型的实现包含了四个私有数据成员原文:
Typical implementation of a
std::strstreambuf holds four private data members:缓冲器的状态,一个位掩码,它可以表示任意组合的四个值“分配”(析构函数将释放),(输出)“常数”,“动态”(输出可能会重新分配),或“冻结”(输出,释放重新分配是不允许的)
2) 原文:
buffer state, a bitmask type which can represent any combination of the four values "allocated" (destructor will deallocate), "constant" (output not allowed), "dynamic" (output may reallocate), or "frozen" (output, deallocation, reallocation are not allowed)
分配的缓冲区大小
3) 指针指向用户提供的配置功能
4) 原文:
pointer to user-provided allocation function
指针指向用户提供的释放函数.
原文:
pointer to user-provided deallocation function.
[编辑] 注释
str()任何调用,调用freeze(false)后,必须允许strstreambuf析构函数释放缓冲区时.原文:
After any call to
str(), a call to freeze(false) is required to allow the strstreambuf destructor to deallocate the buffer when necessary.[编辑] 成员函数
| |
| 构建了一个strstreambuf的对象 (公共成员函数) | |
| [虚]</div></div>
|
解构一个strstreambuf的对象,可以选择重新分配的字符数组 原文: destructs a strstreambuf object, optionally deallocating the character array (公有虚成员函数) |
| 设置/清除缓冲区的冷冻状态 原文: sets/clears the frozen state of the buffer (公共成员函数) | |
| 马克冻结的缓冲,并传回在输入序列中的开始指针 原文: marks the buffer frozen and returns the beginning pointer of the input sequence (公共成员函数) | |
| 返回下一个指针减去输出序列中的开始指针:写入的字符数 原文: returns the next pointer minus the beginning pointer in the output sequence: the number of characters written (公共成员函数) | |
| |
| [虚]</div></div>
|
没有推进的下一个指针来读取一个字符输入序列 原文: reads a character from the input sequence without advancing the next pointer (虚拟保护成员函数) |
| [虚]</div></div>
|
放回到输入序列中的一个字符 原文: puts back a character into the input sequence (虚拟保护成员函数) |
| [虚]</div></div>
|
添加一个字符的输出序列,可以重新分配或初始分配的缓冲区,如果动态的,而不是冻结 原文: appends a character to the output sequence, may reallocate or initially allocate the buffer if dynamic and not frozen (虚拟保护成员函数) |
| [虚]</div></div>
|
尝试以取代控制字符序列与一个数组 原文: attempts to replace the controlled character sequence with an array (虚拟保护成员函数) |
| [虚]</div></div>
|
重新定位在输入序列中的下一个指针,输出序列,或两者,使用相对寻址 原文: repositions the next pointer in the input sequence, output sequence, or both, using relative addressing (虚拟保护成员函数) |
| [虚]</div></div>
|
重新定位在输入序列中的下一个指针,输出序列,或两者都使用绝对寻址 原文: repositions the next pointer in the input sequence, output sequence, or both using absolute addressing (虚拟保护成员函数) |
Inherited from std::basic_streambuf
Member types
| 会员类型
|
Definition |
char_type
|
CharT |
traits_type
|
Traits |
int_type
|
Traits::int_type |
pos_type
|
Traits::pos_type |
off_type
|
Traits::off_type |
Member functions
| [虚]</div></div>
|
解构的basic_streambuf的对象 原文: destructs the basic_streambuf object ( std::basic_streambuf的公有虚成员函数)
|
| |
| 调用imbue() (公共成员函数of std::basic_streambuf)
| |
| 获得相关的区域设置的副本 原文: obtains a copy of the associated locale (公共成员函数of std::basic_streambuf)
| |
| |
| 调用setbuf() (公共成员函数of std::basic_streambuf)
| |
| 调用seekoff() (公共成员函数of std::basic_streambuf)
| |
| 调用seekpos() (公共成员函数of std::basic_streambuf)
| |
| 调用sync() (公共成员函数of std::basic_streambuf)
| |
| |
| 立即可用的字符在get区域获得的数目 原文: obtains the number of characters immediately available in the get area (公共成员函数of std::basic_streambuf)
| |
| ,然后输入序列读取一个字符,再没有前进 原文: advances the input sequence, then reads one character without advancing again (公共成员函数of std::basic_streambuf)
| |
| 读取一个字符的输入序列和垫款序列 原文: reads one character from the input sequence and advances the sequence (公共成员函数of std::basic_streambuf)
| |
| stossc (已弃用) |
输入序列,如果通过调用sbumpc()和丢弃的结果 原文: advances the input sequence as if by calling sbumpc() and discarding the result (公共成员函数) |
| 读取从输入序列中的一个字符,而不推进序列 原文: reads one character from the input sequence without advancing the sequence (公共成员函数of std::basic_streambuf)
| |
| 调用xsgetn() (公共成员函数of std::basic_streambuf)
| |
| |
| 写入一个字符,把区域和进步的下一个指针 原文: writes one character to the put area and advances the next pointer (公共成员函数of std::basic_streambuf)
| |
| 调用xsputn() (公共成员函数of std::basic_streambuf)
| |
| |
| 把输入序列中的一个字符 原文: puts one character back in the input sequence (公共成员函数of std::basic_streambuf)
| |
| 输入序列中的背面由一个移动的下一个指针 原文: moves the next pointer in the input sequence back by one (公共成员函数of std::basic_streambuf)
| |
Protected member functions
| 构建了一个basic_streambuf的对象 (受保护的成员函数) | |
| (C++11) |
替换一个basic_streambuf的对象 (受保护的成员函数) |
| (C++11) |
掉期2 basic_streambuf的对象 (受保护的成员函数) |
| |
| [虚]</div></div>
|
改变相关的语言环境 (虚拟保护成员函数of std::basic_streambuf)
|
| |
| [虚]</div></div>
|
取代缓冲区与用户定义的数组,如果允许的话 原文: replaces the buffer with user-defined array, if permitted (虚拟保护成员函数of std::basic_streambuf)
|
| [虚]</div></div>
|
重新定位在输入序列中的下一个指针,输出序列,或两者,使用相对寻址 原文: repositions the next pointer in the input sequence, output sequence, or both, using relative addressing (虚拟保护成员函数of std::basic_streambuf)
|
| [虚]</div></div>
|
重新定位在输入序列中的下一个指针,输出序列,或两者都使用绝对寻址 原文: repositions the next pointer in the input sequence, output sequence, or both using absolute addressing (虚拟保护成员函数of std::basic_streambuf)
|
| [虚]</div></div>
|
同步缓冲区关联的字符序列 原文: synchronizes the buffers with the associated character sequence (虚拟保护成员函数of std::basic_streambuf)
|
| |
| [虚]</div></div>
|
获得供在相关联的输入序列中输入的字符数,如果已知的话 原文: obtains the number of characters available for input in the associated input sequence, if known (虚拟保护成员函数of std::basic_streambuf)
|
| [虚]</div></div>
|
相关的输入序列读取字符的get区 原文: reads characters from the associated input sequence to the get area (虚拟保护成员函数of std::basic_streambuf)
|
| [虚]</div></div>
|
相关的输入序列读取字符的get区和进步的下一个指针 原文: reads characters from the associated input sequence to the get area and advances the next pointer (虚拟保护成员函数of std::basic_streambuf)
|
| [虚]</div></div>
|
读取从输入序列中的多个字符 原文: reads multiple characters from the input sequence (虚拟保护成员函数of std::basic_streambuf)
|
| 返回一个指针,开始的时候,当前的字符和结束的get区 原文: returns a pointer to the beginning, current character and the end of the get area (受保护的成员函数) | |
| 在输入序列中的下一个指针前进 原文: advances the next pointer in the input sequence (受保护的成员函数) | |
| 重新定位的开始,接着,和结束指针的输入序列中 原文: repositions the beginning, next, and end pointers of the input sequence (受保护的成员函数) | |
| |
| [虚]</div></div>
|
writes multiple characters to the output sequence (虚拟保护成员函数of std::basic_streambuf)
|
| [虚]</div></div>
|
相关的输出序列中写入字符认沽区域 原文: writes characters to the associated output sequence from the put area (虚拟保护成员函数of std::basic_streambuf)
|
| 开始的时候,当前的字符和结束的认沽返回一个指针 原文: returns a pointer to the beginning, current character and the end of the put area (受保护的成员函数) | |
| 进步的输出序列中的下一个指针 原文: advances the next pointer of the output sequence (受保护的成员函数) | |
| 重新定位的开始,接着,和结束指针的输出序列 原文: repositions the beginning, next, and end pointers of the output sequence (受保护的成员函数) | |
| |
| [虚]</div></div>
|
将一个字符返回到输入序列中,有可能修改的输入序列中 原文: puts a character back into the input sequence, possibly modifying the input sequence (虚拟保护成员函数of std::basic_streambuf)
|
</div>