WPILibC++ 2023.4.3
|
Typedefs | |
using | ifstream = ghc::filesystem::ifstream |
using | ofstream = ghc::filesystem::ofstream |
using | fstream = ghc::filesystem::fstream |
using | file_t = int |
Enumerations | |
enum | CreationDisposition : unsigned { CD_CreateAlways = 0 , CD_CreateNew = 1 , CD_OpenExisting = 2 , CD_OpenAlways = 3 } |
enum | FileAccess : unsigned { FA_Read = 1 , FA_Write = 2 } |
enum | OpenFlags : unsigned { OF_None = 0 , F_None = 0 , OF_Text = 1 , F_Text = 1 , OF_Append = 2 , F_Append = 2 , OF_Delete = 4 , OF_ChildInherit = 8 , OF_UpdateAtime = 16 } |
Functions | |
OpenFlags | operator| (OpenFlags A, OpenFlags B) |
OpenFlags & | operator|= (OpenFlags &A, OpenFlags B) |
FileAccess | operator| (FileAccess A, FileAccess B) |
FileAccess & | operator|= (FileAccess &A, FileAccess B) |
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-specific file object. More... | |
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 descriptor. More... | |
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 descriptor. More... | |
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. More... | |
int | FileToFd (file_t &F, std::error_code &EC, OpenFlags Flags) |
Converts a file object to a file descriptor. More... | |
void | CloseFile (file_t &F) |
Closes the file object. More... | |
Variables | |
const file_t | kInvalidFile |
typedef int fs::file_t |
using fs::fstream = typedef ghc::filesystem::fstream |
using fs::ifstream = typedef ghc::filesystem::ifstream |
using fs::ofstream = typedef ghc::filesystem::ofstream |
enum fs::CreationDisposition : unsigned |
enum fs::FileAccess : unsigned |
enum fs::OpenFlags : unsigned |
void fs::CloseFile | ( | file_t & | F | ) |
Closes the file object.
F | On input, this is the file to close. On output, the file is set to kInvalidFile. |
Converts a file object to a file descriptor.
The returned file descriptor must be closed with ::close() instead of CloseFile().
F | On input, this is the file to convert to a file descriptor. On output, the file is set to kInvalidFile. |
EC | Error code output, set to non-zero on error |
Flags | Flags passed to the OpenFile function that created file_t |
file_t fs::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-specific file object.
The caller is responsible for closing the file object once they are finished with it.
Path | The path of the file to open, relative or absolute. |
EC | Error code output, set to non-zero on error |
Disp | Value specifying the existing-file behavior |
Access | Value specifying whether to open the file in read, write, or read-write mode. |
Flags | Additional flags. |
Mode | The access permissions of the file, represented in octal. |
Opens the file with the given name in a read-only mode, returning its open file descriptor.
The caller is responsible for closing the freeing the file once they are finished with it.
Path | The path of the file to open, relative or absolute. |
EC | Error code output, set to non-zero on error |
Flags | Additional flags |
|
inline |
Opens the file with the given name in a write-only or read-write mode, returning its open file descriptor.
If the file does not exist, it is created.
The caller is responsible for closing the freeing the file once they are finished with it.
Path | The path of the file to open, relative or absolute. |
EC | Error code output, set to non-zero on error |
Disp | Value specifying the existing-file behavior |
Flags | Additional flags used to determine whether the file should be opened in, for example, read-write or in write-only mode. |
Mode | The access permissions of the file, represented in octal. |
|
inline |
Opens the file with the given name in a write-only or read-write mode, returning its open file descriptor.
If the file does not exist, it is created.
The caller is responsible for closing the freeing the file once they are finished with it.
Path | The path of the file to open, relative or absolute. |
EC | Error code output, set to non-zero on error |
Disp | Value specifying the existing-file behavior |
Flags | Additional flags used to determine whether the file should be opened in, for example, read-write or in write-only mode. |
Mode | The access permissions of the file, represented in octal. |
|
inline |
|
inline |
|
extern |