
We bake cookies in your browser for a better experience. Using this site means that you consent.Read More
TheQFSFileEngine class implements Qt's default file engine.More...
| Header: | #include <QFSFileEngine> |
| Since: | Qt 4.1 |
| Inherits: | QAbstractFileEngine |
| typedef | Iterator |
| QFSFileEngine() | |
| QFSFileEngine(const QString & file) | |
| ~QFSFileEngine() | |
| bool | open(QIODevice::OpenMode openMode, FILE * fh) |
| bool | open(QIODevice::OpenMode openMode, int fd) |
| bool | open(QIODevice::OpenMode openMode, int fd, QFile::FileHandleFlags handleFlags) |
| bool | open(QIODevice::OpenMode openMode, FILE * fh, QFile::FileHandleFlags handleFlags) |
| bool | open(QIODevice::OpenMode openMode, const RFile & file, QFile::FileHandleFlags handleFlags) |
| virtual bool | caseSensitive() const |
| virtual bool | close() |
| virtual bool | copy(const QString & copyName) |
| virtual bool | extension(Extension extension, const ExtensionOption * option = 0, ExtensionReturn * output = 0) |
| virtual FileFlags | fileFlags(FileFlags type) const |
| virtual QString | fileName(FileName file) const |
| virtual QDateTime | fileTime(FileTime time) const |
| virtual bool | flush() |
| virtual int | handle() const |
| virtual bool | isRelativePath() const |
| virtual bool | isSequential() const |
| virtual bool | link(const QString & newName) |
| virtual bool | mkdir(const QString & name, bool createParentDirectories) const |
| virtual bool | open(QIODevice::OpenMode openMode) |
| virtual QString | owner(FileOwner own) const |
| virtual uint | ownerId(FileOwner own) const |
| virtual qint64 | pos() const |
| virtual qint64 | read(char * data, qint64 maxlen) |
| virtual qint64 | readLine(char * data, qint64 maxlen) |
| virtual bool | remove() |
| virtual bool | rename(const QString & newName) |
| virtual bool | rmdir(const QString & name, bool recurseParentDirectories) const |
| virtual bool | seek(qint64 pos) |
| virtual void | setFileName(const QString & file) |
| virtual bool | setPermissions(uint perms) |
| virtual bool | setSize(qint64 size) |
| virtual qint64 | size() const |
| virtual bool | supportsExtension(Extension extension) const |
| virtual qint64 | write(const char * data, qint64 len) |
| QString | currentPath(const QString & fileName = QString()) |
| QFileInfoList | drives() |
| QString | homePath() |
| QString | rootPath() |
| bool | setCurrentPath(const QString & path) |
| QString | tempPath() |
TheQFSFileEngine 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, useQFile,QFileInfo orQDir 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 completeQAbstractFileEngine subclass. To install your custom file engine, you must also subclassQAbstractFileEngineHandler and create an instance of your handler.
It can also be useful to create aQFSFileEngine object directly if you need to use the local file system insideQAbstractFileEngine::create(), in order to avoid recursion (as higher-level classes tend to callQAbstractFileEngine::create()).
Constructs aQFSFileEngine.
Constructs aQFSFileEngine for the file namefile.
Destructs theQFSFileEngine.
[virtual]bool QFSFileEngine::caseSensitive() constReimplemented fromQAbstractFileEngine::caseSensitive().
Returns true for Windows, false for Unix.
[virtual]bool QFSFileEngine::close()Reimplemented fromQAbstractFileEngine::close().
[virtual]bool QFSFileEngine::copy(constQString & copyName)Reimplemented fromQAbstractFileEngine::copy().
For windows, copy the file to filecopyName.
Not implemented for Unix.
[static]QString QFSFileEngine::currentPath(constQString & fileName = QString())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 byfileName. 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:).
See alsosetCurrentPath().
[static]QFileInfoList QFSFileEngine::drives()For Windows, returns the list of drives in the file system as a list ofQFileInfo objects. On unix, Mac OS X and Windows CE, only the root path is returned. On Windows, this function returns all drives (A:, C:, D:, etc.).
For Unix, the list contains just the root path "/".
[virtual]bool QFSFileEngine::extension(Extension extension, constExtensionOption * option = 0,ExtensionReturn * output = 0)Reimplemented fromQAbstractFileEngine::extension().
[virtual]FileFlags QFSFileEngine::fileFlags(FileFlags type) constReimplemented fromQAbstractFileEngine::fileFlags().
[virtual]QString QFSFileEngine::fileName(FileName file) constReimplemented fromQAbstractFileEngine::fileName().
See alsosetFileName().
[virtual]QDateTime QFSFileEngine::fileTime(FileTime time) constReimplemented fromQAbstractFileEngine::fileTime().
[virtual]bool QFSFileEngine::flush()Reimplemented fromQAbstractFileEngine::flush().
[virtual]int QFSFileEngine::handle() constReimplemented fromQAbstractFileEngine::handle().
[static]QString QFSFileEngine::homePath()Returns the home path of the current user.
See alsorootPath().
[virtual]bool QFSFileEngine::isRelativePath() constReimplemented fromQAbstractFileEngine::isRelativePath().
[virtual]bool QFSFileEngine::isSequential() constReimplemented fromQAbstractFileEngine::isSequential().
[virtual]bool QFSFileEngine::link(constQString & newName)Reimplemented fromQAbstractFileEngine::link().
Creates a link from the file currently specified byfileName() tonewName. 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.
[virtual]bool QFSFileEngine::mkdir(constQString & name,bool createParentDirectories) constReimplemented fromQAbstractFileEngine::mkdir().
[virtual]bool QFSFileEngine::open(QIODevice::OpenMode openMode)Reimplemented fromQAbstractFileEngine::open().
Opens the file handlefh inopenMode mode. Returns true on success; otherwise returns false.
Opens the file descriptorfd inopenMode mode. Returns true on success; otherwise returns false.
Opens the file descriptorfd inopenMode mode. Returns true on success; otherwise returns false.
ThehandleFlags argument specifies whether the file handle will be closed by Qt. See theQFile::FileHandleFlags documentation for more information.
Opens the file handlefh inopenMode mode. Returns true on success; otherwise returns false.
ThehandleFlags argument specifies whether the file handle will be closed by Qt. See theQFile::FileHandleFlags documentation for more information.
Opens the file descriptor specified byfile in the mode given byopenMode. Returns true on success; otherwise returns false.
ThehandleFlags argument specifies whether the file handle will be closed by Qt. See theQFile::FileHandleFlags documentation for more information.
[virtual]QString QFSFileEngine::owner(FileOwner own) constReimplemented fromQAbstractFileEngine::owner().
[virtual]uint QFSFileEngine::ownerId(FileOwner own) constReimplemented fromQAbstractFileEngine::ownerId().
In Unix, if stat() is successful, theuid is returned ifown is the owner. Otherwise thegid is returned. If stat() is unsuccessful, -2 is reuturned.
For Windows, -2 is always returned.
[virtual]qint64 QFSFileEngine::pos() constReimplemented fromQAbstractFileEngine::pos().
[virtual]qint64 QFSFileEngine::read(char * data,qint64 maxlen)Reimplemented fromQAbstractFileEngine::read().
[virtual]qint64 QFSFileEngine::readLine(char * data,qint64 maxlen)Reimplemented fromQAbstractFileEngine::readLine().
[virtual]bool QFSFileEngine::remove()Reimplemented fromQAbstractFileEngine::remove().
[virtual]bool QFSFileEngine::rename(constQString & newName)Reimplemented fromQAbstractFileEngine::rename().
[virtual]bool QFSFileEngine::rmdir(constQString & name,bool recurseParentDirectories) constReimplemented fromQAbstractFileEngine::rmdir().
[static]QString QFSFileEngine::rootPath()Returns the root path.
See alsohomePath().
[virtual]bool QFSFileEngine::seek(qint64 pos)Reimplemented fromQAbstractFileEngine::seek().
[static]bool QFSFileEngine::setCurrentPath(constQString & path)Sets the current path (e.g., forQDir), topath. Returns true if the new path exists; otherwise this function does nothing, and returns false.
See alsocurrentPath().
[virtual]void QFSFileEngine::setFileName(constQString & file)Reimplemented fromQAbstractFileEngine::setFileName().
See alsofileName().
[virtual]bool QFSFileEngine::setPermissions(uint perms)Reimplemented fromQAbstractFileEngine::setPermissions().
[virtual]bool QFSFileEngine::setSize(qint64 size)Reimplemented fromQAbstractFileEngine::setSize().
See alsosize().
[virtual]qint64 QFSFileEngine::size() constReimplemented fromQAbstractFileEngine::size().
See alsosetSize().
[virtual]bool QFSFileEngine::supportsExtension(Extension extension) constReimplemented fromQAbstractFileEngine::supportsExtension().
[static]QString QFSFileEngine::tempPath()Returns the temporary path (i.e., a path in which it is safe to store temporary files).
[virtual]qint64 QFSFileEngine::write(constchar * data,qint64 len)Reimplemented fromQAbstractFileEngine::write().
© 2016 The Qt Company Ltd. Documentation contributions included herein are the copyrights of their respective owners. The documentation provided herein is licensed under the terms of theGNU Free Documentation License version 1.3 as published by the Free Software Foundation. Qt and respective logos are trademarks of The Qt Company Ltd. in Finland and/or other countries worldwide. All other trademarks are property of their respective owners.