Movatterモバイル変換


[0]ホーム

URL:


We bake cookies in your browser for a better experience. Using this site means that you consent.Read More

Menu

Qt Documentation

QFSFileEngine Class

TheQFSFileEngine class implements Qt's default file engine.More...

Header:#include <QFSFileEngine>
Since: Qt 4.1
Inherits:QAbstractFileEngine

Public Types

typedefIterator

Public Functions

QFSFileEngine()
QFSFileEngine(const QString & file)
~QFSFileEngine()
boolopen(QIODevice::OpenMode openMode, FILE * fh)
boolopen(QIODevice::OpenMode openMode, int fd)
boolopen(QIODevice::OpenMode openMode, int fd, QFile::FileHandleFlags handleFlags)
boolopen(QIODevice::OpenMode openMode, FILE * fh, QFile::FileHandleFlags handleFlags)
boolopen(QIODevice::OpenMode openMode, const RFile & file, QFile::FileHandleFlags handleFlags)

Reimplemented Public Functions

virtual boolcaseSensitive() const
virtual boolclose()
virtual boolcopy(const QString & copyName)
virtual boolextension(Extension extension, const ExtensionOption * option = 0, ExtensionReturn * output = 0)
virtual FileFlagsfileFlags(FileFlags type) const
virtual QStringfileName(FileName file) const
virtual QDateTimefileTime(FileTime time) const
virtual boolflush()
virtual inthandle() const
virtual boolisRelativePath() const
virtual boolisSequential() const
virtual boollink(const QString & newName)
virtual boolmkdir(const QString & name, bool createParentDirectories) const
virtual boolopen(QIODevice::OpenMode openMode)
virtual QStringowner(FileOwner own) const
virtual uintownerId(FileOwner own) const
virtual qint64pos() const
virtual qint64read(char * data, qint64 maxlen)
virtual qint64readLine(char * data, qint64 maxlen)
virtual boolremove()
virtual boolrename(const QString & newName)
virtual boolrmdir(const QString & name, bool recurseParentDirectories) const
virtual boolseek(qint64 pos)
virtual voidsetFileName(const QString & file)
virtual boolsetPermissions(uint perms)
virtual boolsetSize(qint64 size)
virtual qint64size() const
virtual boolsupportsExtension(Extension extension) const
virtual qint64write(const char * data, qint64 len)

Static Public Members

QStringcurrentPath(const QString & fileName = QString())
QFileInfoListdrives()
QStringhomePath()
QStringrootPath()
boolsetCurrentPath(const QString & path)
QStringtempPath()

Additional Inherited Members

Detailed Description

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()).

Member Function Documentation

QFSFileEngine::QFSFileEngine()

Constructs aQFSFileEngine.

QFSFileEngine::QFSFileEngine(constQString & file)

Constructs aQFSFileEngine for the file namefile.

QFSFileEngine::~QFSFileEngine()

Destructs theQFSFileEngine.

[virtual]bool QFSFileEngine::caseSensitive() const

Reimplemented 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) const

Reimplemented fromQAbstractFileEngine::fileFlags().

[virtual]QString QFSFileEngine::fileName(FileName file) const

Reimplemented fromQAbstractFileEngine::fileName().

See alsosetFileName().

[virtual]QDateTime QFSFileEngine::fileTime(FileTime time) const

Reimplemented fromQAbstractFileEngine::fileTime().

[virtual]bool QFSFileEngine::flush()

Reimplemented fromQAbstractFileEngine::flush().

[virtual]int QFSFileEngine::handle() const

Reimplemented fromQAbstractFileEngine::handle().

[static]QString QFSFileEngine::homePath()

Returns the home path of the current user.

See alsorootPath().

[virtual]bool QFSFileEngine::isRelativePath() const

Reimplemented fromQAbstractFileEngine::isRelativePath().

[virtual]bool QFSFileEngine::isSequential() const

Reimplemented 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) const

Reimplemented fromQAbstractFileEngine::mkdir().

[virtual]bool QFSFileEngine::open(QIODevice::OpenMode openMode)

Reimplemented fromQAbstractFileEngine::open().

bool QFSFileEngine::open(QIODevice::OpenMode openMode,FILE * fh)

Opens the file handlefh inopenMode mode. Returns true on success; otherwise returns false.

bool QFSFileEngine::open(QIODevice::OpenMode openMode,int fd)

Opens the file descriptorfd inopenMode mode. Returns true on success; otherwise returns false.

bool QFSFileEngine::open(QIODevice::OpenMode openMode,int fd,QFile::FileHandleFlags handleFlags)

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.

bool QFSFileEngine::open(QIODevice::OpenMode openMode,FILE * fh,QFile::FileHandleFlags handleFlags)

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.

bool QFSFileEngine::open(QIODevice::OpenMode openMode, constRFile & file,QFile::FileHandleFlags handleFlags)

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) const

Reimplemented fromQAbstractFileEngine::owner().

[virtual]uint QFSFileEngine::ownerId(FileOwner own) const

Reimplemented 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() const

Reimplemented 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) const

Reimplemented 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() const

Reimplemented fromQAbstractFileEngine::size().

See alsosetSize().

[virtual]bool QFSFileEngine::supportsExtension(Extension extension) const

Reimplemented 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.


[8]ページ先頭

©2009-2025 Movatter.jp