bool is_open() const;
basic_filebuf* open(const char* s, ios_base::openmode mode);
basic_filebuf* open(const filesystem::path::value_type* s,
ios_base::openmode mode); // wide systems only; see [fstream.syn]
ios_base flag combination | stdio equivalent | ||||
binary | in | out | trunc | app | |
+ | "w" | ||||
+ | + | "a" | |||
+ | "a" | ||||
+ | + | "w" | |||
+ | "r" | ||||
+ | + | "r+" | |||
+ | + | + | "w+" | ||
+ | + | + | "a+" | ||
+ | + | "a+" | |||
+ | + | "wb" | |||
+ | + | + | "ab" | ||
+ | + | "ab" | |||
+ | + | + | "wb" | ||
+ | + | "rb" | |||
+ | + | + | "r+b" | ||
+ | + | + | + | "w+b" | |
+ | + | + | + | "a+b" | |
+ | + | + | "a+b" |
basic_filebuf* open(const string& s, ios_base::openmode mode);
basic_filebuf* open(const filesystem::path& s, ios_base::openmode mode);
basic_filebuf* close();