4#ifndef ANDROIDCONTENTFILEENGINE_H
5#define ANDROIDCONTENTFILEENGINE_H
7#include <private/qfsfileengine_p.h>
9#include <QtCore/qjniobject.h>
10#include <QtCore/qlist.h>
20 bool open(QIODevice::OpenMode openMode, std::optional<QFile::Permissions> permissions)
override;
21 bool close()
override;
25 bool mkdir(
const QString &dirName,
bool createParentDirectories,
26 std::optional<QFile::Permissions> permissions = std::nullopt)
const override;
27 bool rmdir(
const QString &dirName,
bool recurseParentDirectories)
const override;
37 void closeNativeFileDescriptor();
65 mutable QList<DocumentFilePtr> m_files;
76class DocumentFile :
public std::enable_shared_from_this<DocumentFile>
std::shared_ptr< class DocumentFile > DocumentFilePtr
~AndroidContentFileEngineHandler()
AndroidContentFileEngineHandler()
bool advance() override
This pure virtual function advances the iterator to the next directory entry; if the operation was su...
~AndroidContentFileEngineIterator()
QString currentFilePath() const override
Returns the path to the current directory entry.
AndroidContentFileEngineIterator(const QString &path, QDir::Filters filters, const QStringList &filterNames)
QString currentFileName() const override
This pure virtual function returns the name of the current directory entry, excluding the path.
QByteArray id() const override
qint64 size() const override
Returns the size of the file.
bool mkdir(const QString &dirName, bool createParentDirectories, std::optional< QFile::Permissions > permissions=std::nullopt) const override
Requests that the directory dirName be created with the specified permissions.
bool caseSensitive() const override
Should return true if the underlying file system is case-sensitive; otherwise return false.
IteratorUniquePtr beginEntryList(const QString &path, QDir::Filters filters, const QStringList &filterNames) override
Returns a QAbstractFileEngine::IteratorUniquePtr, that can be used to iterate over the entries in pat...
FileFlags fileFlags(FileFlags type=FileInfoAll) const override
This function should return the set of OR'd flags that are true for the file engine's file,...
QDateTime fileTime(QFile::FileTime time) const override
If time is BirthTime, return when the file was born (created).
bool rmdir(const QString &dirName, bool recurseParentDirectories) const override
Requests that the directory dirName is deleted from the file system.
bool close() override
Closes the file, returning true if successful; otherwise returns false.
AndroidContentFileEngine(const QString &fileName)
bool rename(const QString &newName) override
Requests that the file be renamed to newName in the file system.
bool open(QIODevice::OpenMode openMode, std::optional< QFile::Permissions > permissions) override
Opens the file in the specified mode.
bool remove() override
Requests that the file is deleted from the file system.
const DocumentFilePtr & parent() const
bool rename(const QString &newName)
const QJniObject & uri() const
DocumentFilePtr createFile(const QString &mimeType, const QString &displayName)
DocumentFilePtr createDirectory(const QString &displayName)
std::vector< DocumentFilePtr > listFiles()
static DocumentFilePtr fromTreeUri(const QJniObject &treeUri)
static DocumentFilePtr fromSingleUri(const QJniObject &uri)
static DocumentFilePtr parseFromAnyUri(const QString &filename)
DocumentFile(const QJniObject &uri, const std::shared_ptr< DocumentFile > &parent)
QDateTime lastModified() const
\inmodule QtCore \reentrant
The QAbstractFileEngineIterator class provides an iterator interface for custom file engines.
QDir::Filters filters() const
Returns the entry filters for this iterator.
std::unique_ptr< Iterator > IteratorUniquePtr
FileName
These values are used to request a file name in a particular format.
\inmodule QtCore\reentrant
\macro QT_RESTRICTED_CAST_FROM_ASCII
Combined button and popup list for selecting options.
static QString displayName(CGDirectDisplayID displayID)
GLsizei const GLchar *const * path
const QStringList filters({"Image files (*.png *.xpm *.jpg)", "Text files (*.txt)", "Any files (*)" })
[6]