Namespaces
Variants
Views
Actions

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

From cppreference.com
< cpp‎ | io‎ | basic streambuf
Revision as of 19:07, 2 November 2012 by P12bot (Talk | contribs)

 
 
 
 

Template:ddcl list begin <tr class="t-dcl ">

<td >
int pubsync();
</td>

<td > (1) </td> <td class="t-dcl-nopad"> </td> </tr> <tr class="t-dcl ">

<td >
protected:
virtual int sync();
</td>

<td > (2) </td> <td class="t-dcl-nopad"> </td> </tr> Template:ddcl list end

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

1) 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.

Contents

Parameters

(none)

Return value

1) The return value of sync().

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

Example

See also

Template:cpp/io/basic istream/dcl list syncTemplate:cpp/io/basic filebuf/dcl list sync