Hotwheels-Cluster 1.2
Creation of Cluster APP for SEA:ME project.
 
Loading...
Searching...
No Matches
FileController.cpp
Go to the documentation of this file.
1
14
15#include "FileController.hpp"
16#include <QDebug>
17#include <QTextStream>
18
23namespace FileController {
24
35 bool open(QFile &file, QIODevice::OpenMode mode)
36 {
37 return file.open(mode);
38 }
39
50 QString read(QFile &file)
51 {
52 QTextStream in(&file);
53 return in.readLine();
54 }
55
67 bool write(QFile &file, const QString &data)
68 {
69 QTextStream out(&file);
70 out << data << Qt::endl;
71 return true;
72 }
73
83 bool exists(const QString &path)
84 {
85 return QFile::exists(path);
86 }
87
88} // namespace FileController
Definition of the FileController namespace.
Namespace containing file handling functions.
bool open(QFile &file, QIODevice::OpenMode mode)
Open a file.
bool exists(const QString &path)
Checks if a file exists.
QString read(QFile &file)
Reads a line from the file.
bool write(QFile &file, const QString &data)
Writes a line to the file.