9#include <QtCore/qstring.h>
10#include <QtCore/qlocale.h>
11#include <QtCore/qstringlist.h>
12#include <QtCore/qlist.h>
13#include <QtCore/qscopedpointer.h>
18class QResourcePrivate;
29 QResource(
const QString &file = QString(),
const QLocale &locale = QLocale());
32 void setFileName(
const QString &file);
33 QString fileName()
const;
34 QString absoluteFilePath()
const;
36 void setLocale(
const QLocale &locale);
37 QLocale locale()
const;
41 Compression compressionAlgorithm()
const;
43 const uchar *data()
const;
44 qint64 uncompressedSize()
const;
45 QByteArray uncompressedData()
const;
46 QDateTime lastModified()
const;
48 static bool registerResource(
const QString &rccFilename,
const QString &resourceRoot=QString());
49 static bool unregisterResource(
const QString &rccFilename,
const QString &resourceRoot=QString());
51 static bool registerResource(
const uchar *rccData,
const QString &resourceRoot=QString());
52 static bool unregisterResource(
const uchar *rccData,
const QString &resourceRoot=QString());
55 friend class QResourceFileEngine;
56 friend class QResourceFileEngineIterator;
58 inline bool isFile()
const {
return !isDir(); }
59 QStringList children()
const;
62 QScopedPointer<QResourcePrivate> d_ptr;
65 Q_DECLARE_PRIVATE(QResource)
~QResourceFileEnginePrivate()
QResourceFileEnginePrivate(QAbstractFileEngine *q)
bool caseSensitive() const override
Should return true if the underlying file system is case-sensitive; otherwise return false.
bool flush() override
Flushes the open file, returning true if successful; otherwise returns false.
qint64 read(char *data, qint64 maxlen) override
Reads a number of characters from the file into data.
bool close() override
Closes the file, returning true if successful; otherwise returns false.
bool open(QIODevice::OpenMode flags, std::optional< QFile::Permissions > permissions) override
Opens the file in the specified mode.
bool seek(qint64) override
Sets the file position to the given offset.
qint64 pos() const override
Returns the current file position.
QString fileName(QAbstractFileEngine::FileName file) const override
Return the file engine's current file name in the format specified by file.
qint64 size() const override
Returns the size of the file.
bool extension(Extension extension, const ExtensionOption *option=nullptr, ExtensionReturn *output=nullptr) override
virtual bool atEnd() const
uint ownerId(FileOwner) const override
If owner is OwnerUser return the ID of the user who owns the file.
bool supportsExtension(Extension extension) const override
void ensureChildren() const
static bool mayRemapData(const QResource &resource)
void ensureInitialized() const
QList< QResourceRoot * > related
QResourcePrivate(QResource *_q)
qsizetype decompress(char *buffer, qsizetype bufferSize) const
bool load(const QString &file)
static ResourceList * resourceList()
#define RCC_FEATURE_SYMBOL(feature)
static QRecursiveMutex & resourceMutex()
Q_DECLARE_TYPEINFO(QResourceRoot, Q_RELOCATABLE_TYPE)
static auto mappingBoundaries(const void *location, qsizetype size)
QList< QResourceRoot * > ResourceList
Q_CORE_EXPORT bool qUnregisterResourceData(int version, const unsigned char *tree, const unsigned char *name, const unsigned char *data)
static QString qt_resource_fixResourceRoot(QString r)
Q_CORE_EXPORT bool qRegisterResourceData(int version, const unsigned char *tree, const unsigned char *name, const unsigned char *data)