std::basic_streambuf::pubsync, std::basic_streambuf::sync

来自cppreference.com
< cpp‎ | io‎ | basic streambuf

 
 
 
 
int pubsync();
(1)
protected:
virtual int sync();
(2)

Synchronizes the controlled character sequence (the buffers) with the associated character sequence.

1)
调用sync()最派生类
原文:
Calls sync() of the most derived class
文本通过谷歌翻译机器翻译。
你可以帮忙校正和验证翻译。点击此处查看指示。

2) The base class version of this function has no effect. The derived classes may override this function to allow synchronizing the underlying device with the buffers.

For output streams, this typically results in writing the contents of the put area into the associated sequence, i.e. flushing of the output buffer. For input streams, this typically empties the get area and forces a re-read from the associated sequence to pick up recent changes. The default behavior (found, for example, in std::basic_stringbuf), is to do nothing.

目录

[编辑] 参数

(无)
原文:
(none)
文本通过谷歌翻译机器翻译。
你可以帮忙校正和验证翻译。点击此处查看指示。

[编辑] 返回值

1) The return value of sync().

2) Returns 0 on success, -1 otherwise. The base class version returns 0.

[编辑] 示例

[编辑] 另请参阅

与底层存储设备同步
(std::basic_istream 的公开成员函数) [编辑]
[虚]
从放置区写字符到关联文件
(std::basic_filebuf 的虚受保护成员函数) [编辑]