名前空間
変種
操作

std::basic_filebuf::open

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

 
 
入力/出力ライブラリ
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_filebuf
パブリックメンバ関数
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_filebuf::basic_filebuf
basic_filebuf::~basic_filebuf
basic_filebuf::operator=(C++11)
basic_filebuf::swap(C++11)
basic_filebuf::is_open
basic_filebuf::open
basic_filebuf::close
メンバ関数を保護しました
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_filebuf::showmanyc
basic_filebuf::underflow
basic_filebuf::uflow
basic_filebuf::pbackfail
basic_filebuf::overflow
basic_filebuf::setbuf
basic_filebuf::seekoff
basic_filebuf::seekpos
basic_filebuf::sync
basic_filebuf::imbue
非メンバ関数
Original:
Non-member functions
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.
swap(std::basic_filebuf)(C++11)
 
std::basic_filebuf<CharT, Traits>* open( const char* s, std::ios_base::openmode mode )
(1)
std::basic_filebuf<CharT, Traits>* open( const std::string& s, std::ios_base::openmode mode )
(2) (C + + 11以来)
名前で指定されているファイルを開きます
Original:
Opens the file whose name is given by
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.
1)
NULLで終わる狭いバイト列s
Original:
the null-terminated narrow byte string s
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.
2)
NULLで終わる狭いバイト列s.c_str()
Original:
the null-terminated narrow byte string s.c_str()
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.
std::fopen(s, modestring)は次のように決定されmodestringを呼び出したかのように
Original:
as if by calling std::fopen(s, modestring), where modestring is determined as follows:
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.
modestring
Original:
modestring
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.
openmode & ~ate
"r" in
"w" out, out|trunc
"a" app, out|app
"r+" out|in
"w+" out|in|trunc
"a+" out|in|app, in|app
"rb" binary|in
"wb" binary|out, binary|out|trunc
"ab" binary|app, binary|out|app
"r+b" binary|out|in
"w+b" binary|out|in|trunc
"a+b" binary|out|in|app, binary|in|app
openmodeが記載されているモードのいずれかでない場合は、open()は失敗.
Original:
If openmode is not one of the modes listed, the open() fails.
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.
オープン操作はopenmode & std::ios_base::ate != 0を呼び出したかのように、ファイルの末尾にファイル位置を成功し、atestd::fseek(file, 0, SEEK_END)ビットがセットされている)、再配置した場合。再配置に失敗した場合は、close()を呼び出して、失敗したことを示すためにnullポインタを返す.
Original:
If the open operation succeeds and openmode & std::ios_base::ate != 0 (the ate bit is set), repositions the file position to the end of file, as if by calling std::fseek(file, 0, SEEK_END). If the repositioning fails, calls close() and returns a null pointer to indicate failure.
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.
関連付けられたファイルが既に開いていた場合は、すぐにヌルポインタを返す.
Original:
If the associated file was already open, returns a null pointer right away.
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.

目次

[編集] パラメータ

s -
オープンするファイル名
Original:
the file name to open
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.
openmode -
ファイルオープンモード、バイナリORstd::ios_baseモード
Original:
the file opening mode, a binary OR of the std::ios_base modes
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.

[編集] 値を返します

*this成功時、失敗時にはNULLポインタ.
Original:
*this on success, a null pointer on failure.
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.

[編集] ノート

open()は、通常、コンストラクタまたはopen()std::basic_fstreamメンバ関数を介して呼び出され.
Original:
open() is typically called through the constructor or the open() member function of std::basic_fstream.
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.

[編集]

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

checks if the associated file is open
(パブリックメンバ関数) [edit]
put領域バッファをフラッシュし、関連付けられているファイルを閉じます
Original:
flushes the put area buffer and closes the associated file
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.

(パブリックメンバ関数) [edit]