![]() |
CopperSpice API
2.0.0
|
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 (QFileDevice::FileTimeType type) 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 | setFileTime (const QDateTime &newTime, QFileDevice::FileTimeType type) 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 |
![]() | |
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 QAbstractFileEngine * | create (const QString &fileName) |
Additional Inherited Members | |
![]() | |
using | FileFlags = QFlags< FileFlag > |
![]() | |
enum | Extension |
enum | FileFlag |
enum | FileName |
enum | FileOwner |
![]() | |
QAbstractFileEngine () | |
void | setError (QFile::FileError error, const QString &errorString) |
To create a new file engine inherit from QFSFileEngine. You will also need to create a new class which inherits from QAbstractFileEngineHandler. Most applications which access files and directories can normally use QFile, QFileInfo or QDir. Inheriting from this class is only required to extend functionality.
QFSFileEngine::QFSFileEngine | ( | ) |
Constructs a new QFSFileEngine.
|
explicit |
Constructs a new QFSFileEngine for the given file.
QFSFileEngine::~QFSFileEngine | ( | ) |
Destroys the QFSFileEngine and frees any allocated resources.
|
overridevirtual |
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, copies the QFSFileEngine file to newName. This method is 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 path. Each drive has its own current directory so a different path is returned for file names which are on different drives.
For Unix, returns the current working directory for this file engine.
|
static |
For Windows, returns a list of all drive letters in the file system. For Unix, the list contains the root path "/".
|
overridevirtual |
Reimplemented from QAbstractFileEngine::entryList()
|
override |
Reimplemented from QAbstractFileEngine::extension()
Reimplemented from QAbstractFileEngine::fileFlags()
Reimplemented from QAbstractFileEngine::fileName()
|
overridevirtual |
Reimplemented from QAbstractFileEngine::fileTime()
|
overridevirtual |
Reimplemented from QAbstractFileEngine::flush()
|
overridevirtual |
Reimplemented from QAbstractFileEngine::handle()
|
static |
Returns the home path for the current user.
|
overridevirtual |
Reimplemented from QAbstractFileEngine::isRelativePath()
|
overridevirtual |
Reimplemented from QAbstractFileEngine::isSequential()
|
overridevirtual |
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 openMode. 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 given 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 calling stat() is successful the uid is returned if the value for 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 |
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::setFileTime()
|
overridevirtual |
Reimplemented from QAbstractFileEngine::setPermissions()
|
overridevirtual |
Reimplemented from QAbstractFileEngine::setSize()
|
overridevirtual |
Reimplemented from QAbstractFileEngine::size()
|
overridevirtual |
Reimplemented from QAbstractFileEngine::supportsExtension()
|
overridevirtual |
Reimplemented from QAbstractFileEngine::syncToDisk()
|
static |
Returns the temporary path. This is a location where it is safe to store temporary files.
Reimplemented from QAbstractFileEngine::write()