![]() |
Qt
Internal/Contributor docs for the Qt SDK. Note: These are NOT official API docs; those are found at https://doc.qt.io/
|
\inmodule QtCore More...
#include <qfsfileengine_p.h>
Public Member Functions | |
QFSFileEngine () | |
Constructs a QFSFileEngine. | |
QFSFileEngine (const QString &file) | |
Constructs a QFSFileEngine for the file name file. | |
~QFSFileEngine () | |
Destructs the QFSFileEngine. | |
bool | open (QIODevice::OpenMode openMode, std::optional< QFile::Permissions > permissions) override |
\reimp | |
bool | open (QIODevice::OpenMode flags, FILE *fh) |
Opens the file handle fh in openMode mode. | |
bool | close () override |
\reimp | |
bool | flush () override |
\reimp | |
bool | syncToDisk () override |
\reimp | |
qint64 | size () const override |
\reimp | |
qint64 | pos () const override |
\reimp | |
bool | seek (qint64) override |
\reimp | |
bool | isSequential () const override |
\reimp | |
bool | remove () override |
\reimp | |
bool | copy (const QString &newName) override |
For Windows or Apple platforms, copy the file to file copyName. | |
bool | rename (const QString &newName) override |
Requests that the file be renamed to newName in the file system. | |
bool | renameOverwrite (const QString &newName) override |
bool | link (const QString &newName) override |
Creates a link from the file currently specified by fileName() to newName. | |
bool | mkdir (const QString &dirName, bool createParentDirectories, std::optional< QFile::Permissions > permissions) const override |
\reimp | |
bool | rmdir (const QString &dirName, bool recurseParentDirectories) const override |
\reimp | |
bool | setSize (qint64 size) override |
\reimp | |
bool | caseSensitive () const override |
Returns whether the file system considers the file name to be case sensitive. | |
bool | isRelativePath () const override |
\reimp | |
FileFlags | fileFlags (FileFlags type) const override |
\reimp | |
bool | setPermissions (uint perms) override |
\reimp | |
QByteArray | id () const override |
QString | fileName (FileName file) const override |
\reimp | |
uint | ownerId (FileOwner) const override |
In Unix, if stat() is successful, the uid is returned if own is the owner. | |
QString | owner (FileOwner) const override |
\reimp | |
bool | setFileTime (const QDateTime &newDate, QFile::FileTime time) override |
\reimp | |
QDateTime | fileTime (QFile::FileTime time) const override |
\reimp | |
void | setFileName (const QString &file) override |
\reimp | |
void | setFileEntry (QFileSystemEntry &&entry) |
int | handle () const override |
\reimp | |
IteratorUniquePtr | beginEntryList (const QString &path, QDirListing::IteratorFlags filters, const QStringList &filterNames) override |
qint64 | read (char *data, qint64 maxlen) override |
\reimp | |
qint64 | readLine (char *data, qint64 maxlen) override |
\reimp | |
qint64 | write (const char *data, qint64 len) override |
\reimp | |
TriStateResult | cloneTo (QAbstractFileEngine *target) override |
\reimp | |
virtual bool | isUnnamedFile () const |
bool | extension (Extension extension, const ExtensionOption *option=nullptr, ExtensionReturn *output=nullptr) override |
\reimp | |
bool | supportsExtension (Extension extension) const override |
\reimp | |
bool | open (QIODevice::OpenMode flags, int fd) |
Opens the file descriptor fd in openMode mode. | |
bool | open (QIODevice::OpenMode flags, int fd, QFile::FileHandleFlags handleFlags) |
bool | open (QIODevice::OpenMode flags, FILE *fh, QFile::FileHandleFlags handleFlags) |
![]() | |
virtual | ~QAbstractFileEngine () |
Destroys the QAbstractFileEngine. | |
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 engine's directory are returned. | |
virtual QStringList | entryList (QDirListing::IteratorFlags filters, const QStringList &filterNames) const |
bool | atEnd () const |
uchar * | map (qint64 offset, qint64 size, QFile::MemoryMapFlags flags) |
bool | unmap (uchar *ptr) |
virtual IteratorUniquePtr | endEntryList () |
QFile::FileError | error () const |
Returns the QFile::FileError that resulted from the last failed operation. | |
QString | errorString () const |
Returns the human-readable message appropriate to the current error reported by error(). | |
Static Public Member Functions | |
static bool | setCurrentPath (const QString &path) |
Sets the current path (e.g., for QDir), to path. | |
static QString | currentPath (const QString &path=QString()) |
For Unix, returns the current working directory for the file engine. | |
static QString | homePath () |
Returns the home path of the current user. | |
static QString | rootPath () |
Returns the root path. | |
static QString | tempPath () |
Returns the temporary path (i.e., a path in which it is safe to store temporary files). | |
static QFileInfoList | drives () |
For Windows, returns the list of drives in the file system as a list of QFileInfo objects. | |
![]() | |
static std::unique_ptr< QAbstractFileEngine > | create (const QString &fileName) |
Creates and returns a QAbstractFileEngine suitable for processing fileName. | |
Protected Member Functions | |
QFSFileEngine (QFSFileEnginePrivate &dd) | |
![]() | |
void | setError (QFile::FileError error, const QString &str) |
Sets the error type to error, and the error string to errorString. | |
QAbstractFileEngine () | |
Constructs a new QAbstractFileEngine that does not refer to any file or directory. | |
QAbstractFileEngine (QAbstractFileEnginePrivate &) | |
Additional Inherited Members | |
![]() | |
enum | FileFlag { ReadOwnerPerm = 0x4000 , WriteOwnerPerm = 0x2000 , ExeOwnerPerm = 0x1000 , ReadUserPerm = 0x0400 , WriteUserPerm = 0x0200 , ExeUserPerm = 0x0100 , ReadGroupPerm = 0x0040 , WriteGroupPerm = 0x0020 , ExeGroupPerm = 0x0010 , ReadOtherPerm = 0x0004 , WriteOtherPerm = 0x0002 , ExeOtherPerm = 0x0001 , LinkType = 0x10000 , FileType = 0x20000 , DirectoryType = 0x40000 , BundleType = 0x80000 , HiddenFlag = 0x0100000 , LocalDiskFlag = 0x0200000 , ExistsFlag = 0x0400000 , RootFlag = 0x0800000 , Refresh = 0x1000000 , PermsMask = 0x0000FFFF , TypesMask = 0x000F0000 , FlagsMask = 0x0FF00000 , FileInfoAll = FlagsMask | PermsMask | TypesMask } |
The permissions and types of a file, suitable for OR'ing together. More... | |
enum | FileName { DefaultName , BaseName , PathName , AbsoluteName , AbsolutePathName , AbsoluteLinkTarget , CanonicalName , CanonicalPathName , BundleName , JunctionName , RawLinkPath , NFileNames } |
These values are used to request a file name in a particular format. More... | |
enum | FileOwner { OwnerUser , OwnerGroup } |
\value OwnerUser The user who owns the file. More... | |
enum class | TriStateResult : qint8 { NotSupported = -1 , Failed = 0 , Success = 1 } |
enum | Extension { AtEndExtension , FastReadLineExtension , MapExtension , UnMapExtension } |
typedef QAbstractFileEngineIterator | Iterator |
using | IteratorUniquePtr = std::unique_ptr<Iterator> |
![]() | |
QScopedPointer< QAbstractFileEnginePrivate > | d_ptr |
\inmodule QtCore
The QFSFileEngine class implements Qt's default file engine.
This class is part of the file engine framework in Qt. If you only want to access files or directories, use QFile, QFileInfo or QDir instead.
QFSFileEngine is the default file engine for accessing regular files. It is provided for convenience; by subclassing this class, you can alter its behavior slightly, without having to write a complete QAbstractFileEngine subclass. To install your custom file engine, you must also subclass QAbstractFileEngineHandler and create an instance of your handler.
It can also be useful to create a QFSFileEngine object directly if you need to use the local file system inside QAbstractFileEngine::create(), in order to avoid recursion (as higher-level classes tend to call QAbstractFileEngine::create()).
Definition at line 44 of file qfsfileengine_p.h.
QFSFileEngine::QFSFileEngine | ( | ) |
Constructs a QFSFileEngine.
Definition at line 121 of file qfsfileengine.cpp.
|
explicit |
Constructs a QFSFileEngine for the file name file.
Definition at line 111 of file qfsfileengine.cpp.
QFSFileEngine::~QFSFileEngine | ( | ) |
Destructs the QFSFileEngine.
Definition at line 169 of file qfsfileengine.cpp.
|
protected |
Definition at line 128 of file qfsfileengine.cpp.
|
overridevirtual |
Reimplemented from QAbstractFileEngine.
Definition at line 796 of file qfsfileengine.cpp.
|
overridevirtual |
Returns whether the file system considers the file name to be case sensitive.
Reimplemented from QAbstractFileEngine.
Definition at line 1044 of file qfsfileengine.cpp.
|
overridevirtual |
\reimp
Reimplemented from QAbstractFileEngine.
Definition at line 651 of file qfsfileengine_unix.cpp.
|
overridevirtual |
|
overridevirtual |
For Windows or Apple platforms, copy the file to file copyName.
Not implemented for other Unix platforms.
Reimplemented from QAbstractFileEngine.
Definition at line 957 of file qfsfileengine.cpp.
For Unix, returns the current working directory for the file engine.
For Windows, returns the canonicalized form of the current path used by the file engine for the drive specified by fileName. On Windows, each drive has its own current directory, so a different path is returned for file names that include different drive names (e.g. A: or C:).
Definition at line 297 of file qfsfileengine_unix.cpp.
|
static |
For Windows, returns the list of drives in the file system as a list of QFileInfo objects.
On Unix, only the root path is returned. On Windows, this function returns all drives (A:\, C:\, D:\, and so on).
For Unix, the list contains just the root path "/".
Definition at line 303 of file qfsfileengine_unix.cpp.
|
overridevirtual |
|
overridevirtual |
\reimp
Reimplemented from QAbstractFileEngine.
Definition at line 339 of file qfsfileengine_unix.cpp.
|
overridevirtual |
\reimp
Reimplemented from QAbstractFileEngine.
Definition at line 422 of file qfsfileengine_unix.cpp.
|
overridevirtual |
|
overridevirtual |
\reimp
Reimplemented from QAbstractFileEngine.
Definition at line 408 of file qfsfileengine.cpp.
Referenced by testing.tools.encode_pdf_filter._SinkPdfStream::close().
|
overridevirtual |
|
static |
Returns the home path of the current user.
Definition at line 900 of file qfsfileengine.cpp.
|
overridevirtual |
Return an identifier that (hopefully) uniquely identifies this file in the system. Returns an invalid QByteArray() if that cannot be calculated.
Reimplemented from QAbstractFileEngine.
Definition at line 414 of file qfsfileengine_unix.cpp.
|
overridevirtual |
\reimp
Reimplemented from QAbstractFileEngine.
Definition at line 463 of file qfsfileengine_unix.cpp.
|
overridevirtual |
|
inlinevirtual |
Definition at line 98 of file qfsfileengine_p.h.
|
overridevirtual |
Creates a link from the file currently specified by fileName() to newName.
What a link is depends on the underlying filesystem (be it a shortcut on Windows or a symbolic link on Unix). Returns true
if successful; otherwise returns false
.
Reimplemented from QAbstractFileEngine.
Definition at line 281 of file qfsfileengine_unix.cpp.
|
overridevirtual |
bool QFSFileEngine::open | ( | QIODevice::OpenMode | openMode, |
FILE * | fh ) |
Opens the file handle fh in openMode mode.
Returns true
on success; otherwise returns false
.
Definition at line 227 of file qfsfileengine.cpp.
bool QFSFileEngine::open | ( | QIODevice::OpenMode | flags, |
FILE * | fh, | ||
QFile::FileHandleFlags | handleFlags ) |
Definition at line 232 of file qfsfileengine.cpp.
bool QFSFileEngine::open | ( | QIODevice::OpenMode | openMode, |
int | fd ) |
Opens the file descriptor fd in openMode mode.
Returns true
on success; otherwise returns false
.
Definition at line 292 of file qfsfileengine.cpp.
bool QFSFileEngine::open | ( | QIODevice::OpenMode | flags, |
int | fd, | ||
QFile::FileHandleFlags | handleFlags ) |
Definition at line 297 of file qfsfileengine.cpp.
|
overridevirtual |
|
overridevirtual |
\reimp
Reimplemented from QAbstractFileEngine.
Definition at line 481 of file qfsfileengine_unix.cpp.
|
overridevirtual |
In Unix, if stat() is successful, the uid
is returned if own is the owner.
Otherwise the gid
is returned. If stat() is unsuccessful, -2 is reuturned.
For Windows, -2 is always returned.
Reimplemented from QAbstractFileEngine.
Definition at line 470 of file qfsfileengine_unix.cpp.
|
overridevirtual |
|
overridevirtual |
|
inlineoverridevirtual |
Requests that the file be renamed to newName in the file system.
If the operation succeeds return true; otherwise return false.
Reimplemented from QAbstractFileEngine.
Definition at line 64 of file qfsfileengine_p.h.
|
inlineoverridevirtual |
Requests that the file be renamed to newName in the file system. If the new name already exists, it must be overwritten. If the operation succeeds, returns true
; otherwise returns false.
Reimplemented from QAbstractFileEngine.
Definition at line 66 of file qfsfileengine_p.h.
|
overridevirtual |
|
static |
|
overridevirtual |
|
static |
Sets the current path (e.g., for QDir), to path.
Returns true
if the new path exists; otherwise this function does nothing, and returns false
.
Definition at line 1035 of file qfsfileengine.cpp.
void QFSFileEngine::setFileEntry | ( | QFileSystemEntry && | entry | ) |
Definition at line 986 of file qfsfileengine.cpp.
|
overridevirtual |
\reimp
Reimplemented from QAbstractFileEngine.
Definition at line 523 of file qfsfileengine_unix.cpp.
|
overridevirtual |
\reimp
Reimplemented from QAbstractFileEngine.
Definition at line 488 of file qfsfileengine_unix.cpp.
|
overridevirtual |
\reimp
Reimplemented from QAbstractFileEngine.
Definition at line 508 of file qfsfileengine_unix.cpp.
|
overridevirtual |
|
overridevirtual |
|
overridevirtual |
|
static |
Returns the temporary path (i.e., a path in which it is safe to store temporary files).
Definition at line 919 of file qfsfileengine.cpp.