summaryrefslogtreecommitdiffstats
path: root/src/corelib/io/qfsfileengine.h
diff options
context:
space:
mode:
authorJoão Abecasis <joao.abecasis@nokia.com>2012-02-17 20:09:17 +0100
committerQt by Nokia <qt-info@nokia.com>2012-02-22 00:07:31 +0100
commit7bbe79fe5f54ed7542d935600036d3c8b401505f (patch)
treec37504bd357768150ea75b79b947ad570729ca5e /src/corelib/io/qfsfileengine.h
parent9beeb3030be3e0ab6513164b785fca3ade4c90e9 (diff)
Drop file-engine abstraction from public API
This abstraction imposed serious performance penalties and is being dropped from the public API. In particular, by allowing file names to be arbitrarily hijacked by different file engines, and requiring engines to be instantiated in order to decide, it imposed unnecessary overhead on all file operations. Another flaw in the design with direct impact on performance is how engines have no way to provide (or retain) additional information obtained when querying the filesystem. In many places this has meant repeated operations on the file system, where useful information is immediately discarded to be queried again subsequently. For Qt 4.8 a major refactoring of the code base took place to allow bypassing the file-engine abstraction in select places, with considerable performance gains observed. In Qt 5 it is expected we'll be able to take this further, reaping even more benefits, but the abstraction has to go. [Dropping this now does not preclude that virtual file systems make an appearance in Qt at a later point in Qt 5's lifecycle. Hopefully with a new and improved abstraction.] Forward declarations for QFileExtension(Result) were dropped, as the classes were never used or defined. Tests using "internalized" classes will only fully run on developer builds. QFSFileEngine was removed altogether from exception safety test, as it isn't its intent to test internal API. Change-Id: Ie910e6c2628be202ea9e05366b091d6d529b246b Reviewed-by: Thiago Macieira <thiago.macieira@intel.com> Reviewed-by: Lars Knoll <lars.knoll@nokia.com>
Diffstat (limited to 'src/corelib/io/qfsfileengine.h')
-rw-r--r--src/corelib/io/qfsfileengine.h122
1 files changed, 0 insertions, 122 deletions
diff --git a/src/corelib/io/qfsfileengine.h b/src/corelib/io/qfsfileengine.h
deleted file mode 100644
index 63659e709a..0000000000
--- a/src/corelib/io/qfsfileengine.h
+++ /dev/null
@@ -1,122 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
-** Contact: http://www.qt-project.org/
-**
-** This file is part of the QtCore module of the Qt Toolkit.
-**
-** $QT_BEGIN_LICENSE:LGPL$
-** GNU Lesser General Public License Usage
-** This file may be used under the terms of the GNU Lesser General Public
-** License version 2.1 as published by the Free Software Foundation and
-** appearing in the file LICENSE.LGPL included in the packaging of this
-** file. Please review the following information to ensure the GNU Lesser
-** General Public License version 2.1 requirements will be met:
-** http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
-**
-** In addition, as a special exception, Nokia gives you certain additional
-** rights. These rights are described in the Nokia Qt LGPL Exception
-** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
-**
-** GNU General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU General
-** Public License version 3.0 as published by the Free Software Foundation
-** and appearing in the file LICENSE.GPL included in the packaging of this
-** file. Please review the following information to ensure the GNU General
-** Public License version 3.0 requirements will be met:
-** http://www.gnu.org/copyleft/gpl.html.
-**
-** Other Usage
-** Alternatively, this file may be used in accordance with the terms and
-** conditions contained in a signed written agreement between you and Nokia.
-**
-**
-**
-**
-**
-**
-** $QT_END_LICENSE$
-**
-****************************************************************************/
-
-#ifndef QFSFILEENGINE_H
-#define QFSFILEENGINE_H
-
-#include <QtCore/qabstractfileengine.h>
-
-#ifndef QT_NO_FSFILEENGINE
-
-QT_BEGIN_HEADER
-
-QT_BEGIN_NAMESPACE
-
-
-class QFSFileEnginePrivate;
-
-class Q_CORE_EXPORT QFSFileEngine : public QAbstractFileEngine
-{
- Q_DECLARE_PRIVATE(QFSFileEngine)
-public:
- QFSFileEngine();
- explicit QFSFileEngine(const QString &file);
- ~QFSFileEngine();
-
- bool open(QIODevice::OpenMode openMode);
- bool open(QIODevice::OpenMode flags, FILE *fh);
- bool close();
- bool flush();
- qint64 size() const;
- qint64 pos() const;
- bool seek(qint64);
- bool isSequential() const;
- bool remove();
- bool copy(const QString &newName);
- bool rename(const QString &newName);
- bool link(const QString &newName);
- bool mkdir(const QString &dirName, bool createParentDirectories) const;
- bool rmdir(const QString &dirName, bool recurseParentDirectories) const;
- bool setSize(qint64 size);
- bool caseSensitive() const;
- bool isRelativePath() const;
- QStringList entryList(QDir::Filters filters, const QStringList &filterNames) const;
- FileFlags fileFlags(FileFlags type) const;
- bool setPermissions(uint perms);
- QString fileName(FileName file) const;
- uint ownerId(FileOwner) const;
- QString owner(FileOwner) const;
- QDateTime fileTime(FileTime time) const;
- void setFileName(const QString &file);
- int handle() const;
-
- Iterator *beginEntryList(QDir::Filters filters, const QStringList &filterNames);
- Iterator *endEntryList();
-
- qint64 read(char *data, qint64 maxlen);
- qint64 readLine(char *data, qint64 maxlen);
- qint64 write(const char *data, qint64 len);
-
- bool extension(Extension extension, const ExtensionOption *option = 0, ExtensionReturn *output = 0);
- bool supportsExtension(Extension extension) const;
-
- //FS only!!
- bool open(QIODevice::OpenMode flags, int fd);
- bool open(QIODevice::OpenMode flags, int fd, QFile::FileHandleFlags handleFlags);
- bool open(QIODevice::OpenMode flags, FILE *fh, QFile::FileHandleFlags handleFlags);
- static bool setCurrentPath(const QString &path);
- static QString currentPath(const QString &path = QString());
- static QString homePath();
- static QString rootPath();
- static QString tempPath();
- static QFileInfoList drives();
-
-protected:
- QFSFileEngine(QFSFileEnginePrivate &dd);
-};
-
-QT_END_NAMESPACE
-
-QT_END_HEADER
-
-#endif // QT_NO_FSFILEENGINE
-
-#endif // QFSFILEENGINE_H