|
game_launcher 1.1.0
Modern Linux game launcher with Steam / Proton / Wine integration
|
RAII wrapper for FILE* from fopen(). More...
#include <file_handle.h>
Public Member Functions | |
| FileHandle (const char *filename, const char *mode) | |
| Open file with specified mode. | |
| FileHandle (const FileHandle &)=delete | |
| FileHandle (const std::string &filename, const char *mode) | |
| FileHandle (FileHandle &&other) noexcept | |
| ~FileHandle () | |
| Destructor - automatically closes file. | |
| FILE * | get () const |
| Get raw FILE* pointer. | |
| bool | isOpen () const |
| Check if file is open. | |
| operator bool () const | |
| Explicit bool conversion for easy checking. | |
| FileHandle & | operator= (const FileHandle &)=delete |
| FileHandle & | operator= (FileHandle &&other) noexcept |
| FILE * | release () |
| Release ownership of FILE* without closing. | |
RAII wrapper for FILE* from fopen().
Automatically closes file handle on destruction, preventing resource leaks. Non-copyable but movable.
Definition at line 52 of file file_handle.h.
|
inline |
Open file with specified mode.
| filename | Path to file |
| mode | File open mode ("r", "w", "a", etc.) |
Definition at line 60 of file file_handle.h.
Referenced by FileHandle(), FileHandle(), operator=(), and operator=().
|
inline |
Definition at line 62 of file file_handle.h.
|
inline |
Destructor - automatically closes file.
Definition at line 70 of file file_handle.h.
|
delete |
References FileHandle().
|
inlinenoexcept |
Definition at line 84 of file file_handle.h.
References FileHandle().
|
inline |
Get raw FILE* pointer.
Definition at line 107 of file file_handle.h.
|
inline |
Check if file is open.
Definition at line 116 of file file_handle.h.
Referenced by operator bool().
|
inlineexplicit |
Explicit bool conversion for easy checking.
Definition at line 124 of file file_handle.h.
References isOpen().
|
delete |
References FileHandle().
|
inlinenoexcept |
Definition at line 89 of file file_handle.h.
References FileHandle().
|
inline |
Release ownership of FILE* without closing.
Definition at line 133 of file file_handle.h.