Newer
Older
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
/**
* A library for Qt app
*
* LICENSE: The GNU Lesser General Public License, version 3.0
*
* @author Akira Ohgaki <akiraohgaki@gmail.com>
* @copyright Akira Ohgaki
* @license https://opensource.org/licenses/LGPL-3.0 The GNU Lesser General Public License, version 3.0
* @link https://github.com/akiraohgaki/qtlibs
*/
#pragma once
#include <QObject>
namespace qtlibs {
class File : public QObject
{
Q_OBJECT
public:
explicit File(const QString &path, QObject *parent = 0);
QString path() const;
void setPath(const QString &path);
bool exists();
QByteArray readData();
bool writeData(const QByteArray &data);
QString readText();
bool writeText(const QString &data);
bool copy(const QString &newPath);
bool move(const QString &newPath);
bool remove();
private:
QString path_;
};
} // namespace qtlibs