1 | /****************************************************************************
|
---|
2 | **
|
---|
3 | ** Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies).
|
---|
4 | ** Contact: Qt Software Information ([email protected])
|
---|
5 | **
|
---|
6 | ** This file is part of the QtCore module of the Qt Toolkit.
|
---|
7 | **
|
---|
8 | ** $QT_BEGIN_LICENSE:LGPL$
|
---|
9 | ** Commercial Usage
|
---|
10 | ** Licensees holding valid Qt Commercial licenses may use this file in
|
---|
11 | ** accordance with the Qt Commercial License Agreement provided with the
|
---|
12 | ** Software or, alternatively, in accordance with the terms contained in
|
---|
13 | ** a written agreement between you and Nokia.
|
---|
14 | **
|
---|
15 | ** GNU Lesser General Public License Usage
|
---|
16 | ** Alternatively, this file may be used under the terms of the GNU Lesser
|
---|
17 | ** General Public License version 2.1 as published by the Free Software
|
---|
18 | ** Foundation and appearing in the file LICENSE.LGPL included in the
|
---|
19 | ** packaging of this file. Please review the following information to
|
---|
20 | ** ensure the GNU Lesser General Public License version 2.1 requirements
|
---|
21 | ** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
|
---|
22 | **
|
---|
23 | ** In addition, as a special exception, Nokia gives you certain
|
---|
24 | ** additional rights. These rights are described in the Nokia Qt LGPL
|
---|
25 | ** Exception version 1.0, included in the file LGPL_EXCEPTION.txt in this
|
---|
26 | ** package.
|
---|
27 | **
|
---|
28 | ** GNU General Public License Usage
|
---|
29 | ** Alternatively, this file may be used under the terms of the GNU
|
---|
30 | ** General Public License version 3.0 as published by the Free Software
|
---|
31 | ** Foundation and appearing in the file LICENSE.GPL included in the
|
---|
32 | ** packaging of this file. Please review the following information to
|
---|
33 | ** ensure the GNU General Public License version 3.0 requirements will be
|
---|
34 | ** met: http://www.gnu.org/copyleft/gpl.html.
|
---|
35 | **
|
---|
36 | ** If you are unsure which license is appropriate for your use, please
|
---|
37 | ** contact the sales department at [email protected].
|
---|
38 | ** $QT_END_LICENSE$
|
---|
39 | **
|
---|
40 | ****************************************************************************/
|
---|
41 |
|
---|
42 | #ifndef QFSFILEENGINE_H
|
---|
43 | #define QFSFILEENGINE_H
|
---|
44 |
|
---|
45 | #include <QtCore/qabstractfileengine.h>
|
---|
46 |
|
---|
47 | #ifndef QT_NO_FSFILEENGINE
|
---|
48 |
|
---|
49 | QT_BEGIN_HEADER
|
---|
50 |
|
---|
51 | QT_BEGIN_NAMESPACE
|
---|
52 |
|
---|
53 | QT_MODULE(Core)
|
---|
54 |
|
---|
55 | class QFSFileEnginePrivate;
|
---|
56 |
|
---|
57 | class Q_CORE_EXPORT QFSFileEngine : public QAbstractFileEngine
|
---|
58 | {
|
---|
59 | Q_DECLARE_PRIVATE(QFSFileEngine)
|
---|
60 | public:
|
---|
61 | QFSFileEngine();
|
---|
62 | explicit QFSFileEngine(const QString &file);
|
---|
63 | ~QFSFileEngine();
|
---|
64 |
|
---|
65 | bool open(QIODevice::OpenMode openMode);
|
---|
66 | bool open(QIODevice::OpenMode flags, FILE *fh);
|
---|
67 | bool close();
|
---|
68 | bool flush();
|
---|
69 | qint64 size() const;
|
---|
70 | qint64 pos() const;
|
---|
71 | bool seek(qint64);
|
---|
72 | bool isSequential() const;
|
---|
73 | bool remove();
|
---|
74 | bool copy(const QString &newName);
|
---|
75 | bool rename(const QString &newName);
|
---|
76 | bool link(const QString &newName);
|
---|
77 | bool mkdir(const QString &dirName, bool createParentDirectories) const;
|
---|
78 | bool rmdir(const QString &dirName, bool recurseParentDirectories) const;
|
---|
79 | bool setSize(qint64 size);
|
---|
80 | bool caseSensitive() const;
|
---|
81 | bool isRelativePath() const;
|
---|
82 | QStringList entryList(QDir::Filters filters, const QStringList &filterNames) const;
|
---|
83 | FileFlags fileFlags(FileFlags type) const;
|
---|
84 | bool setPermissions(uint perms);
|
---|
85 | QString fileName(FileName file) const;
|
---|
86 | uint ownerId(FileOwner) const;
|
---|
87 | QString owner(FileOwner) const;
|
---|
88 | QDateTime fileTime(FileTime time) const;
|
---|
89 | void setFileName(const QString &file);
|
---|
90 | int handle() const;
|
---|
91 |
|
---|
92 | Iterator *beginEntryList(QDir::Filters filters, const QStringList &filterNames);
|
---|
93 | Iterator *endEntryList();
|
---|
94 |
|
---|
95 | qint64 read(char *data, qint64 maxlen);
|
---|
96 | qint64 readLine(char *data, qint64 maxlen);
|
---|
97 | qint64 write(const char *data, qint64 len);
|
---|
98 |
|
---|
99 | bool extension(Extension extension, const ExtensionOption *option = 0, ExtensionReturn *output = 0);
|
---|
100 | bool supportsExtension(Extension extension) const;
|
---|
101 |
|
---|
102 | //FS only!!
|
---|
103 | bool open(QIODevice::OpenMode flags, int fd);
|
---|
104 | static bool setCurrentPath(const QString &path);
|
---|
105 | static QString currentPath(const QString &path = QString());
|
---|
106 | static QString homePath();
|
---|
107 | static QString rootPath();
|
---|
108 | static QString tempPath();
|
---|
109 | static QFileInfoList drives();
|
---|
110 |
|
---|
111 | protected:
|
---|
112 | QFSFileEngine(QFSFileEnginePrivate &dd);
|
---|
113 | };
|
---|
114 |
|
---|
115 | QT_END_NAMESPACE
|
---|
116 |
|
---|
117 | QT_END_HEADER
|
---|
118 |
|
---|
119 | #endif // QT_NO_FSFILEENGINE
|
---|
120 |
|
---|
121 | #endif // QFSFILEENGINE_H
|
---|