src/corelib/io/qfsfileengine.h
changeset 0 1918ee327afb
child 4 3b1da2848fc7
equal deleted inserted replaced
-1:000000000000 0:1918ee327afb
       
     1 /****************************************************************************
       
     2 **
       
     3 ** Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies).
       
     4 ** All rights reserved.
       
     5 ** Contact: Nokia Corporation (qt-info@nokia.com)
       
     6 **
       
     7 ** This file is part of the QtCore module of the Qt Toolkit.
       
     8 **
       
     9 ** $QT_BEGIN_LICENSE:LGPL$
       
    10 ** No Commercial Usage
       
    11 ** This file contains pre-release code and may not be distributed.
       
    12 ** You may use this file in accordance with the terms and conditions
       
    13 ** contained in the Technology Preview License Agreement accompanying
       
    14 ** this package.
       
    15 **
       
    16 ** GNU Lesser General Public License Usage
       
    17 ** Alternatively, this file may be used under the terms of the GNU Lesser
       
    18 ** General Public License version 2.1 as published by the Free Software
       
    19 ** Foundation and appearing in the file LICENSE.LGPL included in the
       
    20 ** packaging of this file.  Please review the following information to
       
    21 ** ensure the GNU Lesser General Public License version 2.1 requirements
       
    22 ** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
       
    23 **
       
    24 ** In addition, as a special exception, Nokia gives you certain additional
       
    25 ** rights.  These rights are described in the Nokia Qt LGPL Exception
       
    26 ** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
       
    27 **
       
    28 ** If you have questions regarding the use of this file, please contact
       
    29 ** Nokia at qt-info@nokia.com.
       
    30 **
       
    31 **
       
    32 **
       
    33 **
       
    34 **
       
    35 **
       
    36 **
       
    37 **
       
    38 ** $QT_END_LICENSE$
       
    39 **
       
    40 ****************************************************************************/
       
    41 
       
    42 #ifndef QFSFILEENGINE_H
       
    43 #define QFSFILEENGINE_H
       
    44 
       
    45 #include <QtCore/qabstractfileengine.h>
       
    46 
       
    47 #ifndef QT_NO_FSFILEENGINE
       
    48 
       
    49 QT_BEGIN_HEADER
       
    50 
       
    51 QT_BEGIN_NAMESPACE
       
    52 
       
    53 QT_MODULE(Core)
       
    54 
       
    55 class QFSFileEnginePrivate;
       
    56 
       
    57 class Q_CORE_EXPORT QFSFileEngine : public QAbstractFileEngine
       
    58 {
       
    59     Q_DECLARE_PRIVATE(QFSFileEngine)
       
    60 public:
       
    61     QFSFileEngine();
       
    62     explicit QFSFileEngine(const QString &file);
       
    63     ~QFSFileEngine();
       
    64 
       
    65     bool open(QIODevice::OpenMode openMode);
       
    66     bool open(QIODevice::OpenMode flags, FILE *fh);
       
    67     bool close();
       
    68     bool flush();
       
    69     qint64 size() const;
       
    70     qint64 pos() const;
       
    71     bool seek(qint64);
       
    72     bool isSequential() const;
       
    73     bool remove();
       
    74     bool copy(const QString &newName);
       
    75     bool rename(const QString &newName);
       
    76     bool link(const QString &newName);
       
    77     bool mkdir(const QString &dirName, bool createParentDirectories) const;
       
    78     bool rmdir(const QString &dirName, bool recurseParentDirectories) const;
       
    79     bool setSize(qint64 size);
       
    80     bool caseSensitive() const;
       
    81     bool isRelativePath() const;
       
    82     QStringList entryList(QDir::Filters filters, const QStringList &filterNames) const;
       
    83     FileFlags fileFlags(FileFlags type) const;
       
    84     bool setPermissions(uint perms);
       
    85     QString fileName(FileName file) const;
       
    86     uint ownerId(FileOwner) const;
       
    87     QString owner(FileOwner) const;
       
    88     QDateTime fileTime(FileTime time) const;
       
    89     void setFileName(const QString &file);
       
    90     int handle() const;
       
    91 
       
    92     Iterator *beginEntryList(QDir::Filters filters, const QStringList &filterNames);
       
    93     Iterator *endEntryList();
       
    94 
       
    95     qint64 read(char *data, qint64 maxlen);
       
    96     qint64 readLine(char *data, qint64 maxlen);
       
    97     qint64 write(const char *data, qint64 len);
       
    98 
       
    99     bool extension(Extension extension, const ExtensionOption *option = 0, ExtensionReturn *output = 0);
       
   100     bool supportsExtension(Extension extension) const;
       
   101 
       
   102     //FS only!!
       
   103     bool open(QIODevice::OpenMode flags, int fd);
       
   104     static bool setCurrentPath(const QString &path);
       
   105     static QString currentPath(const QString &path = QString());
       
   106     static QString homePath();
       
   107     static QString rootPath();
       
   108     static QString tempPath();
       
   109     static QFileInfoList drives();
       
   110 
       
   111 protected:
       
   112     QFSFileEngine(QFSFileEnginePrivate &dd);
       
   113 };
       
   114 
       
   115 QT_END_NAMESPACE
       
   116 
       
   117 QT_END_HEADER
       
   118 
       
   119 #endif // QT_NO_FSFILEENGINE
       
   120 
       
   121 #endif // QFSFILEENGINE_H