return &data[fileNameLength];
}
-quint64 QQmlBundle::FileEntry::fileSize() const
+quint32 QQmlBundle::FileEntry::fileSize() const
{
return size - (sizeof(FileEntry) + fileNameLength);
}
//
// find a some empty space we can use to insert new entries.
//
-const QQmlBundle::Entry *QQmlBundle::findInsertPoint(quint64 size, qint64 *offset)
+const QQmlBundle::Entry *QQmlBundle::findInsertPoint(quint32 size, qint32 *offset)
{
const char *ptr = (const char *) buffer + qmlBundleHeaderLength;
const char *end = (const char *) buffer + bufferSize;
file.seek(file.size());
FileEntry cmd;
- const quint64 inputFileSize = inputFile.size();
+ const quint32 inputFileSize = inputFile.size();
cmd.kind = Entry::File;
cmd.link = 0;
FileEntry cmd;
- const quint64 inputFileSize = data.size();
+ const quint32 inputFileSize = data.size();
cmd.kind = Entry::Link;
cmd.link = fileEntry->link;
{
Q_DISABLE_COPY(QQmlBundle)
public:
- struct Q_PACKED Q_QML_PRIVATE_EXPORT Entry
+ struct Q_QML_PRIVATE_EXPORT Entry
{
enum Kind {
File = 123, // Normal file
};
int kind;
- quint64 size;
+ quint32 size;
};
- struct Q_PACKED Q_QML_PRIVATE_EXPORT RawEntry : public Entry
+ struct Q_QML_PRIVATE_EXPORT RawEntry : public Entry
{
char data[]; // trailing data
};
- struct Q_PACKED Q_QML_PRIVATE_EXPORT FileEntry : public Entry
+ struct Q_QML_PRIVATE_EXPORT FileEntry : public Entry
{
- quint64 link;
+ quint32 link;
int fileNameLength;
char data[]; // trailing data
QString fileName() const;
bool isFileName(const QString &) const;
- quint64 fileSize() const;
+ quint32 fileSize() const;
const char *contents() const;
};
static int bundleHeaderLength();
static bool isBundleHeader(const char *, int size);
private:
- const Entry *findInsertPoint(quint64 size, qint64 *offset);
+ const Entry *findInsertPoint(quint32 size, qint32 *offset);
private:
QFile file;
uchar *buffer;
- quint64 bufferSize;
+ quint32 bufferSize;
bool opened:1;
bool headerWritten:1;
};