上传cppreference
This commit is contained in:
@@ -0,0 +1,97 @@
|
||||
<!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_filebuf<CharT,Traits>::basic_filebuf</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_filebuf_basic_filebuf 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_filebuf<CharT,Traits>::</span>basic_filebuf</h1>
|
||||
<div id="bodyContent">
|
||||
<div id="contentSub"><span class="subpages">< <a href="cpp.html">cpp</a>‎ | <a href="cpp-io.html">io</a>‎ | <a href="cpp-io-basic_filebuf.html">basic filebuf</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>
|
||||
<div><span class="mw-geshi cpp source-cpp">basic_filebuf<span class="br0">(</span><span class="br0">)</span><span class="sy4">;</span></span></div>
|
||||
</td>
|
||||
<td>(1)</td>
|
||||
<td class="t-dcl-nopad"></td>
|
||||
</tr>
|
||||
<tr class="t-dcl t-since-cxx11">
|
||||
<td>
|
||||
<div><span class="mw-geshi cpp source-cpp">basic_filebuf<span class="br0">(</span> <span class="kw4">const</span> <a href="cpp-io-basic_filebuf.html"><span class="kw1667">std::<span class="me2">basic_filebuf</span></span></a><span class="sy3">&</span> rhs <span class="br0">)</span> <span class="sy1">=</span> delete<span class="sy4">;</span></span></div>
|
||||
</td>
|
||||
<td>(2)</td>
|
||||
<td><span class="t-mark-rev t-since-cxx11">(C++11 起)</span></td>
|
||||
</tr>
|
||||
<tr class="t-dcl t-since-cxx11">
|
||||
<td>
|
||||
<div><span class="mw-geshi cpp source-cpp">basic_filebuf<span class="br0">(</span> <a href="cpp-io-basic_filebuf.html"><span class="kw1667">std::<span class="me2">basic_filebuf</span></span></a><span class="sy3">&&</span> rhs <span class="br0">)</span><span class="sy4">;</span></span></div>
|
||||
</td>
|
||||
<td>(3)</td>
|
||||
<td><span class="t-mark-rev t-since-cxx11">(C++11 起)</span></td>
|
||||
</tr>
|
||||
<tr class="t-dcl-sep">
|
||||
<td></td>
|
||||
<td></td>
|
||||
<td></td>
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
<p>构造新的 <code>std::basic_filebuf</code> 对象。</p>
|
||||
<div class="t-li1"><span class="t-li">1)</span> 构造 <code>std::basic_filebuf</code> 对象,以调用 <span class="t-lc"><a href="cpp-io-basic_streambuf.html">std::basic_streambuf</a></span> 的默认构造函数初始化基类。创建的 <code>basic_filebuf</code> 不与文件关联,而 <span class="t-lc"><a href="cpp-io-basic_filebuf-is_open.html">is_open()</a></span> 返回 <span class="t-c"><span class="mw-geshi cpp source-cpp"><span class="kw2">false</span></span></span> 。</div>
|
||||
<div class="t-li1"><span class="t-li">2)</span> 复制构造函数被删除; <code>std::basic_filebuf</code> 非<a href="cpp-named_req-CopyConstructible.html"><span style="font-style:italic">可复制构造</span> <span style="font-family: Georgia, 'DejaVu Serif', serif; font-style:italic">(CopyConstructible)</span></a> 。</div>
|
||||
<div class="t-li1"><span class="t-li">3)</span> 通过从另一 <code>std::basic_filebuf</code> 对象 <code>rhs</code> 移动所有内容,包含缓冲区、关联的文件、 locale 、打开模式、 is_open 变量和所有其他状态移动构造 <code>std::basic_filebuf</code> 对象。移动后, <code>rhs</code> 不与文件关联且 <span class="t-c"><span class="mw-geshi cpp source-cpp">rhs.<span class="me1">is_open</span><span class="br0">(</span><span class="br0">)</span><span class="sy1">==</span><span class="kw2">false</span></span></span> 。保证 <code>rhs</code> 的基类和 <code>*this</code> 的基类 <span class="t-lc"><a href="cpp-io-basic_streambuf.html">std::basic_streambuf</a></span> 的成员指针指向不同缓冲区,除非它们为空。</div>
|
||||
<h3><span class="mw-headline" id=".E5.8F.82.E6.95.B0">参数</span></h3>
|
||||
<table class="t-par-begin">
|
||||
<tr class="t-par">
|
||||
<td>rhs</td>
|
||||
<td>-</td>
|
||||
<td>另一 <code>basic_filebuf</code></td>
|
||||
</tr>
|
||||
</table>
|
||||
<h3><span class="mw-headline" id=".E6.B3.A8.E6.84.8F">注意</span></h3>
|
||||
<p>典型地为 <span class="t-lc"><a href="cpp-io-basic_fstream.html">std::basic_fstream</a></span> 的构造函数所调用。</p>
|
||||
<h3><span class="mw-headline" id=".E7.A4.BA.E4.BE.8B">示例</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="">本节未完成<br />
|
||||
原因:暂无示例</td>
|
||||
</tr>
|
||||
</table>
|
||||
<h3><span class="mw-headline" id=".E5.8F.82.E9.98.85">参阅</span></h3>
|
||||
<table class="t-dsc-begin">
|
||||
<tr class="t-dsc">
|
||||
<td>
|
||||
<div class="t-dsc-member-div">
|
||||
<div><a href="cpp-io-basic_filebuf-operator=.html"><span class="t-lines"><span>operator=</span></span></a></div>
|
||||
<div><span class="t-lines"><span><span class="t-mark-rev t-since-cxx11">(C++11)</span></span></span></div>
|
||||
</div>
|
||||
</td>
|
||||
<td>赋值 basic_filebuf 对象<br />
|
||||
<span class="t-mark">(公开成员函数)</span></td>
|
||||
</tr>
|
||||
<tr class="t-dsc">
|
||||
<td>
|
||||
<div class="t-dsc-member-div t-dsc-member-nobold-div">
|
||||
<div><a href="cpp-io-basic_filebuf-~basic_filebuf.html"><span class="t-lines"><span>(析构函数)</span></span></a></div>
|
||||
<div><span class="t-lines"><span><span class="t-cmark">[虚]</span></span></span></div>
|
||||
</div>
|
||||
</td>
|
||||
<td>析构 basic_filebuf 对象并且若打开则关闭文件<br />
|
||||
<span class="t-mark">(虚公开成员函数)</span></td>
|
||||
</tr>
|
||||
</table>
|
||||
</div>
|
||||
<div class="visualClear"></div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</body>
|
||||
</html>
|
||||
Reference in New Issue
Block a user