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();
73class DocumentFile :
public std::enable_shared_from_this<DocumentFile>
std::shared_ptr< class DocumentFile > DocumentFilePtr
~AndroidContentFileEngineHandler()
AndroidContentFileEngineHandler()
QString next() override
This pure virtual function advances the iterator to the next directory entry, and returns the file pa...
~AndroidContentFileEngineIterator()
QString currentFilePath() const override
Returns the path to the current directory entry.
bool hasNext() const override
This pure virtual function returns true if there is at least one more entry in the current directory ...
QString currentFileName() const override
This pure virtual function returns the name of the current directory entry, excluding the path.
QDateTime fileTime(FileTime time) const override
If time is BirthTime, return when the file was born (created).
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.
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,...
QAbstractFileEngine::Iterator * beginEntryList(QDir::Filters filters, const QStringList &filterNames) override
Returns an instance of a QAbstractFileEngineIterator using filters for entry filtering and filterName...
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.
QAbstractFileEngine::Iterator * endEntryList() override
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)
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.
\inmodule QtCore \reentrant
FileTime
These are used by the fileTime() function.
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)
const QStringList filters({"Image files (*.png *.xpm *.jpg)", "Text files (*.txt)", "Any files (*)" })
[6]