43 #include "private/qabstractfileengine_p.h" 44 #ifdef QT_BUILD_CORE_LIB 45 #include "private/qresource_p.h" 55 #include <QtCore/private/qfilesystementry_p.h> 56 #include <QtCore/private/qfilesystemmetadata_p.h> 57 #include <QtCore/private/qfilesystemengine_p.h> 140 fileEngineHandlers()->prepend(
this);
173 for (
int i = 0; i < handlers->
size(); i++) {
174 if ((engine = handlers->
at(i)->
create(path)))
214 #ifndef QT_NO_FSFILEENGINE 806 option.
flags = flags;
1145 while (readSoFar < maxlen) {
1147 qint64 readResult = read(&c, 1);
1148 if (readResult <= 0)
1149 return (readSoFar > 0) ? readSoFar : -1;
1275 return d->fileError;
1288 return d->errorString;
The QVariant class acts like a union for the most common Qt data types.
void setError(QFile::FileError error, const QString &str)
Sets the error type to error, and the error string to errorString.
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...
QString path() const
Returns the path for this iterator.
virtual bool copy(const QString &newName)
Copies the contents of this file to a file with the name newName.
virtual bool open(QIODevice::OpenMode openMode)
Opens the file in the specified mode.
virtual bool setSize(qint64 size)
Requests that the file be set to size size.
#define QT_END_NAMESPACE
This macro expands to.
virtual ~QAbstractFileEngine()
Destroys the QAbstractFileEngine.
bool hasNext() const
Returns true if there is at least one more entry in the directory; otherwise, false is returned...
virtual bool flush()
Flushes the open file, returning true if successful; otherwise returns false.
virtual QString fileName(FileName file=DefaultName) const
Return the file engine's current file name in the format specified by file.
#define it(className, varName)
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...
bool atEnd() const
Returns true if the current position is at the end of the file; otherwise, returns false...
virtual ~QAbstractFileEngineHandler()
Destroys the file handler.
virtual bool rmdir(const QString &dirName, bool recurseParentDirectories) const
Requests that the directory dirName is deleted from the file system.
QString & prepend(QChar c)
virtual QString owner(FileOwner) const
If owner is OwnerUser return the name of the user who owns the file.
virtual uint ownerId(FileOwner) const
If owner is OwnerUser return the ID of the user who owns the file.
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 ...
virtual bool close()
Closes the file, returning true if successful; otherwise returns false.
FileName
These values are used to request a file name in a particular format.
virtual bool remove()
Requests that the file is deleted from the file system.
The QDirIterator class provides an iterator for directory entrylists.
The QString class provides a Unicode character string.
QFile::MemoryMapFlags flags
QAbstractFileEngine * q_ptr
~QAbstractFileEngineHandlerList()
QAbstractFileEngine * qt_custom_file_engine_handler_create(const QString &path)
virtual void setFileName(const QString &file)
Sets the file engine's file name to file.
bool isEmpty() const
Returns true if the list contains no items; otherwise returns false.
provides an extended output argument to QAbstractFileEngine's extension support.
Q_GUI_EXPORT QString errorString(EGLint code=eglGetError())
bool removeOne(const T &t)
Removes the first occurrence of value in the list and returns true on success; otherwise returns fals...
QString fileName() const
Returns the file name for the current directory entry, without the path prepended.
virtual ~QAbstractFileEngineIterator()
Destroys the QAbstractFileEngineIterator.
#define QT_BEGIN_NAMESPACE
This macro expands to.
virtual bool seek(qint64 pos)
Sets the file position to the given offset.
Extension
This enum describes the types of extensions that the file engine can support.
virtual bool caseSensitive() const
Should return true if the underlying file system is case-sensitive; otherwise return false...
QScopedPointer< QAbstractFileEngineIteratorPrivate > d
bool isEmpty() const
Returns true if the string has no characters; otherwise returns false.
#define Q_GLOBAL_STATIC(TYPE, NAME)
Declares a global static variable with the given type and name.
const T & at(int i) const
Returns the item at index position i in the list.
The QStringList class provides a list of strings.
provides an extended input argument to QAbstractFileEngine's extension support.
void setFile(const QString &file)
Sets the file that the QFileInfo provides information about to file.
The QAbstractFileEngine class provides an abstraction for accessing the filesystem.
static const char * data(const QByteArray &arr)
QFile::FileError error() const
Returns the QFile::FileError that resulted from the last failed operation.
virtual bool supportsExtension(Extension extension) const
This virtual function returns true if the file engine supports extension; otherwise, false is returned.
QAbstractFileEngine()
Constructs a new QAbstractFileEngine that does not refer to any file or directory.
virtual int handle() const
Returns the native file handle for this file engine.
static QAbstractFileEngine * create(const QString &fileName)
Creates and returns a QAbstractFileEngine suitable for processing fileName.
The QReadLocker class is a convenience class that simplifies locking and unlocking read-write locks f...
bool unmap(uchar *ptr)
Unmaps the memory address.
FileTime
These are used by the fileTime() function.
The QWriteLocker class is a convenience class that simplifies locking and unlocking read-write locks ...
QDir::Filters filters() const
Returns the entry filters for this iterator.
virtual qint64 write(const char *data, qint64 len)
Writes len bytes from data to the file.
QStringList nameFilters() const
Returns the name filters for this iterator.
void setPath(const QString &path)
Sets the iterator path to path.
bool isNull() const
Returns true if this string is null; otherwise returns false.
virtual Iterator * beginEntryList(QDir::Filters filters, const QStringList &filterNames)
Returns an instance of a QAbstractFileEngineIterator using filters for entry filtering and filterName...
static const char *const filters[3]
QString & append(QChar c)
QString next()
Advances the iterator to the next entry, and returns the file path of this new entry.
virtual qint64 read(char *data, qint64 maxlen)
Reads a number of characters from the file into data.
The QDateTime class provides date and time functions.
virtual Iterator * endEntryList()
The QReadWriteLock class provides read-write locking.
QScopedPointer< QAbstractFileEnginePrivate > d_ptr
int size() const
Returns the number of items in the list.
virtual qint64 readLine(char *data, qint64 maxlen)
This function reads one line, terminated by a ' ' character, from the file info data.
QString errorString() const
Returns the human-readable message appropriate to the current error reported by error().
The QAbstractFileEngineIterator class provides an iterator interface for custom file engines...
virtual bool isSequential() const
Returns true if the file is a sequential access device; returns false if the file is a direct access ...
virtual QVariant entryInfo(EntryInfoType type) const
Returns the entry info type for this iterator's current directory entry as a QVariant.
virtual QString currentFileName() const =0
This pure virtual function returns the name of the current directory entry, excluding the path...
QString currentFilePath() const
Returns the path to the current directory entry.
virtual bool extension(Extension extension, const ExtensionOption *option=0, ExtensionReturn *output=0)
This virtual function can be reimplemented in a QAbstractFileEngine subclass to provide support for e...
uchar * map(qint64 offset, qint64 size, QFile::MemoryMapFlags flags)
Maps size bytes of the file into memory starting at offset.
virtual QDateTime fileTime(FileTime time) const
If time is CreationTime, return when the file was created.
static QAbstractFileEngine * resolveEntryAndCreateLegacyEngine(QFileSystemEntry &entry, QFileSystemMetaData &data)
Resolves the entry (see QDir::searchPaths) and returns an engine for it, but never a QFSFileEngine...
virtual bool mkdir(const QString &dirName, bool createParentDirectories) const
Requests that the directory dirName be created.
MemoryMapFlags
This enum describes special options that may be used by the map() function.
static bool qt_abstractfileenginehandlerlist_shutDown
FileError
This enum describes the errors that may be returned by the error() function.
bool endsWith(const QString &s, Qt::CaseSensitivity cs=Qt::CaseSensitive) const
Returns true if the string ends with s; otherwise returns false.
virtual qint64 pos() const
Returns the current file position.
The QFileInfo class provides system-independent file information.
QAbstractFileEngineIterator(QDir::Filters filters, const QStringList &nameFilters)
Constructs a QAbstractFileEngineIterator, using the entry filters filters, and wildcard name filters ...
QString filePath() const
Returns the file name, including the path (which may be absolute or relative).
virtual qint64 size() const
Returns the size of the file.
EntryInfoType
This enum describes the different types of information that can be requested through the QAbstractFil...
#define Q_UNUSED(x)
Indicates to the compiler that the parameter with the specified name is not used in the body of a fun...
static QString fileName(const QString &fileUrl)
virtual bool rename(const QString &newName)
Requests that the file be renamed to newName in the file system.
static bool qt_file_engine_handlers_in_use
#define Q_GLOBAL_STATIC_WITH_ARGS(TYPE, NAME, ARGS)
Declares a global static variable with the specified type and name.
The QLatin1Char class provides an 8-bit ASCII/Latin-1 character.
virtual QFileInfo currentFileInfo() const
The virtual function returns a QFileInfo for the current directory entry.
virtual bool link(const QString &newName)
Creates a link from the file currently specified by fileName() to newName.
The QAbstractFileEngineHandler class provides a way to register custom file engines with your applica...
The QList class is a template class that provides lists.
The QFSFileEngine class implements Qt's default file engine.
virtual QAbstractFileEngine * create(const QString &fileName) const =0
Creates a file engine for file fileName.