From 852be4c69f8dd4a890d78f9ea7210ecc9e44254a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jo=C3=A3o=20Abecasis?= Date: Thu, 26 Aug 2010 11:40:52 +0200 Subject: Begin defining the interface for file engines NG New file engine API is meant to be a thin layer of abstraction over native file system APIs. Stateless and static for the time being. Platform-specific implementations will follow. Reviewed-by: Thomas Zander Reviewed-by: Prasanth Ullattil --- src/corelib/io/qfilesystemengine_p.h | 27 +++++++++++++++++++++++++++ src/corelib/io/qfilesystemmetadata_p.h | 6 ++++++ 2 files changed, 33 insertions(+) diff --git a/src/corelib/io/qfilesystemengine_p.h b/src/corelib/io/qfilesystemengine_p.h index 817f925..c1bb3b4 100644 --- a/src/corelib/io/qfilesystemengine_p.h +++ b/src/corelib/io/qfilesystemengine_p.h @@ -53,10 +53,37 @@ // We mean it. // +#include "qfile.h" +#include "qfilesystementry_p.h" +#include "qfilesystemmetadata_p.h" + QT_BEGIN_NAMESPACE class QFileSystemEngine { +public: + static bool isCaseSensitive(); + + static QFileSystemEntry getLinkTarget(const QFileSystemEntry &link); + static QFileSystemEntry canonicalName(const QFileSystemEntry &entry); + static QFileSystemEntry absoluteName(const QFileSystemEntry &entry); + + static QString bundleName(const QFileSystemEntry &entry); + + static bool fillMetaData(const QFileSystemEntry &entry, QFileSystemMetaData &data, + QFileSystemMetaData::FileFlags what); + + static bool createDirectory(const QFileSystemEntry &entry, bool createParents); + static bool removeDirectory(const QFileSystemEntry &entry, bool removeEmptyParents); + + static bool createLink(const QFileSystemEntry &source, const QFileSystemEntry &target); + + static bool copyFile(const QFileSystemEntry &source, const QFileSystemEntry &target); + static bool renameFile(const QFileSystemEntry &source, const QFileSystemEntry &target); + static bool removeFile(const QFileSystemEntry &entry); + + static bool setPermissions(const QFileSystemEntry &entry, QFile::Permissions permissions, + QFileSystemMetaData *data = 0); }; QT_END_NAMESPACE diff --git a/src/corelib/io/qfilesystemmetadata_p.h b/src/corelib/io/qfilesystemmetadata_p.h index c051bc5..9664177 100644 --- a/src/corelib/io/qfilesystemmetadata_p.h +++ b/src/corelib/io/qfilesystemmetadata_p.h @@ -53,10 +53,16 @@ // We mean it. // +#include + QT_BEGIN_NAMESPACE class QFileSystemMetaData { +public: + enum FileFlag { + }; + Q_DECLARE_FLAGS(FileFlags, FileFlag); }; QT_END_NAMESPACE -- cgit v0.12