Files
hustoj/web/cppreference-zh/chmhelp/cpp-io-basic_syncbuf-sync.html
2025-08-01 12:57:54 +08:00

77 lines
4.9 KiB
HTML

<!DOCTYPE html>
<html lang="zh" dir="ltr" class="client-nojs" xmlns="http://www.w3.org/1999/xhtml" xml:lang="zh">
<head><meta http-equiv="x-ua-compatible" content="ie=edge">
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>std::basic_syncbuf&lt;CharT,Traits,Allocator&gt;::sync</title>
<link rel="stylesheet" href="ext.css" />
<link rel="stylesheet" href="site_modules.css" />
</head>
<body class="mediawiki ltr sitedir-ltr ns-0 ns-subject page-cpp_io_basic_syncbuf_sync skin-cppreference2 action-view cpp-navbar">
<div id="cpp-content-base">
<div id="content"><a id="top"></a>
<h1 id="firstHeading" class="firstHeading"><span style="font-size:0.7em; line-height:130%">std::basic_syncbuf&lt;CharT,Traits,Allocator&gt;::</span>sync</h1>
<div id="bodyContent">
<div id="contentSub"><span class="subpages">&lt; <a href="cpp.html">cpp</a>&lrm; | <a href="cpp-io.html">io</a>&lrm; | <a href="cpp-io-basic_syncbuf.html">basic syncbuf</a></span></div>
<div id="mw-content-text" lang="zh" dir="ltr" class="mw-content-ltr" xml:lang="zh">
<table class="t-dcl-begin">
<tbody>
<tr class="t-dcl">
<td class="t-dcl-nopad">
<div><span class="mw-geshi cpp source-cpp"><span class="kw1">protected</span><span class="sy4">:</span><br />
<span class="kw4">int</span> sync<span class="br0">(</span><span class="br0">)</span> override<span class="sy4">;</span></span></div>
</td>
<td class="t-dcl-nopad"></td>
<td class="t-dcl-nopad"></td>
</tr>
<tr class="t-dcl-sep">
<td></td>
<td></td>
<td></td>
</tr>
</tbody>
</table>
<p>&#39318;&#20808;&#65292;&#20197;&#26356;&#26032;&#36866;&#24403;&#30340;&#31169;&#26377;&#26631;&#24535;&#65292;&#35760;&#24405;&#20914;&#20837;&#20026;&#26410;&#20915;&#12290;</p>
<p>&#28982;&#21518;&#65292;&#33509;&#24403;&#21069;&#30340;&#21516;&#27493;&#26102;&#21457;&#23556;&#65288; emit-on-sync &#65289;&#31574;&#30053;&#20026; <span class="t-c"><span class="mw-geshi cpp source-cpp"><span class="kw2">true</span></span></span> &#65292;&#21017;&#35843;&#29992; <a href="cpp-io-basic_syncbuf-emit.html"><tt>emit()</tt></a> &#12290;</p>
<p>&#21542;&#21017;&#65292;&#65288;&#33509;&#21516;&#27493;&#26102;&#21457;&#23556;&#31574;&#30053;&#20026;&#40664;&#35748;&#30340; <span class="t-c"><span class="mw-geshi cpp source-cpp"><span class="kw2">false</span></span></span> &#65289;&#65292;&#21017;&#24748;&#25346;&#20914;&#20837;&#65292;&#30452;&#33267;&#35843;&#29992; <a href="cpp-io-basic_syncbuf-emit.html"><tt>emit()</tt></a> &#65292;&#20363;&#22914;&#36890;&#36807; <a href="cpp-io-basic_osyncstream-emit.html"><tt>std::basic_osyncstream::emit()</tt></a> &#25110; <a href="cpp-io-basic_osyncstream-~basic_osyncstream.html"><tt>std::basic_osyncstream::~basic_osyncstream</tt></a> &#12290;</p>
<h3><span class="mw-headline" id=".E5.8F.82.E6.95.B0">&#21442;&#25968;</span></h3>
<p>&#65288;&#26080;&#65289;</p>
<h3><span class="mw-headline" id=".E6.B3.A8.E6.84.8F">&#27880;&#24847;</span></h3>
<p><code>sync()</code> &#25110;&#20854;&#31561;&#20215;&#29256;&#26412;&#20026; <span class="t-lc">close()</span> &#12289; <span class="t-lc">seekoff()</span> &#21644; <span class="t-lc">seekpos()</span> &#25152;&#38544;&#24335;&#35843;&#29992;&#65292;&#24182;&#19988;&#20026; <span class="t-lc"><a href="cpp-io-basic_streambuf-pubsync.html">std::basic_streambuf::pubsync()</a></span> &#25152;&#26174;&#24335;&#35843;&#29992;&#12290;</p>
<h3><span class="mw-headline" id=".E7.A4.BA.E4.BE.8B">&#31034;&#20363;</span></h3>
<table class="metadata plainlinks ambox mbox-small-left ambox-notice" style="">
<tr>
<td class="mbox-empty-cell"></td>
<td class="mbox-text" style="">&#26412;&#33410;&#26410;&#23436;&#25104;<br />
&#21407;&#22240;&#65306;&#26242;&#26080;&#31034;&#20363;</td>
</tr>
</table>
<h3><span class="mw-headline" id=".E5.8F.82.E9.98.85">&#21442;&#38405;</span></h3>
<table class="t-dsc-begin">
<tr class="t-dsc">
<td>
<div class="t-dsc-member-div">
<div><a href="cpp-io-basic_streambuf-pubsync.html"><span class="t-lines"><span>sync</span></span></a></div>
<div><span class="t-lines"><span><span class="t-cmark">[&#34394;]</span></span></span></div>
</div>
</td>
<td>&#23558;&#32531;&#20914;&#19982;&#20851;&#32852;&#30340;&#23383;&#31526;&#24207;&#21015;&#21516;&#27493;<br />
<span class="t-mark">(<code>std::basic_streambuf&lt;CharT,Traits&gt;</code> &#30340;&#34394;&#21463;&#20445;&#25252;&#25104;&#21592;&#20989;&#25968;)</span></td>
</tr>
<tr class="t-dsc">
<td>
<div class="t-dsc-member-div">
<div><a href="cpp-io-basic_osyncstream-emit.html"><span class="t-lines"><span>emit</span></span></a></div>
</div>
</td>
<td>&#35843;&#29992;&#24213;&#23618; basic_syncbuf &#19978;&#30340; emit &#20197;&#20256;&#36755;&#20854;&#20869;&#37096;&#25968;&#25454;&#21040;&#26368;&#32456;&#30446;&#26631;<br />
<span class="t-mark">(<code>std::basic_osyncstream&lt;CharT,Traits,Allocator&gt;</code> &#30340;&#20844;&#24320;&#25104;&#21592;&#20989;&#25968;)</span></td>
</tr>
</table>
</div>
<div class="visualClear"></div>
</div>
</div>
</div>
</body>
</html>