Qt
Internal/Contributor docs for the Qt SDK. Note: These are NOT official API docs; those are found at https://doc.qt.io/
Loading...
Searching...
No Matches
qiosfileengineassetslibrary.h
Go to the documentation of this file.
1// Copyright (C) 2016 The Qt Company Ltd.
2// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only
3// Qt-Security score:significant reason:default
4
5#ifndef QIOSFILEENGINEASSETSLIBRARY_H
6#define QIOSFILEENGINEASSETSLIBRARY_H
7
8#include <QtCore/private/qabstractfileengine_p.h>
9
11
12QT_BEGIN_NAMESPACE
13
14class QIOSAssetData;
15
17{
18public:
19 QIOSFileEngineAssetsLibrary(const QString &fileName);
21
22 bool open(QIODevice::OpenMode openMode, std::optional<QFile::Permissions> permissions) override;
23 bool close() override;
24 FileFlags fileFlags(FileFlags type) const override;
25 qint64 size() const override;
26 qint64 read(char *data, qint64 maxlen) override;
27 qint64 pos() const override;
28 bool seek(qint64 pos) override;
29 QString fileName(FileName file) const override;
30 void setFileName(const QString &file) override;
31
32#ifndef QT_NO_FILESYSTEMITERATOR
33 IteratorUniquePtr beginEntryList(const QString &path, QDirListing::IteratorFlags filters,
34 const QStringList &filterNames) override;
35#endif
36
37 void setError(QFile::FileError error, const QString &str) { QAbstractFileEngine::setError(error, str); }
38
39private:
40 QString m_fileName;
41 QString m_assetUrl;
42 qint64 m_offset;
43 mutable QIOSAssetData *m_data;
44
45 ALAsset *loadAsset() const;
46};
47
48QT_END_NAMESPACE
49
50#endif // QIOSFILEENGINEASSETSLIBRARY_H
QIOSAssetData(const QString &assetUrl, QIOSFileEngineAssetsLibrary *engine)
QIOSAssetEnumerator(ALAssetsLibrary *assetsLibrary, ALAssetsGroupType type)
QString fileName(FileName file) const override
Return the file engine's current file name in the format specified by file.
void setError(QFile::FileError error, const QString &str)
bool open(QIODevice::OpenMode openMode, std::optional< QFile::Permissions > permissions) override
Opens the file in the specified mode.
qint64 pos() const override
Returns the current file position.
void setFileName(const QString &file) override
Sets the file engine's file name to file.
bool seek(qint64 pos) override
Sets the file position to the given offset.
FileFlags fileFlags(FileFlags type) const override
This function should return the set of OR'd flags that are true for the file engine's file,...
qint64 read(char *data, qint64 maxlen) override
Reads a number of characters from the file into data.
qint64 size() const override
Returns the size of the file.
QIOSFileEngineAssetsLibrary(const QString &fileName)
IteratorUniquePtr beginEntryList(const QString &path, QDirListing::IteratorFlags filters, const QStringList &filterNames) override
Returns a QAbstractFileEngine::IteratorUniquePtr, that can be used to iterate over the entries in pat...
bool close() override
Closes the file, returning true if successful; otherwise returns false.
Q_FORWARD_DECLARE_OBJC_CLASS(ALAsset)
static const int kBufferSize
static QThreadStorage< QPointer< QIOSAssetData > > g_assetDataCache
static bool ensureAuthorizationDialogNotBlocked()
static ALAsset * kNoAsset
static QThreadStorage< QString > g_iteratorCurrentUrl