Movatterモバイル変換


[0]ホーム

URL:


cppreference.com
Namespaces
Variants
    Actions

      std::basic_streambuf<CharT,Traits>::pubsync,std::basic_streambuf<CharT,Traits>::sync

      From cppreference.com
      <cpp‎ |io‎ |basic streambuf
       
       
       
      std::basic_streambuf
       
      int pubsync();
      (1)
      protected:
      virtualint sync();
      (2)

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

      1) Callssync() 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, instd::basic_stringbuf), is to do nothing.

      Contents

      [edit]Parameters

      (none)

      [edit]Return value

      1) The return value ofsync().

      2) Returns0 on success,-1 otherwise. The base class version returns0.

      [edit]Example

      This section is incomplete
      Reason: no example

      [edit]See also

      synchronizes with the underlying storage device
      (public member function ofstd::basic_istream<CharT,Traits>)[edit]
      [virtual]
      writes characters to the associated file from the put area
      (virtual protected member function ofstd::basic_filebuf<CharT,Traits>)[edit]
      Retrieved from "https://en.cppreference.com/mwiki/index.php?title=cpp/io/basic_streambuf/pubsync&oldid=57711"

      [8]ページ先頭

      ©2009-2025 Movatter.jp