Viadeo Twitter Google Bookmarks ! Facebook Digg del.icio.us MySpace Yahoo MyWeb Blinklist Netvouz Reddit Simpy StumbleUpon Bookmarks Windows Live Favorites 
Logo Documentation Qt ·  Page d'accueil  ·  Toutes les classes  ·  Toutes les fonctions  ·  Vues d'ensemble  · 

QFSFileEngine Class Reference

The QFSFileEngine class implements Qt's default file engine. More...

 #include <QFSFileEngine>

Inherits: QAbstractFileEngine.

This class was introduced in Qt 4.1.

Public Types

typedef Iterator

Public Functions

QFSFileEngine ()
QFSFileEngine ( const QString & file )
~QFSFileEngine ()
bool open ( QIODevice::OpenMode openMode, FILE * fh )
bool open ( QIODevice::OpenMode openMode, int fd )

Reimplemented Public Functions

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 )

Static Public Members

QString currentPath ( const QString & fileName = QString() )
QFileInfoList drives ()
QString homePath ()
QString rootPath ()
bool setCurrentPath ( const QString & path )
QString tempPath ()

Additional Inherited Members

Detailed Description

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

Member Function Documentation

QFSFileEngine::QFSFileEngine ()

Constructs a QFSFileEngine.

QFSFileEngine::QFSFileEngine ( const QString & file )

Constructs a QFSFileEngine for the file name file.

QFSFileEngine::~QFSFileEngine ()

Destructs the QFSFileEngine.

bool QFSFileEngine::caseSensitive () const [virtual]

Reimplemented from QAbstractFileEngine::caseSensitive().

Returns true for Windows, false for Unix.

bool QFSFileEngine::close () [virtual]

Reimplemented from QAbstractFileEngine::close().

bool QFSFileEngine::copy ( const QString & copyName ) [virtual]

Reimplemented from QAbstractFileEngine::copy().

For windows, copy the file to file copyName.

Not implemented for Unix.

QString QFSFileEngine::currentPath ( const QString & fileName = QString() ) [static]

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

QFileInfoList QFSFileEngine::drives () [static]

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

bool QFSFileEngine::extension ( Extension extension, const ExtensionOption * option = 0, ExtensionReturn * output = 0 ) [virtual]

Reimplemented from QAbstractFileEngine::extension().

FileFlags QFSFileEngine::fileFlags ( FileFlags type ) const [virtual]

Reimplemented from QAbstractFileEngine::fileFlags().

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

Reimplemented from QAbstractFileEngine::fileName().

See also setFileName().

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

Reimplemented from QAbstractFileEngine::fileTime().

bool QFSFileEngine::flush () [virtual]

Reimplemented from QAbstractFileEngine::flush().

int QFSFileEngine::handle () const [virtual]

Reimplemented from QAbstractFileEngine::handle().

QString QFSFileEngine::homePath () [static]

Returns the home path of the current user.

See also rootPath().

bool QFSFileEngine::isRelativePath () const [virtual]

Reimplemented from QAbstractFileEngine::isRelativePath().

bool QFSFileEngine::isSequential () const [virtual]

Reimplemented from QAbstractFileEngine::isSequential().

bool QFSFileEngine::link ( const QString & newName ) [virtual]

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.

bool QFSFileEngine::mkdir ( const QString & name, bool createParentDirectories ) const [virtual]

Reimplemented from QAbstractFileEngine::mkdir().

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

Reimplemented from QAbstractFileEngine::open().

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

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

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

Opens the file descriptor fd in openMode mode. Returns true on success; otherwise returns false.

QString QFSFileEngine::owner ( FileOwner own ) const [virtual]

Reimplemented from QAbstractFileEngine::owner().

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

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.

qint64 QFSFileEngine::pos () const [virtual]

Reimplemented from QAbstractFileEngine::pos().

qint64 QFSFileEngine::read ( char * data, qint64 maxlen ) [virtual]

Reimplemented from QAbstractFileEngine::read().

qint64 QFSFileEngine::readLine ( char * data, qint64 maxlen ) [virtual]

Reimplemented from QAbstractFileEngine::readLine().

bool QFSFileEngine::remove () [virtual]

Reimplemented from QAbstractFileEngine::remove().

bool QFSFileEngine::rename ( const QString & newName ) [virtual]

Reimplemented from QAbstractFileEngine::rename().

bool QFSFileEngine::rmdir ( const QString & name, bool recurseParentDirectories ) const [virtual]

Reimplemented from QAbstractFileEngine::rmdir().

QString QFSFileEngine::rootPath () [static]

Returns the root path.

See also homePath().

bool QFSFileEngine::seek ( qint64 pos ) [virtual]

Reimplemented from QAbstractFileEngine::seek().

bool QFSFileEngine::setCurrentPath ( const QString & path ) [static]

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

void QFSFileEngine::setFileName ( const QString & file ) [virtual]

Reimplemented from QAbstractFileEngine::setFileName().

See also fileName().

bool QFSFileEngine::setPermissions ( uint perms ) [virtual]

Reimplemented from QAbstractFileEngine::setPermissions().

bool QFSFileEngine::setSize ( qint64 size ) [virtual]

Reimplemented from QAbstractFileEngine::setSize().

See also size().

qint64 QFSFileEngine::size () const [virtual]

Reimplemented from QAbstractFileEngine::size().

See also setSize().

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

Reimplemented from QAbstractFileEngine::supportsExtension().

QString QFSFileEngine::tempPath () [static]

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

qint64 QFSFileEngine::write ( const char * data, qint64 len ) [virtual]

Reimplemented from QAbstractFileEngine::write().

Publicité

Best Of

Actualités les plus lues

Semaine
Mois
Année
  1. Microsoft ouvre aux autres compilateurs C++ AMP, la spécification pour la conception d'applications parallèles C++ utilisant le GPU 22
  2. Les développeurs ignorent-ils trop les failles découvertes dans leur code ? Prenez-vous en compte les remarques des autres ? 17
  3. RIM : « 13 % des développeurs ont gagné plus de 100 000 $ sur l'AppWord », Qt et open-source au menu du BlackBerry DevCon Europe 0
  4. « Quelque chose ne va vraiment pas avec les développeurs "modernes" », un développeur à "l'ancienne" critique la multiplication des bibliothèques 12
  5. BlackBerry 10 : premières images du prochain OS de RIM qui devrait intégrer des widgets et des tuiles inspirées de Windows Phone 0
  6. Adieu qmake, bienvenue qbs : Qt Building Suite, un outil déclaratif et extensible pour la compilation de projets Qt 17
  7. Quelles nouveautés de C++11 Visual C++ doit-il rapidement intégrer ? Donnez-nous votre avis 10
Page suivante

Le Qt Developer Network au hasard

Logo

Compiler l'add-in Qt de Visual Studio

Le Qt Developer Network est un réseau de développeurs Qt anglophone, où ils peuvent partager leur expérience sur le framework. Lire l'article.

Communauté

Ressources

Liens utiles

Contact

  • Vous souhaitez rejoindre la rédaction ou proposer un tutoriel, une traduction, une question... ? Postez dans le forum Contribuez ou contactez-nous par MP ou par email (voir en bas de page).

Qt dans le magazine

Cette page est une traduction d'une page de la documentation de Qt, écrite par Nokia Corporation and/or its subsidiary(-ies). Les éventuels problèmes résultant d'une mauvaise traduction ne sont pas imputables à Nokia. Qt 4.7
Copyright © 2012 Developpez LLC. Tous droits réservés Developpez LLC. Aucune reproduction, même partielle, ne peut être faite de ce site et de l'ensemble de son contenu : textes, documents et images sans l'autorisation expresse de Developpez LLC. Sinon, vous encourez selon la loi jusqu'à 3 ans de prison et jusqu'à 300 000 E de dommages et intérêts. Cette page est déposée à la SACD.
Vous avez déniché une erreur ? Un bug ? Une redirection cassée ? Ou tout autre problème, quel qu'il soit ? Ou bien vous désirez participer à ce projet de traduction ? N'hésitez pas à nous contacter ou par MP !
 
 
 
 
Partenaires

Hébergement Web