diff options
Diffstat (limited to 'src/corelib/io/qfilesystementry_p.h')
-rw-r--r-- | src/corelib/io/qfilesystementry_p.h | 93 |
1 files changed, 26 insertions, 67 deletions
diff --git a/src/corelib/io/qfilesystementry_p.h b/src/corelib/io/qfilesystementry_p.h index 251eca553a..8b5d506b0b 100644 --- a/src/corelib/io/qfilesystementry_p.h +++ b/src/corelib/io/qfilesystementry_p.h @@ -1,41 +1,5 @@ -/**************************************************************************** -** -** Copyright (C) 2016 The Qt Company Ltd. -** Contact: https://www.qt.io/licensing/ -** -** This file is part of the QtCore module of the Qt Toolkit. -** -** $QT_BEGIN_LICENSE:LGPL$ -** Commercial License Usage -** Licensees holding valid commercial Qt licenses may use this file in -** accordance with the commercial license agreement provided with the -** Software or, alternatively, in accordance with the terms contained in -** a written agreement between you and The Qt Company. For licensing terms -** and conditions see https://www.qt.io/terms-conditions. For further -** information use the contact form at https://www.qt.io/contact-us. -** -** GNU Lesser General Public License Usage -** Alternatively, this file may be used under the terms of the GNU Lesser -** General Public License version 3 as published by the Free Software -** Foundation and appearing in the file LICENSE.LGPL3 included in the -** packaging of this file. Please review the following information to -** ensure the GNU Lesser General Public License version 3 requirements -** will be met: https://www.gnu.org/licenses/lgpl-3.0.html. -** -** GNU General Public License Usage -** Alternatively, this file may be used under the terms of the GNU -** General Public License version 2.0 or (at your option) the GNU General -** Public license version 3 or any later version approved by the KDE Free -** Qt Foundation. The licenses are as published by the Free Software -** Foundation and appearing in the file LICENSE.GPL2 and LICENSE.GPL3 -** included in the packaging of this file. Please review the following -** information to ensure the GNU General Public License requirements will -** be met: https://www.gnu.org/licenses/gpl-2.0.html and -** https://www.gnu.org/licenses/gpl-3.0.html. -** -** $QT_END_LICENSE$ -** -****************************************************************************/ +// Copyright (C) 2016 The Qt Company Ltd. +// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only #ifndef QFILESYSTEMENTRY_P_H #define QFILESYSTEMENTRY_P_H @@ -55,17 +19,13 @@ #include <QtCore/qstring.h> #include <QtCore/qbytearray.h> -#if defined(Q_OS_WIN) -#define QFILESYSTEMENTRY_NATIVE_PATH_IS_UTF16 -#endif - QT_BEGIN_NAMESPACE class QFileSystemEntry { public: -#ifndef QFILESYSTEMENTRY_NATIVE_PATH_IS_UTF16 +#ifndef Q_OS_WIN typedef QByteArray NativePath; #else typedef QString NativePath; @@ -73,35 +33,34 @@ public: struct FromNativePath{}; struct FromInternalPath{}; - QFileSystemEntry(); - explicit QFileSystemEntry(const QString &filePath); - - QFileSystemEntry(const QString &filePath, FromInternalPath dummy); - QFileSystemEntry(const NativePath &nativeFilePath, FromNativePath dummy); - QFileSystemEntry(const QString &filePath, const NativePath &nativeFilePath); - - QString filePath() const; - QString fileName() const; - QString path() const; - NativePath nativeFilePath() const; - QString baseName() const; - QString completeBaseName() const; - QString suffix() const; - QString completeSuffix() const; - bool isAbsolute() const; - bool isRelative() const; - bool isClean() const; + Q_AUTOTEST_EXPORT QFileSystemEntry(); + Q_AUTOTEST_EXPORT explicit QFileSystemEntry(const QString &filePath); + + Q_AUTOTEST_EXPORT QFileSystemEntry(const QString &filePath, FromInternalPath dummy); + Q_AUTOTEST_EXPORT QFileSystemEntry(const NativePath &nativeFilePath, FromNativePath dummy); + Q_AUTOTEST_EXPORT QFileSystemEntry(const QString &filePath, const NativePath &nativeFilePath); + + Q_AUTOTEST_EXPORT QString filePath() const; + Q_AUTOTEST_EXPORT QString fileName() const; + Q_AUTOTEST_EXPORT QString path() const; + Q_AUTOTEST_EXPORT NativePath nativeFilePath() const; + Q_AUTOTEST_EXPORT QString baseName() const; + Q_AUTOTEST_EXPORT QString completeBaseName() const; + Q_AUTOTEST_EXPORT QString suffix() const; + Q_AUTOTEST_EXPORT QString completeSuffix() const; + Q_AUTOTEST_EXPORT bool isAbsolute() const; + Q_AUTOTEST_EXPORT bool isRelative() const; + Q_AUTOTEST_EXPORT bool isClean() const; #if defined(Q_OS_WIN) - bool isDriveRoot() const; + Q_AUTOTEST_EXPORT bool isDriveRoot() const; static bool isDriveRootPath(const QString &path); + static QString removeUncOrLongPathPrefix(QString path); #endif - bool isRoot() const; + Q_AUTOTEST_EXPORT bool isRoot() const; + + Q_AUTOTEST_EXPORT bool isEmpty() const; - bool isEmpty() const - { - return m_filePath.isEmpty() && m_nativeFilePath.isEmpty(); - } void clear() { *this = QFileSystemEntry(); |