Gem Illuminator
 All Classes Namespaces Files Functions Variables Enumerations Enumerator Macros
fileio.h
Go to the documentation of this file.
1 #ifndef FILEIO_H
2 #define FILEIO_H
3 
4 #include <QObject>
5 
10 class FileIO : public QObject
11 {
12  Q_OBJECT
13  Q_PROPERTY(QString source READ source WRITE setSource NOTIFY sourceChanged)
14 
15 public:
20  explicit FileIO(QObject *parent = 0);
21  ~FileIO();
22 
27  Q_INVOKABLE QString read();
32  void setSource(const QString& source);
37  QString source();
42  Q_INVOKABLE bool write(const QString& data);
43 
44 signals:
49  void error(const QString& msg);
54  void sourceChanged(const QString& source);
55 
56 protected:
57  QString m_source;
58 };
59 
60 #endif // FILEIO_H
Q_INVOKABLE QString read()
Reads previous specified file.
Definition: fileio.cpp:13
void setSource(const QString &source)
Sets the source file by name. The source is read calling read()
Definition: fileio.cpp:102
QString m_source
Definition: fileio.h:57
void error(const QString &msg)
This signal will be emitted if an error occurs.
~FileIO()
Definition: fileio.cpp:111
Q_INVOKABLE bool write(const QString &data)
Writes specified data into source()
Definition: fileio.cpp:60
FileIO(QObject *parent=0)
Creates a new FileIO.
Definition: fileio.cpp:9
void sourceChanged(const QString &source)
This signal is emitted if the source() is changed.
QString source()
The name of file that is read by read().
The FileIO class provides platform independent file reading for resource files used. The file that should be read is specified by name and FileIO will load it from platform dependent location.
Definition: fileio.h:10