The QFSFileEngine class implements Qt's default file engine. More...
#include <QFSFileEngine>
Inherits: QAbstractFileEngine.
This class was introduced in Qt 4.1.
typedef | Iterator |
QFSFileEngine () | |
QFSFileEngine ( const QString & file ) | |
~QFSFileEngine () | |
bool | open ( QIODevice::OpenMode openMode, FILE * fh ) |
bool | open ( QIODevice::OpenMode openMode, int fd ) |
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 () |
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()).
Constructs a QFSFileEngine.
Constructs a QFSFileEngine for the file name file.
Destructs the QFSFileEngine.
Reimplemented from QAbstractFileEngine::caseSensitive().
Returns true for Windows, false for Unix.
Reimplemented from QAbstractFileEngine::close().
Reimplemented from QAbstractFileEngine::copy().
For windows, copy the file to file copyName.
Not implemented for Unix.
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:).
See also setCurrentPath().
For Windows, returns the list of drives in the file system as a list of QFileInfo 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 "/".
Reimplemented from QAbstractFileEngine::extension().
Reimplemented from QAbstractFileEngine::fileFlags().
Reimplemented from QAbstractFileEngine::fileName().
See also setFileName().
Reimplemented from QAbstractFileEngine::fileTime().
Reimplemented from QAbstractFileEngine::flush().
Reimplemented from QAbstractFileEngine::handle().
Returns the home path of the current user.
See also rootPath().
Reimplemented from QAbstractFileEngine::isRelativePath().
Reimplemented from QAbstractFileEngine::isSequential().
Reimplemented from QAbstractFileEngine::link().
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::mkdir().
Reimplemented from QAbstractFileEngine::open().
Opens the file handle fh in openMode mode. Returns true on success; otherwise returns false.
Opens the file descriptor fd in openMode mode. Returns true on success; otherwise returns false.
Reimplemented from QAbstractFileEngine::owner().
Reimplemented from QAbstractFileEngine::ownerId().
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::pos().
Reimplemented from QAbstractFileEngine::read().
Reimplemented from QAbstractFileEngine::readLine().
Reimplemented from QAbstractFileEngine::remove().
Reimplemented from QAbstractFileEngine::rename().
Reimplemented from QAbstractFileEngine::rmdir().
Returns the root path.
See also homePath().
Reimplemented from QAbstractFileEngine::seek().
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.
See also currentPath().
Reimplemented from QAbstractFileEngine::setFileName().
See also fileName().
Reimplemented from QAbstractFileEngine::setPermissions().
Reimplemented from QAbstractFileEngine::setSize().
See also size().
Reimplemented from QAbstractFileEngine::size().
See also setSize().
Reimplemented from QAbstractFileEngine::supportsExtension().
Returns the temporary path (i.e., a path in which it is safe to store temporary files).
Reimplemented from QAbstractFileEngine::write().
© 2008-2011 Nokia Corporation and/or its subsidiaries. Nokia, Qt and their respective logos are trademarks of Nokia Corporation in Finland and/or other countries worldwide.
All other trademarks are property of their respective owners. Privacy Policy
Licensees holding valid Qt Commercial licenses may use this document in accordance with the Qt Commercial License Agreement provided with the Software or, alternatively, in accordance with the terms contained in a written agreement between you and Nokia.
Alternatively, this document may be used under the terms of the GNU Free Documentation License version 1.3 as published by the Free Software Foundation.