summaryrefslogtreecommitdiffstats
path: root/tools/binarycreator/binarycreator.cpp
diff options
context:
space:
mode:
authorkh1 <karsten.heimrich@digia.com>2014-07-28 14:41:28 +0200
committerKarsten Heimrich <karsten.heimrich@digia.com>2014-08-27 10:44:00 +0200
commit2312e7fd59cc75aad51ef526a33982fda1ecb4fd (patch)
treec6079fb0095612b0e11bc8da66b66d0a0dae1ac8 /tools/binarycreator/binarycreator.cpp
parent492a66ad56610d81c86fae6d70d90dd0fbaf01f0 (diff)
Rename binary format classes and functions. Move to QInstaller.
Adjust some minor implementation details. Some renaming of member variables and function names is left out but will follow in later patches. Add some documentation. Change-Id: I929dcbe13fa701be5224b9e5fdf8d19bfff81235 Reviewed-by: Kai Koehne <kai.koehne@digia.com> Reviewed-by: Niels Weber <niels.weber@digia.com>
Diffstat (limited to 'tools/binarycreator/binarycreator.cpp')
-rw-r--r--tools/binarycreator/binarycreator.cpp38
1 files changed, 16 insertions, 22 deletions
diff --git a/tools/binarycreator/binarycreator.cpp b/tools/binarycreator/binarycreator.cpp
index 9263d13d0..c82d48b73 100644
--- a/tools/binarycreator/binarycreator.cpp
+++ b/tools/binarycreator/binarycreator.cpp
@@ -61,18 +61,17 @@
#include <iostream>
using namespace QInstaller;
-using namespace QInstallerCreator;
struct Input {
QString outputPath;
QString installerExePath;
- ComponentIndex componentIndex;
+ ResourceCollectionManager collectionManager;
QString binaryResourcePath;
QStringList binaryResources;
Range<qint64> operationsPos;
QVector<Range<qint64> > resourcePos;
- Range<qint64> componentIndexSegment;
+ Range<qint64> resourceCollectionsSegment;
};
class BundleBackup
@@ -315,18 +314,13 @@ static int assemble(Input input, const QInstaller::Settings &settings)
input.operationsPos = Range<qint64>::fromStartAndEnd(operationsStart, out.pos())
.moved(-dataBlockStart);
- // write out every components data
- input.componentIndex.writeComponentData(&out, -dataBlockStart);
- const qint64 compIndexStart = out.pos() - dataBlockStart;
-
- // write out the component index
- input.componentIndex.writeIndex(&out, -dataBlockStart);
- input.componentIndexSegment = Range<qint64>::fromStartAndEnd(compIndexStart, out.pos()
- - dataBlockStart);
+ // write out every resource collections data and index
+ input.resourceCollectionsSegment = input.collectionManager.write(&out, -dataBlockStart)
+ .moved(-dataBlockStart);
- qDebug("Component index: [%llu:%llu]", input.componentIndexSegment.start(),
- input.componentIndexSegment.end());
- QInstaller::appendInt64Range(&out, input.componentIndexSegment);
+ qDebug("Resource collections segment index: [%llu:%llu]", input.resourceCollectionsSegment
+ .start(), input.resourceCollectionsSegment.end());
+ QInstaller::appendInt64Range(&out, input.resourceCollectionsSegment);
foreach (const Range<qint64> &range, input.resourcePos)
QInstaller::appendInt64Range(&out, range);
QInstaller::appendInt64Range(&out, input.operationsPos);
@@ -765,17 +759,17 @@ int main(int argc, char **argv)
// now put the packages into the components section of the binary
foreach (const QInstallerTools::PackageInfo &info, packages) {
- Component comp;
- comp.setName(info.name.toUtf8());
+ ResourceCollection collection;
+ collection.setName(info.name.toUtf8());
qDebug() << "Creating component info for" << info.name;
- foreach (const QString &archive, info.copiedFiles) {
- const QSharedPointer<Archive> arch(new Archive(archive));
- qDebug() << QString::fromLatin1("Appending %1 (%2)").arg(archive,
- humanReadableSize(arch->size()));
- comp.appendArchive(arch);
+ foreach (const QString &file, info.copiedFiles) {
+ const QSharedPointer<Resource> resource(new Resource(file));
+ qDebug() << QString::fromLatin1("Appending %1 (%2)").arg(file,
+ humanReadableSize(resource->size()));
+ collection.appendResource(resource);
}
- input.componentIndex.insertComponent(comp);
+ input.collectionManager.insertCollection(collection);
}
qDebug() << "Creating the binary";