25 #ifndef _UTILS_SYSTEM_FILE_H_
26 #define _UTILS_SYSTEM_FILE_H_
28 #include <core/exception.h>
Base class for exceptions in Fawkes.
File(const char *filename, FileOpenMethod method=APPEND)
Constructor.
static bool is_regular(const char *filename)
Check if a file is a regular file.
static bool exists(const char *filename)
Check if a file exists.
FileOpenMethod
What to do when a file with the same name already exists.
@ APPEND
append data at the end of the existing file
@ ADD_SUFFIX
add a suffix (starting with ".1") to the given filename
@ OVERWRITE
overwrite the existing file
FILE * stream() const
Get access to the file stream.
const char * filename() const
Get the file's name.
Opening a file failed for some reason.
UnableToOpenFileException(const char *filename, int error)
Constructor.
Fawkes library namespace.