名前空間
変種
操作

std::basic_streambuf::pubsetbuf, std::basic_streambuf::setbuf

提供: cppreference.com
< cpp‎ | io‎ | basic streambuf

 
 
入力/出力ライブラリ
I / Oのマニピュレータ
CスタイルのI / O
バッファ
Original:
Buffers
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.
basic_streambuf
basic_filebuf
basic_stringbuf
strstreambuf(廃止予定)
ストリーム
Original:
Streams
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.
抽象化
Original:
Abstractions
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.
ios_base
basic_ios
basic_istream
basic_ostream
basic_iostream
ファイルI / O
Original:
File I/O
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.
basic_ifstream
basic_ofstream
basic_fstream
文字列I / O
Original:
String I/O
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.
basic_istringstream
basic_ostringstream
basic_stringstream
アレイのI / O
Original:
Array I/O
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.
istrstream(廃止予定)
ostrstream(廃止予定)
strstream(廃止予定)
タイプ
Original:
Types
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.
streamoff
streamsize
fpos
エラーカテゴリインターフェース
Original:
Error category interface
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.
iostream_category(C++11)
io_errc(C++11)
 
std::basic_streambuf
パブリックメンバ関数
Original:
Public member functions
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.
basic_streambuf::~basic_streambuf
ロケール
Original:
Locales
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.
basic_streambuf::pubimbue
basic_streambuf::getloc
ポジショニング
Original:
Positioning
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.
basic_streambuf::pubsetbuf
basic_streambuf::pubseekoff
basic_streambuf::pubseekpos
basic_streambuf::pubsync
領域を取得します
Original:
Get area
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.
basic_streambuf::in_avail
basic_streambuf::snextc
basic_streambuf::sbumpc
basic_streambuf::sgetc
basic_streambuf::sgetn
エリアを入れてください
Original:
Put area
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.
basic_streambuf::sputc
basic_streambuf::sputn
プット
Original:
Putback
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.
basic_streambuf::sputbackc
basic_streambuf::sungetc
メンバ関数を保護しました
Original:
Protected member functions
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.
basic_streambuf::basic_streambuf
basic_streambuf::operator=(C++11)
basic_streambuf::swap(C++11)
ロケール
Original:
Locales
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.
basic_streambuf::imbue
ポジショニング
Original:
Positioning
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.
basic_streambuf::setbuf
basic_streambuf::seekoff
basic_streambuf::seekpos
basic_streambuf::sync
領域を取得します
Original:
Get area
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.
basic_streambuf::showmanyc
basic_streambuf::underflow
basic_streambuf::uflow
basic_streambuf::xsgetn
basic_streambuf::eback
basic_streambuf::gptr
basic_streambuf::egptr
basic_streambuf::gbump
basic_streambuf::setg
エリアを入れてください
Original:
Put area
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.
basic_streambuf::xsputn
basic_streambuf::overflow
basic_streambuf::pbase
basic_streambuf::pptr
basic_streambuf::epptr
basic_streambuf::pbump
basic_streambuf::setp
プット
Original:
Putback
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.
basic_streambuf::pbackfail
 
basic_streambuf<CharT,Traits>* pubsetbuf( char_type* s, std::streamsize n )
(1)
protected:
virtual basic_streambuf<CharT,Traits>* setbuf( char_type* s, std::streamsize n )
(2)
1)
最派生クラスのsetbuf(s, n)呼び出します
Original:
Calls setbuf(s, n) of the most derived class
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.
2)
この関数の基本クラスのバージョンは効果がありません。派生クラスは、ユーザ提供の配列と、または任意の他の実装固有の目的のために管理された文字シーケンス(バッファ)の取り外しや交換を可能にするために、この関数をオーバーライドすることができます.
Original:
The base class version of this function has no effect. The derived classes may override this function to allow removal or replacement of the controlled character sequence (the buffer) with a user-provided array, or for any other implementation-specific purpose.
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.

目次

[編集] パラメータ

s -
ユーザが提供するバッファ内の最初のバイトへのポインタ
Original:
pointer to the first byte in the user-provided buffer
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.
n -
ユーザが提供するバッファのバイト数
Original:
the number of bytes in the user-provided buffer
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.

[編集] 値を返します

*this

[編集]

読書のための10Kバッファを提供します。 Linux上では、straceユーティリティーは、実際に読み込んだバイト数を観察するために使用されるかもしれません
Original:
provide a 10k buffer for reading. On linux, the strace utility may be used to observe the actual number of bytes read
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.

#include <fstream>
#include <iostream>
#include <string>
 
int main()
{
    int cnt=0;
    std::ifstream file;
    char buf[10241];
    file.rdbuf()->pubsetbuf(buf, sizeof buf);
    file.open("/usr/share/dict/words");
    for (std::string line; getline(file, line); ) {
        cnt++;
    }
 
    std::cout << cnt << '\n';
}


[編集] も参照してください

[仮想]
ユーザ供給のバッファを提供するか、またはこのfilebufではバッファリングされていないになります
Original:
provides user-supplied buffer or turns this filebuf unbuffered
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.

(仮想protectedメンバ関数of std::basic_filebuf) [edit]