diff options
author | kh1 <karsten.heimrich@digia.com> | 2014-10-14 17:03:54 +0200 |
---|---|---|
committer | Karsten Heimrich <karsten.heimrich@digia.com> | 2014-10-15 17:10:18 +0200 |
commit | 84875396b75f5615afa637f9633d19bbc79e08e0 (patch) | |
tree | 012fe931425ae267361a608c0c63e0d05e4ee03e /src/libs/installer/binaryformatengine.cpp | |
parent | ec92e19193eb9d69a3cf18979d6434cf04764902 (diff) |
Overhaul the binary format API.
Adjust some naming. Add documentation. Make the Resource class
handle files only, this is sufficient to read and map inbuild
resources. Keep the QResources inside the manager as well, no
need to handle them separate. Remove read, write functions from
collection class, the API was just unclear how to use. Still it
is far from intuitive in the manager class either. If we open a
Resource, we need to close it on our own case they are pointers.
Change-Id: Ic8aa32a84a15ac774fe1194ba0dbb5733f7216d6
Reviewed-by: Leena Miettinen <riitta-leena.miettinen@digia.com>
Reviewed-by: Kai Koehne <kai.koehne@theqtcompany.com>
Diffstat (limited to 'src/libs/installer/binaryformatengine.cpp')
-rw-r--r-- | src/libs/installer/binaryformatengine.cpp | 34 |
1 files changed, 21 insertions, 13 deletions
diff --git a/src/libs/installer/binaryformatengine.cpp b/src/libs/installer/binaryformatengine.cpp index d493018ea..d9645c2fe 100644 --- a/src/libs/installer/binaryformatengine.cpp +++ b/src/libs/installer/binaryformatengine.cpp @@ -80,6 +80,13 @@ private: namespace QInstaller { +/*! + \class QInstaller::BinaryFormatEngine + \inmodule QtInstallerFramework + \brief The BinaryFormatEngine class is the default file engine for accessing resource + collections and resource files. +*/ + BinaryFormatEngine::BinaryFormatEngine(const QHash<QByteArray, ResourceCollection> &collections, const QString &fileName) : m_resource(0) @@ -89,7 +96,7 @@ BinaryFormatEngine::BinaryFormatEngine(const QHash<QByteArray, ResourceCollectio } /*! - \reimp + \internal */ void BinaryFormatEngine::setFileName(const QString &file) { @@ -110,7 +117,7 @@ void BinaryFormatEngine::setFileName(const QString &file) } /*! - \reimp + \internal */ bool BinaryFormatEngine::close() { @@ -123,15 +130,16 @@ bool BinaryFormatEngine::close() } /*! - \reimp + \internal */ -bool BinaryFormatEngine::open(QIODevice::OpenMode /*mode*/) +bool BinaryFormatEngine::open(QIODevice::OpenMode mode) { + Q_UNUSED(mode) return m_resource.isNull() ? false : m_resource->open(); } /*! - \reimp + \internal */ qint64 BinaryFormatEngine::pos() const { @@ -139,7 +147,7 @@ qint64 BinaryFormatEngine::pos() const } /*! - \reimp + \internal */ qint64 BinaryFormatEngine::read(char *data, qint64 maxlen) { @@ -147,7 +155,7 @@ qint64 BinaryFormatEngine::read(char *data, qint64 maxlen) } /*! - \reimp + \internal */ bool BinaryFormatEngine::seek(qint64 offset) { @@ -155,7 +163,7 @@ bool BinaryFormatEngine::seek(qint64 offset) } /*! - \reimp + \internal */ QString BinaryFormatEngine::fileName(FileName file) const { @@ -177,7 +185,7 @@ QString BinaryFormatEngine::fileName(FileName file) const } /*! - \reimp + \internal */ bool BinaryFormatEngine::copy(const QString &newName) { @@ -213,7 +221,7 @@ bool BinaryFormatEngine::copy(const QString &newName) } /*! - \reimp + \internal */ QAbstractFileEngine::FileFlags BinaryFormatEngine::fileFlags(FileFlags type) const { @@ -231,7 +239,7 @@ QAbstractFileEngine::FileFlags BinaryFormatEngine::fileFlags(FileFlags type) con } /*! - \reimp + \internal */ QAbstractFileEngineIterator *BinaryFormatEngine::beginEntryList(QDir::Filters filters, const QStringList &filterNames) { @@ -240,7 +248,7 @@ QAbstractFileEngineIterator *BinaryFormatEngine::beginEntryList(QDir::Filters fi } /*! - \reimp + \internal */ QStringList BinaryFormatEngine::entryList(QDir::Filters filters, const QStringList &filterNames) const { @@ -280,7 +288,7 @@ QStringList BinaryFormatEngine::entryList(QDir::Filters filters, const QStringLi } /*! - \reimp + \internal */ qint64 BinaryFormatEngine::size() const { |