Qt
Internal/Contributor docs for the Qt SDK. <b>Note:</b> These are NOT official API docs; those are found <a href='https://doc.qt.io/'>here</a>.
Loading...
Searching...
No Matches
qfilesystementry_p.h
Go to the documentation of this file.
1// Copyright (C) 2016 The Qt Company Ltd.
2// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only
3
4#ifndef QFILESYSTEMENTRY_P_H
5#define QFILESYSTEMENTRY_P_H
6
7//
8// W A R N I N G
9// -------------
10//
11// This file is not part of the Qt API. It exists purely as an
12// implementation detail. This header file may change from version to
13// version without notice, or even be removed.
14//
15// We mean it.
16//
17
18#include <QtCore/private/qglobal_p.h>
19#include <QtCore/qstring.h>
20#include <QtCore/qbytearray.h>
21
23
25{
26public:
27
28#ifndef Q_OS_WIN
30#else
31 typedef QString NativePath;
32#endif
35
38
42
51 Q_AUTOTEST_EXPORT bool isAbsolute() const;
52 Q_AUTOTEST_EXPORT bool isRelative() const;
53 Q_AUTOTEST_EXPORT bool isClean() const;
54
55#if defined(Q_OS_WIN)
56 Q_AUTOTEST_EXPORT bool isDriveRoot() const;
57 static bool isDriveRootPath(const QString &path);
58 static QString removeUncOrLongPathPrefix(QString path);
59#endif
60 Q_AUTOTEST_EXPORT bool isRoot() const;
61
62 Q_AUTOTEST_EXPORT bool isEmpty() const;
63
64 void clear()
65 {
66 *this = QFileSystemEntry();
67 }
68
69 Q_CORE_EXPORT static bool isRootPath(const QString &path);
70
71private:
72 // creates the QString version out of the bytearray version
73 void resolveFilePath() const;
74 // creates the bytearray version out of the QString version
75 void resolveNativeFilePath() const;
76 // resolves the separator
77 void findLastSeparator() const;
78 // resolves the dots and the separator
79 void findFileNameSeparators() const;
80
81 mutable QString m_filePath; // always has slashes as separator
82 mutable NativePath m_nativeFilePath; // native encoding and separators
83
84 mutable qint16 m_lastSeparator; // index in m_filePath of last separator
85 mutable qint16 m_firstDotInFileName; // index after m_filePath for first dot (.)
86 mutable qint16 m_lastDotInFileName; // index after m_firstDotInFileName for last dot (.)
87};
88
90
91#endif // include guard
\inmodule QtCore
Definition qbytearray.h:57
Q_AUTOTEST_EXPORT NativePath nativeFilePath() const
Q_AUTOTEST_EXPORT bool isEmpty() const
Q_AUTOTEST_EXPORT QString baseName() const
Q_AUTOTEST_EXPORT bool isClean() const
Q_AUTOTEST_EXPORT QString completeBaseName() const
Q_AUTOTEST_EXPORT bool isRelative() const
static Q_CORE_EXPORT bool isRootPath(const QString &path)
Q_AUTOTEST_EXPORT QString suffix() const
Q_AUTOTEST_EXPORT QString path() const
Q_AUTOTEST_EXPORT bool isRoot() const
Q_AUTOTEST_EXPORT QString filePath() const
Q_AUTOTEST_EXPORT QString completeSuffix() const
Q_AUTOTEST_EXPORT QFileSystemEntry()
Q_AUTOTEST_EXPORT QString fileName() const
Q_AUTOTEST_EXPORT bool isAbsolute() const
\macro QT_RESTRICTED_CAST_FROM_ASCII
Definition qstring.h:129
Combined button and popup list for selecting options.
GLsizei const GLchar *const * path
#define Q_AUTOTEST_EXPORT
short qint16
Definition qtypes.h:47