Qt 4.8
qresource_p.h
Go to the documentation of this file.
1 /****************************************************************************
2 **
3 ** Copyright (C) 2014 Digia Plc and/or its subsidiary(-ies).
4 ** Contact: http://www.qt-project.org/legal
5 **
6 ** This file is part of the QtCore module of the Qt Toolkit.
7 **
8 ** $QT_BEGIN_LICENSE:LGPL$
9 ** Commercial License Usage
10 ** Licensees holding valid commercial Qt licenses may use this file in
11 ** accordance with the commercial license agreement provided with the
12 ** Software or, alternatively, in accordance with the terms contained in
13 ** a written agreement between you and Digia. For licensing terms and
14 ** conditions see http://qt.digia.com/licensing. For further information
15 ** use the contact form at http://qt.digia.com/contact-us.
16 **
17 ** GNU Lesser General Public License Usage
18 ** Alternatively, this file may be used under the terms of the GNU Lesser
19 ** General Public License version 2.1 as published by the Free Software
20 ** Foundation and appearing in the file LICENSE.LGPL included in the
21 ** packaging of this file. Please review the following information to
22 ** ensure the GNU Lesser General Public License version 2.1 requirements
23 ** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
24 **
25 ** In addition, as a special exception, Digia gives you certain additional
26 ** rights. These rights are described in the Digia Qt LGPL Exception
27 ** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
28 **
29 ** GNU General Public License Usage
30 ** Alternatively, this file may be used under the terms of the GNU
31 ** General Public License version 3.0 as published by the Free Software
32 ** Foundation and appearing in the file LICENSE.GPL included in the
33 ** packaging of this file. Please review the following information to
34 ** ensure the GNU General Public License version 3.0 requirements will be
35 ** met: http://www.gnu.org/copyleft/gpl.html.
36 **
37 **
38 ** $QT_END_LICENSE$
39 **
40 ****************************************************************************/
41 
42 #ifndef QRESOURCE_P_H
43 #define QRESOURCE_P_H
44 
45 //
46 // W A R N I N G
47 // -------------
48 //
49 // This file is not part of the Qt API. It exists purely as an
50 // implementation detail. This header file may change from version to
51 // version without notice, or even be removed.
52 //
53 // We mean it.
54 //
55 
56 #include "QtCore/qabstractfileengine.h"
57 
59 
62 {
63 private:
65 public:
66  explicit QResourceFileEngine(const QString &path);
68 
69  virtual void setFileName(const QString &file);
70 
71  virtual bool open(QIODevice::OpenMode flags) ;
72  virtual bool close();
73  virtual bool flush();
74  virtual qint64 size() const;
75  virtual qint64 pos() const;
76  virtual bool atEnd() const;
77  virtual bool seek(qint64);
78  virtual qint64 read(char *data, qint64 maxlen);
79  virtual qint64 write(const char *data, qint64 len);
80 
81  virtual bool remove();
82  virtual bool copy(const QString &newName);
83  virtual bool rename(const QString &newName);
84  virtual bool link(const QString &newName);
85 
86  virtual bool isSequential() const;
87 
88  virtual bool isRelativePath() const;
89 
90  virtual bool mkdir(const QString &dirName, bool createParentDirectories) const;
91  virtual bool rmdir(const QString &dirName, bool recurseParentDirectories) const;
92 
93  virtual bool setSize(qint64 size);
94 
95  virtual QStringList entryList(QDir::Filters filters, const QStringList &filterNames) const;
96 
97  virtual bool caseSensitive() const;
98 
99  virtual FileFlags fileFlags(FileFlags type) const;
100 
101  virtual bool setPermissions(uint perms);
102 
103  virtual QString fileName(QAbstractFileEngine::FileName file) const;
104 
105  virtual uint ownerId(FileOwner) const;
106  virtual QString owner(FileOwner) const;
107 
108  virtual QDateTime fileTime(FileTime time) const;
109 
110  virtual Iterator *beginEntryList(QDir::Filters filters, const QStringList &filterNames);
111  virtual Iterator *endEntryList();
112 
113  bool extension(Extension extension, const ExtensionOption *option = 0, ExtensionReturn *output = 0);
114  bool supportsExtension(Extension extension) const;
115 };
116 
118 
119 #endif // QRESOURCE_P_H
virtual bool open(QIODevice::OpenMode flags)
Opens the file in the specified mode.
Definition: qresource.cpp:1270
virtual bool mkdir(const QString &dirName, bool createParentDirectories) const
Requests that the directory dirName be created.
Definition: qresource.cpp:1221
virtual bool flush()
Flushes the open file, returning true if successful; otherwise returns false.
Definition: qresource.cpp:1292
virtual bool seek(qint64)
Sets the file position to the given offset.
Definition: qresource.cpp:1361
virtual bool setPermissions(uint perms)
Requests that the file's permissions be set to perms.
Definition: qresource.cpp:1401
virtual bool caseSensitive() const
Should return true if the underlying file system is case-sensitive; otherwise return false...
Definition: qresource.cpp:1241
int type
Definition: qmetatype.cpp:239
#define QT_END_NAMESPACE
This macro expands to.
Definition: qglobal.h:90
QResourceFileEngine(const QString &path)
Definition: qresource.cpp:1246
virtual bool rename(const QString &newName)
Requests that the file be renamed to newName in the file system.
Definition: qresource.cpp:1327
virtual QString owner(FileOwner) const
If owner is OwnerUser return the name of the user who owns the file.
Definition: qresource.cpp:1446
FileName
These values are used to request a file name in a particular format.
The QString class provides a Unicode character string.
Definition: qstring.h:83
virtual QStringList entryList(QDir::Filters filters, const QStringList &filterNames) const
Requests that a list of all the files matching the filters list based on the filterNames in the file ...
Definition: qresource.cpp:1236
provides an extended output argument to QAbstractFileEngine's extension support.
virtual QString fileName(QAbstractFileEngine::FileName file) const
Return the file engine's current file name in the format specified by file.
Definition: qresource.cpp:1406
#define QT_BEGIN_NAMESPACE
This macro expands to.
Definition: qglobal.h:89
bool supportsExtension(Extension extension) const
This virtual function returns true if the file engine supports extension; otherwise, false is returned.
Definition: qresource.cpp:1489
Extension
This enum describes the types of extensions that the file engine can support.
virtual Iterator * endEntryList()
Definition: qresource.cpp:1468
virtual FileFlags fileFlags(FileFlags type) const
This function should return the set of OR'd flags that are true for the file engine's file...
Definition: qresource.cpp:1378
The QStringList class provides a list of strings.
Definition: qstringlist.h:66
provides an extended input argument to QAbstractFileEngine's extension support.
The QAbstractFileEngine class provides an abstraction for accessing the filesystem.
virtual bool isRelativePath() const
Return true if the file referred to by this file engine has a relative path; otherwise return false...
Definition: qresource.cpp:1435
static const char * data(const QByteArray &arr)
unsigned int uint
Definition: qglobal.h:996
virtual QDateTime fileTime(FileTime time) const
If time is CreationTime, return when the file was created.
Definition: qresource.cpp:1451
__int64 qint64
Definition: qglobal.h:942
virtual bool copy(const QString &newName)
Copies the contents of this file to a file with the name newName.
Definition: qresource.cpp:1322
FileTime
These are used by the fileTime() function.
virtual bool rmdir(const QString &dirName, bool recurseParentDirectories) const
Requests that the directory dirName is deleted from the file system.
Definition: qresource.cpp:1226
virtual qint64 size() const
Returns the size of the file.
Definition: qresource.cpp:1337
static const char *const filters[3]
The QDateTime class provides date and time functions.
Definition: qdatetime.h:216
virtual qint64 pos() const
Returns the current file position.
Definition: qresource.cpp:1347
virtual bool setSize(qint64 size)
Requests that the file be set to size size.
Definition: qresource.cpp:1231
virtual bool link(const QString &newName)
Creates a link from the file currently specified by fileName() to newName.
Definition: qresource.cpp:1332
The QAbstractFileEngineIterator class provides an iterator interface for custom file engines...
bool extension(Extension extension, const ExtensionOption *option=0, ExtensionReturn *output=0)
This virtual function can be reimplemented in a QAbstractFileEngine subclass to provide support for e...
Definition: qresource.cpp:1473
virtual qint64 read(char *data, qint64 maxlen)
Reads a number of characters from the file into data.
Definition: qresource.cpp:1297
virtual bool close()
Closes the file, returning true if successful; otherwise returns false.
Definition: qresource.cpp:1284
virtual uint ownerId(FileOwner) const
If owner is OwnerUser return the ID of the user who owns the file.
Definition: qresource.cpp:1440
#define Q_DECLARE_PRIVATE(Class)
Definition: qglobal.h:2467
virtual qint64 write(const char *data, qint64 len)
Writes len bytes from data to the file.
Definition: qresource.cpp:1312
virtual bool isSequential() const
Returns true if the file is a sequential access device; returns false if the file is a direct access ...
Definition: qresource.cpp:1373
virtual void setFileName(const QString &file)
Sets the file engine's file name to file.
Definition: qresource.cpp:1264
virtual bool atEnd() const
Definition: qresource.cpp:1353
virtual Iterator * beginEntryList(QDir::Filters filters, const QStringList &filterNames)
Definition: qresource.cpp:1459