4#include "private/qabstractfileengine_p.h"
5#include "private/qfsfileengine_p.h"
6#ifdef QT_BUILD_CORE_LIB
7#include "private/qresource_p.h"
16#include <QtCore/private/qfilesystementry_p.h>
17#include <QtCore/private/qfilesystemmetadata_p.h>
18#include <QtCore/private/qfilesystemengine_p.h>
26 if (!
path.isEmpty() && !
path.endsWith(u
'/')
28 && !
path.startsWith(
"content:/"_L1)
116 fileEngineHandlers()->prepend(
this);
188#ifndef QT_NO_FSFILEENGINE
190 engine = std::make_unique<QFSFileEngine>(
entry.filePath());
357 std::optional<QFile::Permissions> permissions)
521 std::optional<QFile::Permissions> permissions)
const
595#ifdef QT_BOOTSTRAPPED
598 Q_UNREACHABLE_RETURN(
ret);
601 ret.emplace_back(dirEntry.fileName());
900 m_nameFilters(nameFilters),
933 return m_nameFilters;
1053 while (readSoFar < maxlen) {
1056 if (readResult <= 0)
1057 return (readSoFar > 0) ? readSoFar : -1;
1170 return d->fileError;
1183 return d->errorString;
~QAbstractFileEngineHandlerList()
QAbstractFileEngineHandlerList()=default
\inmodule QtCore \reentrant
virtual ~QAbstractFileEngineHandler()
Destroys the file handler.
virtual ~QAbstractFileEngineIterator()
Destroys the QAbstractFileEngineIterator.
QDir::Filters filters() const
Returns the entry filters for this iterator.
virtual QString currentFileName() const =0
This pure virtual function returns the name of the current directory entry, excluding the path.
QAbstractFileEngineIterator(const QString &path, QDir::Filters filters, const QStringList &nameFilters)
Constructs a QAbstractFileEngineIterator, using the entry filters filters, and wildcard name filters ...
QString path() const
Returns the path for this iterator.
QStringList nameFilters() const
Returns the name filters for this iterator.
virtual QFileInfo currentFileInfo() const
The virtual function returns a QFileInfo for the current directory entry.
virtual QString currentFilePath() const
Returns the path to the current directory entry.
QAbstractFileEngine * q_ptr
\inmodule QtCore \reentrant
virtual bool remove()
Requests that the file is deleted from the file system.
virtual bool renameOverwrite(const QString &newName)
QScopedPointer< QAbstractFileEnginePrivate > d_ptr
FileOwner
\value OwnerUser The user who owns the file.
virtual bool supportsExtension(Extension extension) const
virtual ~QAbstractFileEngine()
Destroys the QAbstractFileEngine.
virtual bool copy(const QString &newName)
Copies the contents of this file to a file with the name newName.
virtual bool setPermissions(uint perms)
Requests that the file's permissions be set to perms.
virtual bool isRelativePath() const
Return true if the file referred to by this file engine has a relative path; otherwise return false.
virtual void setFileName(const QString &file)
Sets the file engine's file name to file.
virtual bool rmdir(const QString &dirName, bool recurseParentDirectories) const
Requests that the directory dirName is deleted from the file system.
virtual bool close()
Closes the file, returning true if successful; otherwise returns false.
virtual qint64 write(const char *data, qint64 len)
Writes len bytes from data to the file.
virtual int handle() const
Returns the native file handle for this file engine.
static std::unique_ptr< QAbstractFileEngine > create(const QString &fileName)
Creates and returns a QAbstractFileEngine suitable for processing fileName.
virtual bool flush()
Flushes the open file, returning true if successful; otherwise returns false.
QAbstractFileEngine()
Constructs a new QAbstractFileEngine that does not refer to any file or directory.
virtual bool seek(qint64 pos)
Sets the file position to the given offset.
virtual bool mkdir(const QString &dirName, bool createParentDirectories, std::optional< QFile::Permissions > permissions=std::nullopt) const
Requests that the directory dirName be created with the specified permissions.
virtual qint64 readLine(char *data, qint64 maxlen)
This function reads one line, terminated by a '\n' character, from the file info data.
virtual qint64 read(char *data, qint64 maxlen)
Reads a number of characters from the file into data.
virtual bool rename(const QString &newName)
Requests that the file be renamed to newName in the file system.
virtual bool link(const QString &newName)
Creates a link from the file currently specified by fileName() to newName.
virtual bool cloneTo(QAbstractFileEngine *target)
void setError(QFile::FileError error, const QString &str)
Sets the error type to error, and the error string to errorString.
virtual qint64 size() const
Returns the size of the file.
virtual uint ownerId(FileOwner) const
If owner is OwnerUser return the ID of the user who owns the file.
virtual bool setFileTime(const QDateTime &newDate, QFile::FileTime time)
virtual QStringList entryList(QDir::Filters filters, const QStringList &filterNames) const
Requests that a list of all the files matching the filters list based on the filterNames in the file ...
uchar * map(qint64 offset, qint64 size, QFile::MemoryMapFlags flags)
std::unique_ptr< Iterator > IteratorUniquePtr
virtual IteratorUniquePtr beginEntryList(const QString &path, QDir::Filters filters, const QStringList &filterNames)
Returns a QAbstractFileEngine::IteratorUniquePtr, that can be used to iterate over the entries in pat...
virtual QString fileName(FileName file=DefaultName) const
Return the file engine's current file name in the format specified by file.
virtual bool isSequential() const
Returns true if the file is a sequential access device; returns false if the file is a direct access ...
virtual QByteArray id() const
virtual FileFlags fileFlags(FileFlags type=FileInfoAll) const
This function should return the set of OR'd flags that are true for the file engine's file,...
virtual QDateTime fileTime(QFile::FileTime time) const
If time is BirthTime, return when the file was born (created).
FileName
These values are used to request a file name in a particular format.
virtual bool extension(Extension extension, const ExtensionOption *option=nullptr, ExtensionReturn *output=nullptr)
virtual qint64 pos() const
Returns the current file position.
virtual bool syncToDisk()
virtual QString owner(FileOwner) const
If owner is OwnerUser return the name of the user who owns the file.
QFile::FileError error() const
Returns the QFile::FileError that resulted from the last failed operation.
virtual bool caseSensitive() const
Should return true if the underlying file system is case-sensitive; otherwise return false.
virtual bool setSize(qint64 size)
Requests that the file be set to size size.
QString errorString() const
Returns the human-readable message appropriate to the current error reported by error().
virtual bool open(QIODevice::OpenMode openMode, std::optional< QFile::Permissions > permissions=std::nullopt)
Opens the file in the specified mode.
\inmodule QtCore\reentrant
The QDirListing class provides an STL-style iterator for directory entries.
FileError
This enum describes the errors that may be returned by the error() function.
void setFile(const QString &file)
QString filePath() const
Returns the path of the file system entry this QFileInfo refers to; the path may be absolute or relat...
static std::unique_ptr< QAbstractFileEngine > createLegacyEngine(QFileSystemEntry &entry, QFileSystemMetaData &data)
bool isEmpty() const noexcept
bool removeOne(const AT &t)
\macro QT_RESTRICTED_CAST_FROM_ASCII
Combined button and popup list for selecting options.
static Q_CONSTINIT QBasicAtomicInt qt_file_engine_handlers_in_use
std::unique_ptr< QAbstractFileEngine > qt_custom_file_engine_handler_create(const QString &path)
static QString appendSlashIfNeeded(const QString &path)
static Q_CONSTINIT bool qt_abstractfileenginehandlerlist_shutDown
#define Q_BASIC_ATOMIC_INITIALIZER(a)
DBusConnection const char DBusError * error
typedef QByteArray(EGLAPIENTRYP PFNQGSGETDISPLAYSPROC)()
#define Q_GLOBAL_STATIC(TYPE, NAME,...)
GLenum GLuint GLintptr GLsizeiptr size
[1]
GLint GLsizei GLsizei GLenum GLenum GLsizei void * data
GLenum GLuint GLintptr offset
GLuint GLuint64EXT address
GLsizei const GLchar *const * path
QT_BEGIN_NAMESPACE typedef uchar * output
const QStringList filters({"Image files (*.png *.xpm *.jpg)", "Text files (*.txt)", "Any files (*)" })
[6]