Hotwheels-Cluster 1.2
Creation of Cluster APP for SEA:ME project.
 
Loading...
Searching...
No Matches
FileController Namespace Reference

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.
 

Detailed Description

Namespace containing file handling functions.

Open a file.

Function Documentation

◆ exists()

bool FileController::exists ( const QString & path)

Checks if a file exists.

This function checks if the given file path exists.

Parameters
pathThe file path to check.
Returns
True if the file exists, false otherwise.

Definition at line 83 of file FileController.cpp.

◆ open()

bool FileController::open ( QFile & file,
QIODevice::OpenMode mode )

Open a file.

Opens a file with the specified mode.

Parameters
fileThe file to open.
modeThe mode to open the file with.
Returns
True if the file was opened successfully, false otherwise.

Definition at line 35 of file FileController.cpp.

◆ read()

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.

Parameters
fileThe file to read from.
Returns
The line read from the file as a QString.

Definition at line 50 of file FileController.cpp.

◆ write()

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.

Parameters
fileThe file to write to.
dataThe line to write to the file.
Returns
True if the line was written successfully, false otherwise.

Definition at line 67 of file FileController.cpp.