9#include <QtCore/qstring.h>
10#include <QtCore/qstringlist.h>
11#include <QtCore/qlocale.h>
17QT_DECLARE_QESDP_SPECIALIZATION_DTOR(QCollatorSortKeyPrivate)
21 friend class QCollatorPrivate;
23 QCollatorSortKey() =
delete;
24 QCollatorSortKey(
const QCollatorSortKey &other);
25 QCollatorSortKey(QCollatorSortKey &&other)
noexcept =
default;
27 QCollatorSortKey &operator=(
const QCollatorSortKey &other);
28 QT_MOVE_ASSIGNMENT_OPERATOR_IMPL_VIA_PURE_SWAP(QCollatorSortKey)
29 void swap(QCollatorSortKey &other)
noexcept
32 int compare(
const QCollatorSortKey &key)
const noexcept;
35 QCollatorSortKey(QCollatorSortKeyPrivate*);
37 QExplicitlySharedDataPointer<QCollatorSortKeyPrivate> d;
40 friend bool comparesEqual(
const QCollatorSortKey &lhs,
const QCollatorSortKey &rhs)
noexcept
41 {
return lhs.compare(rhs) == 0; }
42 friend Qt::weak_ordering
43 compareThreeWay(
const QCollatorSortKey &lhs,
const QCollatorSortKey &rhs)
noexcept
44 {
return Qt::compareThreeWay(lhs.compare(rhs), 0); }
45 Q_DECLARE_WEAKLY_ORDERED(QCollatorSortKey)
51 enum class CollationOption {
52 CaseInsensitive = 0x1,
53 IgnorePunctuation = 0x2,
55 DiacriticInsensitive = 0x8,
56 WidthInsensitive = 0x10,
58 Q_DECLARE_FLAGS(CollationOptions, CollationOption)
61 explicit QCollator(
const QLocale &locale);
62 QCollator(
const QCollator &);
64 QCollator &operator=(
const QCollator &);
65 QCollator(QCollator &&other)
noexcept
66 : d(other.d) { other.d =
nullptr; }
67 QT_MOVE_ASSIGNMENT_OPERATOR_IMPL_VIA_MOVE_AND_SWAP(QCollator)
69 void swap(QCollator &other)
noexcept
70 { qt_ptr_swap(d, other.d); }
72 void setLocale(
const QLocale &locale);
73 QLocale locale()
const;
75 Qt::CaseSensitivity caseSensitivity()
const;
76 void setCaseSensitivity(Qt::CaseSensitivity cs);
78 void setNumericMode(
bool on);
79 bool numericMode()
const;
81 void setIgnorePunctuation(
bool on);
82 bool ignorePunctuation()
const;
84 void setOptions(CollationOptions options);
85 CollationOptions options()
const;
87 int compare(
const QString &s1,
const QString &s2)
const
88 {
return compare(QStringView(s1), QStringView(s2)); }
89#if QT_CORE_REMOVED_SINCE(6
, 4
) && QT_POINTER_SIZE != 4
90 int compare(
const QChar *s1,
int len1,
const QChar *s2,
int len2)
const
91 {
return compare(QStringView(s1, len1), QStringView(s2, len2)); }
93 int compare(
const QChar *s1, qsizetype len1,
const QChar *s2, qsizetype len2)
const
94 {
return compare(QStringView(s1, len1), QStringView(s2, len2)); }
96 bool operator()(
const QString &s1,
const QString &s2)
const
97 {
return compare(s1, s2) < 0; }
98 int compare(QStringView s1, QStringView s2)
const;
100 bool operator()(QStringView s1, QStringView s2)
const
101 {
return compare(s1, s2) < 0; }
103 QCollatorSortKey sortKey(
const QString &string)
const;
105 static int defaultCompare(QStringView s1, QStringView s2);
106 static QCollatorSortKey defaultSortKey(QStringView key);
109 friend Q_CORE_EXPORT
bool comparesEqual(
const QCollator &lhs,
const QCollator &rhs)
noexcept;
110 Q_DECLARE_EQUALITY_COMPARABLE(QCollator)
112 mutable QCollatorPrivate *d;
118Q_DECLARE_SHARED(QCollator)
119Q_DECLARE_OPERATORS_FOR_FLAGS(QCollator::CollationOptions)
The QAbstractFileEngineIterator class provides an iterator interface for custom file engines.
virtual ~QAbstractFileEnginePrivate()
QAbstractFileEnginePrivate(QAbstractFileEngine *q)
QFile::FileError fileError
QAbstractFileEngine *const q_ptr
\inmodule QtCore \reentrant
QDirPrivate(const QDirPrivate ©)
void clearCache(MetaDataClearing mode)
void initFileLists(const QDir &dir) const
QString resolveAbsoluteEntry() const
bool operator()(const QDirSortItem &, const QDirSortItem &) const
QDirSortItemComparator(QDir::SortFlags flags, QCollator *coll=nullptr)
int compareStrings(const QString &a, const QString &b, Qt::CaseSensitivity cs) const
Combined button and popup list for selecting options.
std::unique_ptr< QAbstractFileEngine > qt_custom_file_engine_handler_create(const QString &path)
static void appendIfMatchesNonDirListingFlags(const QDirListing::DirEntry &dirEntry, QDir::Filters filters, QFileInfoList &l)
static qsizetype rootLength(QStringView name, QDirPrivate::PathNormalizations flags)
static bool qt_cleanPath(QString *path)
QDebug operator<<(QDebug debug, QDir::Filters filters)
QDebug operator<<(QDebug debug, const QDir &dir)
static QDebug operator<<(QDebug debug, QDir::SortFlags sorting)
bool qt_isPathNormalized(const QString &path, QDirPrivate::PathNormalizations flags) noexcept
bool comparesEqual(const QDir &lhs, const QDir &rhs)
static bool treatAsAbsolute(const QString &path)
static bool checkPermissions(const QDirListing::DirEntry &dirEntry, QDir::Filters filters)
bool qt_normalizePathSegments(QString *path, QDirPrivate::PathNormalizations flags)
static qsizetype findStartOfNonNormalizedPath(const QChar *in, qsizetype i, qsizetype n, QDirPrivate::PathNormalizations flags) noexcept
static bool checkDotOrDotDot(const QDirListing::DirEntry &dirEntry, QDir::Filters filters)
Q_AUTOTEST_EXPORT bool qt_normalizePathSegments(QString *path, QDirPrivate::PathNormalizations flags)
bool qt_isPathNormalized(const QString &path, QDirPrivate::PathNormalizations flags) noexcept
Q_DECL_COLD_FUNCTION bool qCheckFileNameFail(const char *msg, const char *file, int line, const char *function)
Q_CORE_EXPORT bool qt_isCaseSensitive(const QFileSystemEntry &entry, QFileSystemMetaData &data)
bool qCheckFileName(const E &entry, const char *file, int line, const char *function)
QDirSortItem(const QFileInfo &fi, QDir::SortFlags sort)
friend size_t qHash(const QFileSystemNativeId &id, size_t seed=0) noexcept
friend bool operator==(const QFileSystemNativeId &lhs, const QFileSystemNativeId &rhs) noexcept
friend bool operator!=(const QFileSystemNativeId &lhs, const QFileSystemNativeId &rhs) noexcept
bool isValid() const noexcept