Warning, file /include/QtCore/qresource.h was not indexed
or was modified since last indexation (in which case cross-reference links may be missing, inaccurate or erroneous).
0001
0002
0003
0004
0005 #ifndef QRESOURCE_H
0006 #define QRESOURCE_H
0007
0008 #include <QtCore/qstring.h>
0009 #include <QtCore/qlocale.h>
0010 #include <QtCore/qstringlist.h>
0011 #include <QtCore/qlist.h>
0012 #include <QtCore/qscopedpointer.h>
0013
0014 QT_BEGIN_NAMESPACE
0015
0016
0017 class QResourcePrivate;
0018
0019 class Q_CORE_EXPORT QResource
0020 {
0021 public:
0022 enum Compression {
0023 NoCompression,
0024 ZlibCompression,
0025 ZstdCompression
0026 };
0027
0028 QResource(const QString &file = QString(), const QLocale &locale = QLocale());
0029 ~QResource();
0030
0031 void setFileName(const QString &file);
0032 QString fileName() const;
0033 QString absoluteFilePath() const;
0034
0035 void setLocale(const QLocale &locale);
0036 QLocale locale() const;
0037
0038 bool isValid() const;
0039
0040 Compression compressionAlgorithm() const;
0041 qint64 size() const;
0042 const uchar *data() const;
0043 qint64 uncompressedSize() const;
0044 QByteArray uncompressedData() const;
0045 QDateTime lastModified() const;
0046
0047 static bool registerResource(const QString &rccFilename, const QString &resourceRoot=QString());
0048 static bool unregisterResource(const QString &rccFilename, const QString &resourceRoot=QString());
0049
0050 static bool registerResource(const uchar *rccData, const QString &resourceRoot=QString());
0051 static bool unregisterResource(const uchar *rccData, const QString &resourceRoot=QString());
0052
0053 protected:
0054 friend class QResourceFileEngine;
0055 friend class QResourceFileEngineIterator;
0056 bool isDir() const;
0057 inline bool isFile() const { return !isDir(); }
0058 QStringList children() const;
0059
0060 protected:
0061 QScopedPointer<QResourcePrivate> d_ptr;
0062
0063 private:
0064 Q_DECLARE_PRIVATE(QResource)
0065 };
0066
0067 QT_END_NAMESPACE
0068
0069 #endif