19#include <system_error>
23using namespace std::filesystem;
90 return OpenFlags(
unsigned(A) |
unsigned(B));
146 unsigned Mode = 0666) {
169 unsigned Mode = 0666) {
file_t OpenFileForReadWrite(const path &Path, std::error_code &EC, CreationDisposition Disp, OpenFlags Flags, unsigned Mode=0666)
Opens the file with the given name in a write-only or read-write mode, returning its open file descri...
Definition: fs.h:167
OpenFlags
Definition: fs.h:64
@ F_Append
Definition: fs.h:75
@ OF_Append
The file should be opened in append mode.
Definition: fs.h:74
@ OF_ChildInherit
When a child process is launched, this file should remain open in the child process.
Definition: fs.h:82
@ OF_None
Definition: fs.h:65
@ OF_Text
The file should be opened in text mode on platforms that make this distinction.
Definition: fs.h:70
@ F_Text
Definition: fs.h:71
@ OF_Delete
Delete the file on close. Only makes a difference on windows.
Definition: fs.h:78
@ F_None
Definition: fs.h:66
@ OF_UpdateAtime
Force files Atime to be updated on access.
Definition: fs.h:86
FileAccess
Definition: fs.h:59
@ FA_Write
Definition: fs.h:61
@ FA_Read
Definition: fs.h:60
int FileToFd(file_t &F, std::error_code &EC, OpenFlags Flags)
Converts a file object to a file descriptor.
file_t OpenFileForWrite(const path &Path, std::error_code &EC, CreationDisposition Disp, OpenFlags Flags, unsigned Mode=0666)
Opens the file with the given name in a write-only or read-write mode, returning its open file descri...
Definition: fs.h:144
CreationDisposition
Definition: fs.h:37
@ CD_OpenExisting
CD_OpenExisting - When opening a file:
Definition: fs.h:51
@ CD_CreateNew
CD_CreateNew - When opening a file:
Definition: fs.h:46
@ CD_OpenAlways
CD_OpenAlways - When opening a file:
Definition: fs.h:56
@ CD_CreateAlways
CD_CreateAlways - When opening a file:
Definition: fs.h:41
int file_t
Definition: fs.h:32
std::ifstream ifstream
Definition: fs.h:24
std::fstream fstream
Definition: fs.h:26
std::ofstream ofstream
Definition: fs.h:25
void CloseFile(file_t &F)
Closes the file object.
file_t OpenFileForRead(const path &Path, std::error_code &EC, OpenFlags Flags=OF_None)
Opens the file with the given name in a read-only mode, returning its open file descriptor.
OpenFlags operator|(OpenFlags A, OpenFlags B)
Definition: fs.h:89
const file_t kInvalidFile
file_t OpenFile(const path &Path, std::error_code &EC, CreationDisposition Disp, FileAccess Access, OpenFlags Flags, unsigned Mode=0666)
Opens a file with the specified creation disposition, access mode, and flags and returns a platform-s...
OpenFlags & operator|=(OpenFlags &A, OpenFlags B)
Definition: fs.h:93
static constexpr const unit_t< compound_unit< charge::coulomb, inverse< substance::mol > > > F(N_A *e)
Faraday constant.