CopperSpice API
1.9.2
|
The QFSFileEngine class implements the default file engine. More...
Public Methods | |
QFSFileEngine () | |
QFSFileEngine (const QString &file) | |
~QFSFileEngine () | |
QAbstractFileEngineIterator * | beginEntryList (QDir::Filters filters, const QStringList &filterNames) override |
bool | caseSensitive () const override |
bool | close () override |
bool | copy (const QString &newName) override |
QStringList | entryList (QDir::Filters filters, const QStringList &filterNames) const override |
bool | extension (Extension extension, const ExtensionOption *option=nullptr, ExtensionReturn *output=nullptr) override |
FileFlags | fileFlags (FileFlags type) const override |
QString | fileName (FileName file) const override |
QDateTime | fileTime (FileTime time) const override |
bool | flush () override |
int | handle () const override |
bool | isRelativePath () const override |
bool | isSequential () const override |
bool | link (const QString &newName) override |
bool | mkdir (const QString &dirName, bool createParentDirectories) const override |
bool | open (QIODevice::OpenMode openMode) override |
bool | open (QIODevice::OpenMode openMode, FILE *fh) |
bool | open (QIODevice::OpenMode openMode, FILE *fh, QFile::FileHandleFlags handleFlags) |
bool | open (QIODevice::OpenMode openMode, int fd) |
bool | open (QIODevice::OpenMode openMode, int fd, QFile::FileHandleFlags handleFlags) |
QString | owner (FileOwner own) const override |
uint | ownerId (FileOwner own) const override |
qint64 | pos () const override |
qint64 | read (char *data, qint64 maxlen) override |
qint64 | readLine (char *data, qint64 maxlen) override |
bool | remove () override |
bool | rename (const QString &newName) override |
bool | renameOverwrite (const QString &newName) override |
bool | rmdir (const QString &dirName, bool recurseParentDirectories) const override |
bool | seek (qint64 pos) override |
void | setFileName (const QString &file) override |
bool | setPermissions (uint perms) override |
bool | setSize (qint64 size) override |
qint64 | size () const override |
bool | supportsExtension (Extension extension) const override |
bool | syncToDisk () override |
qint64 | write (const char *data, qint64 len) override |
Public Methods inherited from QAbstractFileEngine | |
virtual | ~QAbstractFileEngine () |
bool | atEnd () const |
QFile::FileError | error () const |
QString | errorString () const |
virtual bool | extension (Extension extension, const ExtensionOption *option=nullptr, ExtensionReturn *output=nullptr) |
uchar * | map (qint64 offset, qint64 size, QFile::MemoryMapFlags flags) |
bool | unmap (uchar *address) |
Static Public Methods | |
static QString | currentPath (const QString &path=QString ()) |
static QFileInfoList | drives () |
static QString | homePath () |
static QString | rootPath () |
static bool | setCurrentPath (const QString &path) |
static QString | tempPath () |
Static Public Methods inherited from QAbstractFileEngine | |
static QAbstractFileEngine * | create (const QString &fileName) |
Additional Inherited Members | |
Public Typedefs inherited from QAbstractFileEngine | |
using | FileFlags = QFlags< FileFlag > |
Public Types inherited from QAbstractFileEngine | |
enum | Extension |
enum | FileFlag |
enum | FileName |
enum | FileOwner |
enum | FileTime |
Protected Methods inherited from QAbstractFileEngine | |
QAbstractFileEngine () | |
void | setError (QFile::FileError error, const QString &errorString) |
The QFSFileEngine class implements the default file engine. If you only want to access files or directories, use QFile, QFileInfo or QDir instead. This class is the default file engine for accessing regular files. By inheriting from this class you can alter the behavior without having to write a complete QAbstractFileEngine subclass. To install your custom file engine you must also inherit from QAbstractFileEngineHandler.
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()).
QFSFileEngine::QFSFileEngine | ( | ) |
Constructs a new QFSFileEngine object.
|
explicit |
Constructs a QFSFileEngine for the file name file.
QFSFileEngine::~QFSFileEngine | ( | ) |
Destroys the object and frees any allocated resources.
|
overridevirtual |
Returns an instance of QAbstractFileEngineIterator using filters for entry filtering and filterNames for name filtering. This method is called by QDirIterator to initiate directory iteration. The caller takes ownership of the returned instance and must delete it.
Reimplemented from QAbstractFileEngine::beginEntryList()
|
overridevirtual |
Returns true for Windows and false for Unix.
Reimplemented from QAbstractFileEngine::caseSensitive()
|
overridevirtual |
Reimplemented from QAbstractFileEngine::close()
|
overridevirtual |
For windows, copy the file to file newName. Not implemented for Unix.
Reimplemented from QAbstractFileEngine::copy()
For Windows, returns the canonicalized form of the current path used by the file engine for the drive specified by path. 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:).
For Unix, returns the current working directory for the file engine.
|
static |
For Windows, returns the list of drives in the file system as a list of QFileInfo objects. Returns all drive letters.
For Unix, the list contains just the root path "/".
|
overridevirtual |
Requests that a list of all the files matching the filters list based on the filterNames in the file engine's directory are returned. This method should return an empty list if the file engine refers to a file rather than a directory, or if the directory is unreadable or does not exist or if nothing matches the specifications.
Reimplemented from QAbstractFileEngine::entryList()
|
override |
Reimplemented from QAbstractFileEngine::extension()
Reimplemented from QAbstractFileEngine::fileFlags()
Reimplemented from QAbstractFileEngine::fileName()
Reimplemented from QAbstractFileEngine::fileTime()
|
overridevirtual |
Reimplemented from QAbstractFileEngine::flush()
|
overridevirtual |
Reimplemented from QAbstractFileEngine::handle()
|
static |
Returns the home path of the current user.
|
overridevirtual |
Reimplemented from QAbstractFileEngine::isRelativePath()
|
overridevirtual |
Reimplemented from QAbstractFileEngine::isSequential()
|
overridevirtual |
Creates a link from the file currently specified by fileName() to newName. What a link is depends on the underlying file system (be it a shortcut on Windows or a symbolic link on Unix). Returns true if successful, otherwise returns false.
Reimplemented from QAbstractFileEngine::link()
|
overridevirtual |
Reimplemented from QAbstractFileEngine::mkdir()
|
overridevirtual |
Reimplemented from QAbstractFileEngine::open()
bool QFSFileEngine::open | ( | QIODevice::OpenMode | openMode, |
FILE * | fh | ||
) |
Opens the file handle fh using the given openModee. Returns true on success, otherwise returns false.
bool QFSFileEngine::open | ( | QIODevice::OpenMode | openMode, |
FILE * | fh, | ||
QFile::FileHandleFlags | handleFlags | ||
) |
Opens the file handle fh using the givne openMode. Returns true on success, otherwise returns false. The handleFlags argument specifies whether the file handle will be closed by CopperSpice.
bool QFSFileEngine::open | ( | QIODevice::OpenMode | openMode, |
int | fd | ||
) |
Opens the file descriptor fd using the given openMode. Returns true on success, otherwise returns false.
bool QFSFileEngine::open | ( | QIODevice::OpenMode | openMode, |
int | fd, | ||
QFile::FileHandleFlags | handleFlags | ||
) |
Opens the file descriptor fd using the given openMode. Returns true on success, otherwise returns false. The handleFlags argument specifies whether the file handle will be closed by CopperSpice.
Reimplemented from QAbstractFileEngine::owner()
For Windows -2 is always returned.
On Unix systems if stat() is successful, the uid is returned if own is the owner. Otherwise the gid is returned. If stat() is unsuccessful, -2 is returned.
Reimplemented from QAbstractFileEngine::ownerId()
|
overridevirtual |
Reimplemented from QAbstractFileEngine::pos()
Reimplemented from QAbstractFileEngine::read()
Reimplemented from QAbstractFileEngine::readLine()
|
overridevirtual |
Reimplemented from QAbstractFileEngine::remove()
|
overridevirtual |
Reimplemented from QAbstractFileEngine::rename()
|
overridevirtual |
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 the method returns true, otherwise returns false.
Reimplemented from QAbstractFileEngine::renameOverwrite()
|
overridevirtual |
Reimplemented from QAbstractFileEngine::rmdir()
|
static |
Returns the root path.
|
overridevirtual |
Reimplemented from QAbstractFileEngine::seek()
|
static |
Sets the current path to path. Returns true if the new path exists, otherwise this method does nothing and returns false.
|
overridevirtual |
Reimplemented from QAbstractFileEngine::setFileName()
|
overridevirtual |
Reimplemented from QAbstractFileEngine::setPermissions()
|
overridevirtual |
Reimplemented from QAbstractFileEngine::setSize()
|
overridevirtual |
Reimplemented from QAbstractFileEngine::size()
|
overridevirtual |
Reimplemented from QAbstractFileEngine::supportsExtension()
|
overridevirtual |
Flushes and syncs the file to disk. Returns true if successful, otherwise returns false. The default implementation always returns false.
Reimplemented from QAbstractFileEngine::syncToDisk()
|
static |
Returns the temporary path (i.e., a path in which it is safe to store temporary files).
Reimplemented from QAbstractFileEngine::write()