Namespace containing file handling functions. More...
Functions | |
bool | open (QFile &file, QIODevice::OpenMode mode) |
Open a file. | |
QString | read (QFile &file) |
Reads a line from the file. | |
bool | write (QFile &file, const QString &data) |
Writes a line to the file. | |
bool | exists (const QString &path) |
Checks if a file exists. | |
Namespace containing file handling functions.
Open a file.
bool FileController::exists | ( | const QString & | path | ) |
Checks if a file exists.
This function checks if the given file path exists.
path | The file path to check. |
Definition at line 83 of file FileController.cpp.
bool FileController::open | ( | QFile & | file, |
QIODevice::OpenMode | mode ) |
Open a file.
Opens a file with the specified mode.
file | The file to open. |
mode | The mode to open the file with. |
Definition at line 35 of file FileController.cpp.
QString FileController::read | ( | QFile & | file | ) |
Reads a line from the file.
This function reads a single line from the specified file using a QTextStream. It assumes the file is already open for reading.
file | The file to read from. |
Definition at line 50 of file FileController.cpp.
bool FileController::write | ( | QFile & | file, |
const QString & | data ) |
Writes a line to the file.
This function writes a single line to the specified file using a QTextStream. It assumes the file is already open for writing.
file | The file to write to. |
data | The line to write to the file. |
Definition at line 67 of file FileController.cpp.