QFSFileEngine Class Reference

[ QtCore module]

The QFSFileEngine class implements Qt's default file engine. 更多...

继承 QAbstractFileEngine .

方法

Static Methods


详细描述

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 代替。

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


方法文档编制

QFSFileEngine.__init__ ( self )

构造 QFSFileEngine .

QFSFileEngine.__init__ ( self , QString  file )

构造 QFSFileEngine for the file name file .

bool QFSFileEngine.caseSensitive ( self )

重实现自 QAbstractFileEngine.caseSensitive ().

Returns true for Windows, false for Unix.

bool QFSFileEngine.close ( self )

重实现自 QAbstractFileEngine.close ().

bool QFSFileEngine.copy ( self , QString  newName )

重实现自 QAbstractFileEngine.copy ().

For windows, copy the file to file copyName .

Not implemented for Unix.

QString QFSFileEngine.currentPath (QString  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 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:).

另请参阅 setCurrentPath ().

list-of-QFileInfo QFSFileEngine.drives ()

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 "/".

QStringList QFSFileEngine.entryList ( self , QDir.Filters   filters , QStringList  filterNames )

QAbstractFileEngine.FileFlags QFSFileEngine.fileFlags ( self , QAbstractFileEngine.FileFlags   type )

重实现自 QAbstractFileEngine.fileFlags ().

QString QFSFileEngine.fileName ( self , QAbstractFileEngine.FileName   file )

重实现自 QAbstractFileEngine.fileName ().

另请参阅 setFileName ().

QDateTime QFSFileEngine.fileTime ( self , QAbstractFileEngine.FileTime   time )

重实现自 QAbstractFileEngine.fileTime ().

bool QFSFileEngine.flush ( self )

重实现自 QAbstractFileEngine.flush ().

int QFSFileEngine.handle ( self )

重实现自 QAbstractFileEngine.handle ().

QString QFSFileEngine.homePath ()

Returns the home path of the current user.

另请参阅 rootPath ().

bool QFSFileEngine.isRelativePath ( self )

重实现自 QAbstractFileEngine.isRelativePath ().

bool QFSFileEngine.isSequential ( self )

重实现自 QAbstractFileEngine.isSequential ().

bool QFSFileEngine.link ( self , QString  newName )

重实现自 QAbstractFileEngine.link ().

Creates a link from the file currently specified by fileName () 到 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.

bool QFSFileEngine.mkdir ( self , QString  dirName , bool  createParentDirectories )

重实现自 QAbstractFileEngine.mkdir ().

bool QFSFileEngine.open ( self , QIODevice.OpenMode   openMode )

重实现自 QAbstractFileEngine.open ().

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

Opens the file handle fh in openMode mode. Returns true on success; otherwise returns false.

bool QFSFileEngine.open ( self , QIODevice.OpenMode   flags , int  fd )

Opens the file descriptor fd in openMode 模式。 返回 true 当成功时;否则返回 false。

QString QFSFileEngine.owner ( self , QAbstractFileEngine.FileOwner )

重实现自 QAbstractFileEngine.owner ().

int QFSFileEngine.ownerId ( self , QAbstractFileEngine.FileOwner )

重实现自 QAbstractFileEngine.ownerId ().

In Unix, if stat() is successful, the uid is returned if own is the owner. Otherwise the gid 被返回。 If stat() is unsuccessful, -2 is reuturned.

For Windows, -2 is always returned.

int QFSFileEngine.pos ( self )

重实现自 QAbstractFileEngine.pos ().

str QFSFileEngine.read ( self , int  maxlen )

重实现自 QAbstractFileEngine.read ().

str QFSFileEngine.readLine ( self , int  maxlen )

重实现自 QAbstractFileEngine.readLine ().

bool QFSFileEngine.remove ( self )

重实现自 QAbstractFileEngine.remove ().

bool QFSFileEngine.rename ( self , QString  newName )

重实现自 QAbstractFileEngine.rename ().

bool QFSFileEngine.rmdir ( self , QString  dirName , bool  recurseParentDirectories )

重实现自 QAbstractFileEngine.rmdir ().

QString QFSFileEngine.rootPath ()

Returns the root path.

另请参阅 homePath ().

bool QFSFileEngine.seek ( self , int)

重实现自 QAbstractFileEngine.seek ().

bool QFSFileEngine.setCurrentPath (QString  path )

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.

另请参阅 currentPath ().

QFSFileEngine.setFileName ( self , QString  file )

重实现自 QAbstractFileEngine.setFileName ().

另请参阅 fileName ().

bool QFSFileEngine.setPermissions ( self , int  perms )

重实现自 QAbstractFileEngine.setPermissions ().

bool QFSFileEngine.setSize ( self , int  size )

重实现自 QAbstractFileEngine.setSize ().

另请参阅 size ().

int QFSFileEngine.size ( self )

重实现自 QAbstractFileEngine.size ().

另请参阅 setSize ().

QString QFSFileEngine.tempPath ()

Returns the temporary path (i.e., a path in which it is safe to store temporary files).

int QFSFileEngine.write ( self , str  data )

重实现自 QAbstractFileEngine.write ().