Qt 4.8
qfilesystemengine_p.h
Go to the documentation of this file.
1 /****************************************************************************
2 **
3 ** Copyright (C) 2014 Digia Plc and/or its subsidiary(-ies).
4 ** Contact: http://www.qt-project.org/legal
5 **
6 ** This file is part of the QtCore module of the Qt Toolkit.
7 **
8 ** $QT_BEGIN_LICENSE:LGPL$
9 ** Commercial License Usage
10 ** Licensees holding valid commercial Qt licenses may use this file in
11 ** accordance with the commercial license agreement provided with the
12 ** Software or, alternatively, in accordance with the terms contained in
13 ** a written agreement between you and Digia. For licensing terms and
14 ** conditions see http://qt.digia.com/licensing. For further information
15 ** use the contact form at http://qt.digia.com/contact-us.
16 **
17 ** GNU Lesser General Public License Usage
18 ** Alternatively, this file may be used under the terms of the GNU Lesser
19 ** General Public License version 2.1 as published by the Free Software
20 ** Foundation and appearing in the file LICENSE.LGPL included in the
21 ** packaging of this file. Please review the following information to
22 ** ensure the GNU Lesser General Public License version 2.1 requirements
23 ** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
24 **
25 ** In addition, as a special exception, Digia gives you certain additional
26 ** rights. These rights are described in the Digia Qt LGPL Exception
27 ** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
28 **
29 ** GNU General Public License Usage
30 ** Alternatively, this file may be used under the terms of the GNU
31 ** General Public License version 3.0 as published by the Free Software
32 ** Foundation and appearing in the file LICENSE.GPL included in the
33 ** packaging of this file. Please review the following information to
34 ** ensure the GNU General Public License version 3.0 requirements will be
35 ** met: http://www.gnu.org/copyleft/gpl.html.
36 **
37 **
38 ** $QT_END_LICENSE$
39 **
40 ****************************************************************************/
41 
42 #ifndef QFILESYSTEMENGINE_P_H_INCLUDED
43 #define QFILESYSTEMENGINE_P_H_INCLUDED
44 
45 //
46 // W A R N I N G
47 // -------------
48 //
49 // This file is not part of the Qt API. It exists purely as an
50 // implementation detail. This header file may change from version to
51 // version without notice, or even be removed.
52 //
53 // We mean it.
54 //
55 
56 #include "qfile.h"
57 #include "qfilesystementry_p.h"
58 #include "qfilesystemmetadata_p.h"
59 #include <QtCore/private/qsystemerror_p.h>
60 
62 
64 {
65 public:
66  static bool isCaseSensitive();
67 
70  static QFileSystemEntry absoluteName(const QFileSystemEntry &entry);
71  static QString resolveUserName(const QFileSystemEntry &entry, QFileSystemMetaData &data);
73 
74 #if defined(Q_OS_UNIX) && !defined(Q_OS_SYMBIAN)
75  static QString resolveUserName(uint userId);
76  static QString resolveGroupName(uint groupId);
77 #endif
78 
79 #if !defined(QWS) && !defined(Q_WS_QPA) && defined(Q_OS_MAC)
80  static QString bundleName(const QFileSystemEntry &entry);
81 #else
82  static QString bundleName(const QFileSystemEntry &entry) { Q_UNUSED(entry) return QString(); }
83 #endif
84 
85  static bool fillMetaData(const QFileSystemEntry &entry, QFileSystemMetaData &data,
86  QFileSystemMetaData::MetaDataFlags what);
87 #if defined(Q_OS_UNIX)
88  static bool fillMetaData(int fd, QFileSystemMetaData &data); // what = PosixStatFlags
89 #endif
90 #if defined(Q_OS_WIN)
91 
92  static bool uncListSharesOnServer(const QString &server, QStringList *list); //Used also by QFSFileEngineIterator::hasNext()
93  static bool fillMetaData(int fd, QFileSystemMetaData &data,
94  QFileSystemMetaData::MetaDataFlags what);
95  static bool fillMetaData(HANDLE fHandle, QFileSystemMetaData &data,
96  QFileSystemMetaData::MetaDataFlags what);
97  static bool fillPermissions(const QFileSystemEntry &entry, QFileSystemMetaData &data,
98  QFileSystemMetaData::MetaDataFlags what);
100  static QString nativeAbsoluteFilePath(const QString &path);
101 #endif
102  //homePath, rootPath and tempPath shall return clean paths
103  static QString homePath();
104  static QString rootPath();
105  static QString tempPath();
106 
107  static bool createDirectory(const QFileSystemEntry &entry, bool createParents);
108  static bool removeDirectory(const QFileSystemEntry &entry, bool removeEmptyParents);
109 
110  static bool createLink(const QFileSystemEntry &source, const QFileSystemEntry &target, QSystemError &error);
111 
112  static bool copyFile(const QFileSystemEntry &source, const QFileSystemEntry &target, QSystemError &error);
113  static bool renameFile(const QFileSystemEntry &source, const QFileSystemEntry &target, QSystemError &error);
114  static bool removeFile(const QFileSystemEntry &entry, QSystemError &error);
115 
116  static bool setPermissions(const QFileSystemEntry &entry, QFile::Permissions permissions, QSystemError &error,
117  QFileSystemMetaData *data = 0);
118 
119  static bool setCurrentPath(const QFileSystemEntry &entry);
120  static QFileSystemEntry currentPath();
121 
123  QFileSystemMetaData &data);
124 private:
125  static QString slowCanonicalized(const QString &path);
126 #if defined(Q_OS_WIN)
127  static void clearWinStatData(QFileSystemMetaData &data);
128 #endif
129 };
130 
132 
133 #endif // include guard
static bool fillMetaData(const QFileSystemEntry &entry, QFileSystemMetaData &data, QFileSystemMetaData::MetaDataFlags what)
static bool setPermissions(const QFileSystemEntry &entry, QFile::Permissions permissions, QSystemError &error, QFileSystemMetaData *data=0)
#define QT_END_NAMESPACE
This macro expands to.
Definition: qglobal.h:90
static QString resolveGroupName(const QFileSystemEntry &entry, QFileSystemMetaData &data)
#define error(msg)
The QString class provides a Unicode character string.
Definition: qstring.h:83
static bool uncListSharesOnServer(const QString &server, QStringList *list)
static QFileSystemEntry currentPath()
#define QT_BEGIN_NAMESPACE
This macro expands to.
Definition: qglobal.h:89
static QFileSystemEntry absoluteName(const QFileSystemEntry &entry)
static bool removeDirectory(const QFileSystemEntry &entry, bool removeEmptyParents)
static bool renameFile(const QFileSystemEntry &source, const QFileSystemEntry &target, QSystemError &error)
static QString resolveUserName(const QFileSystemEntry &entry, QFileSystemMetaData &data)
static QString slowCanonicalized(const QString &path)
Returns the canonicalized form of path (i.
The QStringList class provides a list of strings.
Definition: qstringlist.h:66
The QAbstractFileEngine class provides an abstraction for accessing the filesystem.
static const char * data(const QByteArray &arr)
unsigned int uint
Definition: qglobal.h:996
void * HANDLE
Definition: qnamespace.h:1671
static bool fillPermissions(const QFileSystemEntry &entry, QFileSystemMetaData &data, QFileSystemMetaData::MetaDataFlags what)
static QString nativeAbsoluteFilePath(const QString &path)
static QFileSystemEntry getLinkTarget(const QFileSystemEntry &link, QFileSystemMetaData &data)
static bool createDirectory(const QFileSystemEntry &entry, bool createParents)
static QString bundleName(const QFileSystemEntry &entry)
static bool setCurrentPath(const QFileSystemEntry &entry)
static QAuServer & server()
Definition: qsound.cpp:79
static bool createLink(const QFileSystemEntry &source, const QFileSystemEntry &target, QSystemError &error)
static bool removeFile(const QFileSystemEntry &entry, QSystemError &error)
static QString owner(const QFileSystemEntry &entry, QAbstractFileEngine::FileOwner own)
static bool copyFile(const QFileSystemEntry &source, const QFileSystemEntry &target, QSystemError &error)
static QAbstractFileEngine * resolveEntryAndCreateLegacyEngine(QFileSystemEntry &entry, QFileSystemMetaData &data)
Resolves the entry (see QDir::searchPaths) and returns an engine for it, but never a QFSFileEngine...
#define Q_UNUSED(x)
Indicates to the compiler that the parameter with the specified name is not used in the body of a fun...
Definition: qglobal.h:1729
static void clearWinStatData(QFileSystemMetaData &data)
static QFileSystemEntry canonicalName(const QFileSystemEntry &entry, QFileSystemMetaData &data)