Qt 6.x
The Qt SDK
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
4#ifndef QIOSFILEENGINEASSETSLIBRARY_H
5#define QIOSFILEENGINEASSETSLIBRARY_H
6
7#include <QtCore/private/qabstractfileengine_p.h>
8
10
12
13class QIOSAssetData;
14
16{
17public:
20
21 bool open(QIODevice::OpenMode openMode, std::optional<QFile::Permissions> permissions) override;
22 bool close() override;
23 FileFlags fileFlags(FileFlags type) const override;
24 qint64 size() const override;
25 qint64 read(char *data, qint64 maxlen) override;
26 qint64 pos() const override;
27 bool seek(qint64 pos) override;
28 QString fileName(FileName file) const override;
29 void setFileName(const QString &file) override;
30
31#ifndef QT_NO_FILESYSTEMITERATOR
32 Iterator *beginEntryList(QDir::Filters filters, const QStringList &filterNames) override;
33 Iterator *endEntryList() override;
34#endif
35
37
38private:
39 QString m_fileName;
40 QString m_assetUrl;
41 qint64 m_offset;
42 mutable QIOSAssetData *m_data;
43
44 ALAsset *loadAsset() const;
45};
46
48
49#endif // QIOSFILEENGINEASSETSLIBRARY_H
50
The QAbstractFileEngineIterator class provides an iterator interface for custom file engines.
\inmodule QtCore \reentrant
void setError(QFile::FileError error, const QString &str)
Sets the error type to error, and the error string to errorString.
FileName
These values are used to request a file name in a particular format.
QFile::FileError error() const
Returns the QFile::FileError that resulted from the last failed operation.
FileError
This enum describes the errors that may be returned by the error() function.
Definition qfiledevice.h:23
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.
Iterator * beginEntryList(QDir::Filters filters, const QStringList &filterNames) override
Returns an instance of a QAbstractFileEngineIterator using filters for entry filtering and filterName...
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.
bool close() override
Closes the file, returning true if successful; otherwise returns false.
\inmodule QtCore
\macro QT_RESTRICTED_CAST_FROM_ASCII
Definition qstring.h:127
QString str
[2]
Combined button and popup list for selecting options.
#define Q_FORWARD_DECLARE_OBJC_CLASS(classname)
GLenum type
GLint GLsizei GLsizei GLenum GLenum GLsizei void * data
long long qint64
Definition qtypes.h:55
QFile file
[0]
const QStringList filters({"Image files (*.png *.xpm *.jpg)", "Text files (*.txt)", "Any files (*)" })
[6]