Add Qt libs and headers

This commit is contained in:
√(noham)²
2026-05-07 16:41:01 +02:00
parent 18c023605c
commit 2861c25806
1005 changed files with 114575 additions and 7 deletions

View File

@@ -0,0 +1,277 @@
// 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 QABSTRACTANIMATION_P_H
#define QABSTRACTANIMATION_P_H
//
// W A R N I N G
// -------------
//
// This file is not part of the Qt API.
// This header file may change from version to
// version without notice, or even be removed.
//
// We mean it.
//
#include <QtCore/qbasictimer.h>
#include <QtCore/qdatetime.h>
#include <QtCore/qtimer.h>
#include <QtCore/qelapsedtimer.h>
#include <private/qobject_p.h>
#include <private/qproperty_p.h>
#include <qabstractanimation.h>
QT_REQUIRE_CONFIG(animation);
QT_BEGIN_NAMESPACE
class QAnimationGroup;
class QAbstractAnimation;
class Q_CORE_EXPORT QAbstractAnimationPrivate : public QObjectPrivate
{
public:
QAbstractAnimationPrivate();
virtual ~QAbstractAnimationPrivate();
static QAbstractAnimationPrivate *get(QAbstractAnimation *q)
{
return q->d_func();
}
Q_OBJECT_BINDABLE_PROPERTY_WITH_ARGS(QAbstractAnimationPrivate, QAbstractAnimation::State,
state, QAbstractAnimation::Stopped)
void setState(QAbstractAnimation::State state);
void setDirection(QAbstractAnimation::Direction direction)
{
q_func()->setDirection(direction);
}
void emitDirectionChanged() { Q_EMIT q_func()->directionChanged(direction); }
Q_OBJECT_COMPAT_PROPERTY_WITH_ARGS(QAbstractAnimationPrivate, QAbstractAnimation::Direction,
direction, &QAbstractAnimationPrivate::setDirection,
&QAbstractAnimationPrivate::emitDirectionChanged,
QAbstractAnimation::Forward)
void setCurrentTime(int msecs) { q_func()->setCurrentTime(msecs); }
Q_OBJECT_COMPAT_PROPERTY_WITH_ARGS(QAbstractAnimationPrivate, int, totalCurrentTime,
&QAbstractAnimationPrivate::setCurrentTime, 0)
int currentTime = 0;
Q_OBJECT_BINDABLE_PROPERTY_WITH_ARGS(QAbstractAnimationPrivate, int, loopCount, 1)
void emitCurrentLoopChanged() { Q_EMIT q_func()->currentLoopChanged(currentLoop); }
Q_OBJECT_COMPAT_PROPERTY_WITH_ARGS(QAbstractAnimationPrivate, int, currentLoop, nullptr,
&QAbstractAnimationPrivate::emitCurrentLoopChanged, 0)
bool deleteWhenStopped = false;
bool hasRegisteredTimer = false;
bool isPause = false;
bool isGroup = false;
QAnimationGroup *group = nullptr;
private:
Q_DECLARE_PUBLIC(QAbstractAnimation)
};
class QUnifiedTimer;
class QDefaultAnimationDriver : public QAnimationDriver
{
Q_OBJECT
public:
explicit QDefaultAnimationDriver(QUnifiedTimer *timer);
~QDefaultAnimationDriver() override;
protected:
void timerEvent(QTimerEvent *e) override;
private Q_SLOTS:
void startTimer();
void stopTimer();
private:
QBasicTimer m_timer;
QUnifiedTimer *m_unified_timer;
};
class Q_CORE_EXPORT QAnimationDriverPrivate : public QObjectPrivate
{
public:
QAnimationDriverPrivate();
~QAnimationDriverPrivate() override;
QElapsedTimer timer;
bool running = false;
};
class Q_CORE_EXPORT QAbstractAnimationTimer : public QObject
{
Q_OBJECT
public:
QAbstractAnimationTimer();
~QAbstractAnimationTimer() override;
virtual void updateAnimationsTime(qint64 delta) = 0;
virtual void restartAnimationTimer() = 0;
virtual int runningAnimationCount() = 0;
bool isRegistered = false;
bool isPaused = false;
int pauseDuration = 0;
};
class Q_CORE_EXPORT QUnifiedTimer : public QObject
{
Q_OBJECT
private:
QUnifiedTimer();
public:
~QUnifiedTimer() override;
static QUnifiedTimer *instance();
static QUnifiedTimer *instance(bool create);
static void startAnimationTimer(QAbstractAnimationTimer *timer);
static void stopAnimationTimer(QAbstractAnimationTimer *timer);
static void pauseAnimationTimer(QAbstractAnimationTimer *timer, int duration);
static void resumeAnimationTimer(QAbstractAnimationTimer *timer);
//defines the timing interval. Default is DEFAULT_TIMER_INTERVAL
void setTimingInterval(int interval);
/*
this allows to have a consistent timer interval at each tick from the timer
not taking the real time that passed into account.
*/
void setConsistentTiming(bool consistent) { consistentTiming = consistent; }
//these facilitate fine-tuning of complex animations
void setSlowModeEnabled(bool enabled) { slowMode = enabled; }
void setSlowdownFactor(qreal factor) { slowdownFactor = factor; }
void installAnimationDriver(QAnimationDriver *driver);
void uninstallAnimationDriver(QAnimationDriver *driver);
bool canUninstallAnimationDriver(QAnimationDriver *driver);
void restart();
void maybeUpdateAnimationsToCurrentTime();
void updateAnimationTimers();
//useful for profiling/debugging
int runningAnimationCount();
void registerProfilerCallback(void (*cb)(qint64));
void startAnimationDriver();
void stopAnimationDriver();
qint64 elapsed() const;
protected:
void timerEvent(QTimerEvent *) override;
private Q_SLOTS:
void startTimers();
void stopTimer();
private:
friend class QDefaultAnimationDriver;
friend class QAnimationDriver;
QAnimationDriver *driver;
QDefaultAnimationDriver defaultDriver;
QBasicTimer pauseTimer;
QElapsedTimer time;
qint64 lastTick;
int timingInterval;
int currentAnimationIdx;
bool insideTick;
bool insideRestart;
bool consistentTiming;
bool slowMode;
bool startTimersPending;
bool stopTimerPending;
bool allowNegativeDelta;
// This factor will be used to divide the DEFAULT_TIMER_INTERVAL at each tick
// when slowMode is enabled. Setting it to 0 or higher than DEFAULT_TIMER_INTERVAL (16)
// stops all animations.
qreal slowdownFactor;
QList<QAbstractAnimationTimer*> animationTimers, animationTimersToStart;
QList<QAbstractAnimationTimer*> pausedAnimationTimers;
void localRestart();
int closestPausedAnimationTimerTimeToFinish();
void (*profilerCallback)(qint64);
qint64 driverStartTime; // The time the animation driver was started
qint64 temporalDrift; // The delta between animation driver time and wall time.
};
class QAnimationTimer : public QAbstractAnimationTimer
{
Q_OBJECT
private:
QAnimationTimer();
public:
~QAnimationTimer() override;
static QAnimationTimer *instance();
static QAnimationTimer *instance(bool create);
static void registerAnimation(QAbstractAnimation *animation, bool isTopLevel);
static void unregisterAnimation(QAbstractAnimation *animation);
/*
this is used for updating the currentTime of all animations in case the pause
timer is active or, otherwise, only of the animation passed as parameter.
*/
static void ensureTimerUpdate();
/*
this will evaluate the need of restarting the pause timer in case there is still
some pause animations running.
*/
static void updateAnimationTimer();
void restartAnimationTimer() override;
void updateAnimationsTime(qint64 delta) override;
//useful for profiling/debugging
int runningAnimationCount() override { return animations.size(); }
private Q_SLOTS:
void startAnimations();
void stopTimer();
private:
qint64 lastTick;
int currentAnimationIdx;
bool insideTick;
bool startAnimationPending;
bool stopTimerPending;
QList<QAbstractAnimation*> animations, animationsToStart;
// this is the count of running animations that are not a group neither a pause animation
int runningLeafAnimations;
QList<QAbstractAnimation*> runningPauseAnimations;
void registerRunningAnimation(QAbstractAnimation *animation);
void unregisterRunningAnimation(QAbstractAnimation *animation);
int closestPauseAnimationTimeToFinish();
};
QT_END_NAMESPACE
#endif //QABSTRACTANIMATION_P_H

View File

@@ -0,0 +1,41 @@
// 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 QABSTRACTEVENTDISPATCHER_P_H
#define QABSTRACTEVENTDISPATCHER_P_H
//
// W A R N I N G
// -------------
//
// This file is not part of the Qt API. It exists purely as an
// implementation detail. This header file may change from version to
// version without notice, or even be removed.
//
// We mean it.
//
#include "QtCore/qabstracteventdispatcher.h"
#include "private/qobject_p.h"
QT_BEGIN_NAMESPACE
Q_AUTOTEST_EXPORT qsizetype qGlobalPostedEventsCount();
class Q_CORE_EXPORT QAbstractEventDispatcherPrivate : public QObjectPrivate
{
Q_DECLARE_PUBLIC(QAbstractEventDispatcher)
public:
inline QAbstractEventDispatcherPrivate()
{ }
~QAbstractEventDispatcherPrivate() override;
QList<QAbstractNativeEventFilter *> eventFilters;
static int allocateTimerId();
static void releaseTimerId(int id);
};
QT_END_NAMESPACE
#endif // QABSTRACTEVENTDISPATCHER_P_H

View File

@@ -0,0 +1,244 @@
// 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 QABSTRACTFILEENGINE_P_H
#define QABSTRACTFILEENGINE_P_H
//
// W A R N I N G
// -------------
//
// This file is not part of the Qt API. It exists purely as an
// implementation detail. This header file may change from version to
// version without notice, or even be removed.
//
// We mean it.
//
#include <QtCore/private/qglobal_p.h>
#include "QtCore/qfile.h"
#include "QtCore/qdir.h"
#include <optional>
#ifdef open
#error qabstractfileengine_p.h must be included before any header file that defines open
#endif
QT_BEGIN_NAMESPACE
class QVariant;
class QAbstractFileEngineIterator;
class QAbstractFileEnginePrivate;
class Q_CORE_EXPORT QAbstractFileEngine
{
public:
enum FileFlag {
//perms (overlaps the QFile::Permission)
ReadOwnerPerm = 0x4000, WriteOwnerPerm = 0x2000, ExeOwnerPerm = 0x1000,
ReadUserPerm = 0x0400, WriteUserPerm = 0x0200, ExeUserPerm = 0x0100,
ReadGroupPerm = 0x0040, WriteGroupPerm = 0x0020, ExeGroupPerm = 0x0010,
ReadOtherPerm = 0x0004, WriteOtherPerm = 0x0002, ExeOtherPerm = 0x0001,
//types
LinkType = 0x10000,
FileType = 0x20000,
DirectoryType = 0x40000,
BundleType = 0x80000,
//flags
HiddenFlag = 0x0100000,
LocalDiskFlag = 0x0200000,
ExistsFlag = 0x0400000,
RootFlag = 0x0800000,
Refresh = 0x1000000,
//masks
PermsMask = 0x0000FFFF,
TypesMask = 0x000F0000,
FlagsMask = 0x0FF00000,
FileInfoAll = FlagsMask | PermsMask | TypesMask
};
Q_DECLARE_FLAGS(FileFlags, FileFlag)
enum FileName {
DefaultName,
BaseName,
PathName,
AbsoluteName,
AbsolutePathName,
AbsoluteLinkTarget,
CanonicalName,
CanonicalPathName,
BundleName,
JunctionName,
NFileNames // Must be last.
};
enum FileOwner {
OwnerUser,
OwnerGroup
};
enum FileTime {
AccessTime,
BirthTime,
MetadataChangeTime,
ModificationTime
};
virtual ~QAbstractFileEngine();
virtual bool open(QIODevice::OpenMode openMode,
std::optional<QFile::Permissions> permissions = std::nullopt);
virtual bool close();
virtual bool flush();
virtual bool syncToDisk();
virtual qint64 size() const;
virtual qint64 pos() const;
virtual bool seek(qint64 pos);
virtual bool isSequential() const;
virtual bool remove();
virtual bool copy(const QString &newName);
virtual bool rename(const QString &newName);
virtual bool renameOverwrite(const QString &newName);
virtual bool link(const QString &newName);
virtual bool mkdir(const QString &dirName, bool createParentDirectories,
std::optional<QFile::Permissions> permissions = std::nullopt) const;
virtual bool rmdir(const QString &dirName, bool recurseParentDirectories) const;
virtual bool setSize(qint64 size);
virtual bool caseSensitive() const;
virtual bool isRelativePath() const;
virtual QStringList entryList(QDir::Filters filters, const QStringList &filterNames) const;
virtual FileFlags fileFlags(FileFlags type=FileInfoAll) const;
virtual bool setPermissions(uint perms);
virtual QByteArray id() const;
virtual QString fileName(FileName file=DefaultName) const;
virtual uint ownerId(FileOwner) const;
virtual QString owner(FileOwner) const;
virtual bool setFileTime(const QDateTime &newDate, FileTime time);
virtual QDateTime fileTime(FileTime time) const;
virtual void setFileName(const QString &file);
virtual int handle() const;
virtual bool cloneTo(QAbstractFileEngine *target);
bool atEnd() const;
uchar *map(qint64 offset, qint64 size, QFile::MemoryMapFlags flags);
bool unmap(uchar *ptr);
typedef QAbstractFileEngineIterator Iterator;
virtual Iterator *beginEntryList(QDir::Filters filters, const QStringList &filterNames);
virtual Iterator *endEntryList();
virtual qint64 read(char *data, qint64 maxlen);
virtual qint64 readLine(char *data, qint64 maxlen);
virtual qint64 write(const char *data, qint64 len);
QFile::FileError error() const;
QString errorString() const;
enum Extension {
AtEndExtension,
FastReadLineExtension,
MapExtension,
UnMapExtension
};
class ExtensionOption
{};
class ExtensionReturn
{};
class MapExtensionOption : public ExtensionOption {
public:
qint64 offset;
qint64 size;
QFile::MemoryMapFlags flags;
};
class MapExtensionReturn : public ExtensionReturn {
public:
uchar *address;
};
class UnMapExtensionOption : public ExtensionOption {
public:
uchar *address;
};
virtual bool extension(Extension extension, const ExtensionOption *option = nullptr, ExtensionReturn *output = nullptr);
virtual bool supportsExtension(Extension extension) const;
// Factory
static QAbstractFileEngine *create(const QString &fileName);
protected:
void setError(QFile::FileError error, const QString &str);
QAbstractFileEngine();
QAbstractFileEngine(QAbstractFileEnginePrivate &);
QScopedPointer<QAbstractFileEnginePrivate> d_ptr;
private:
Q_DECLARE_PRIVATE(QAbstractFileEngine)
Q_DISABLE_COPY_MOVE(QAbstractFileEngine)
};
Q_DECLARE_OPERATORS_FOR_FLAGS(QAbstractFileEngine::FileFlags)
class Q_CORE_EXPORT QAbstractFileEngineHandler
{
public:
QAbstractFileEngineHandler();
virtual ~QAbstractFileEngineHandler();
virtual QAbstractFileEngine *create(const QString &fileName) const = 0;
};
class QAbstractFileEngineIteratorPrivate;
class Q_CORE_EXPORT QAbstractFileEngineIterator
{
public:
QAbstractFileEngineIterator(QDir::Filters filters, const QStringList &nameFilters);
virtual ~QAbstractFileEngineIterator();
virtual QString next() = 0;
virtual bool hasNext() const = 0;
QString path() const;
QStringList nameFilters() const;
QDir::Filters filters() const;
virtual QString currentFileName() const = 0;
virtual QFileInfo currentFileInfo() const;
virtual QString currentFilePath() const;
protected:
enum EntryInfoType {
};
virtual QVariant entryInfo(EntryInfoType type) const;
private:
Q_DISABLE_COPY_MOVE(QAbstractFileEngineIterator)
friend class QDirIterator;
friend class QDirIteratorPrivate;
void setPath(const QString &path);
QScopedPointer<QAbstractFileEngineIteratorPrivate> d;
};
class QAbstractFileEnginePrivate
{
public:
inline QAbstractFileEnginePrivate()
: fileError(QFile::UnspecifiedError)
{
}
inline virtual ~QAbstractFileEnginePrivate() { }
QFile::FileError fileError;
QString errorString;
QAbstractFileEngine *q_ptr;
Q_DECLARE_PUBLIC(QAbstractFileEngine)
};
QAbstractFileEngine *qt_custom_file_engine_handler_create(const QString &path);
QT_END_NAMESPACE
#endif // QABSTRACTFILEENGINE_P_H

View File

@@ -0,0 +1,176 @@
// 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 QABSTRACTITEMMODEL_P_H
#define QABSTRACTITEMMODEL_P_H
//
// W A R N I N G
// -------------
//
// This file is not part of the Qt API. It exists for the convenience
// of QAbstractItemModel*. This header file may change from version
// to version without notice, or even be removed.
//
// We mean it.
//
//
#include "QtCore/qabstractitemmodel.h"
#include "QtCore/private/qobject_p.h"
#include "QtCore/qstack.h"
#include "QtCore/qset.h"
#include "QtCore/qhash.h"
QT_BEGIN_NAMESPACE
QT_REQUIRE_CONFIG(itemmodel);
class QPersistentModelIndexData
{
public:
QPersistentModelIndexData() {}
QPersistentModelIndexData(const QModelIndex &idx) : index(idx) {}
QModelIndex index;
QAtomicInt ref;
static QPersistentModelIndexData *create(const QModelIndex &index);
static void destroy(QPersistentModelIndexData *data);
};
class Q_CORE_EXPORT QAbstractItemModelPrivate : public QObjectPrivate
{
Q_DECLARE_PUBLIC(QAbstractItemModel)
public:
QAbstractItemModelPrivate();
~QAbstractItemModelPrivate();
void removePersistentIndexData(QPersistentModelIndexData *data);
void movePersistentIndexes(const QList<QPersistentModelIndexData *> &indexes, int change, const QModelIndex &parent,
Qt::Orientation orientation);
void rowsAboutToBeInserted(const QModelIndex &parent, int first, int last);
void rowsInserted(const QModelIndex &parent, int first, int last);
void rowsAboutToBeRemoved(const QModelIndex &parent, int first, int last);
void rowsRemoved(const QModelIndex &parent, int first, int last);
void columnsAboutToBeInserted(const QModelIndex &parent, int first, int last);
void columnsInserted(const QModelIndex &parent, int first, int last);
void columnsAboutToBeRemoved(const QModelIndex &parent, int first, int last);
void columnsRemoved(const QModelIndex &parent, int first, int last);
static QAbstractItemModel *staticEmptyModel();
static bool variantLessThan(const QVariant &v1, const QVariant &v2);
void itemsAboutToBeMoved(const QModelIndex &srcParent, int srcFirst, int srcLast, const QModelIndex &destinationParent, int destinationChild, Qt::Orientation);
void itemsMoved(const QModelIndex &srcParent, int srcFirst, int srcLast, const QModelIndex &destinationParent, int destinationChild, Qt::Orientation orientation);
bool allowMove(const QModelIndex &srcParent, int srcFirst, int srcLast, const QModelIndex &destinationParent, int destinationChild, Qt::Orientation orientation);
// ugly hack for QTreeModel, see QTBUG-94546
virtual void executePendingOperations() const;
inline QModelIndex createIndex(int row, int column, void *data = nullptr) const {
return q_func()->createIndex(row, column, data);
}
inline QModelIndex createIndex(int row, int column, int id) const {
return q_func()->createIndex(row, column, id);
}
inline bool indexValid(const QModelIndex &index) const {
return (index.row() >= 0) && (index.column() >= 0) && (index.model() == q_func());
}
void invalidatePersistentIndexes();
void invalidatePersistentIndex(const QModelIndex &index);
struct Change {
constexpr Change() : parent(), first(-1), last(-1), needsAdjust(false) {}
constexpr Change(const QModelIndex &p, int f, int l) : parent(p), first(f), last(l), needsAdjust(false) {}
QModelIndex parent;
int first, last;
// In cases such as this:
// - A
// - B
// - C
// - - D
// - - E
// - - F
//
// If B is moved to above E, C is the source parent in the signal and its row is 2. When the move is
// completed however, C is at row 1 and there is no row 2 at the same level in the model at all.
// The QModelIndex is adjusted to correct that in those cases before reporting it though the
// rowsMoved signal.
bool needsAdjust;
constexpr bool isValid() const { return first >= 0 && last >= 0; }
};
QStack<Change> changes;
struct Persistent {
Persistent() {}
QMultiHash<QModelIndex, QPersistentModelIndexData *> indexes;
QStack<QList<QPersistentModelIndexData *>> moved;
QStack<QList<QPersistentModelIndexData *>> invalidated;
void insertMultiAtEnd(const QModelIndex& key, QPersistentModelIndexData *data);
} persistent;
static const QHash<int,QByteArray> &defaultRoleNames();
static bool isVariantLessThan(const QVariant &left, const QVariant &right,
Qt::CaseSensitivity cs = Qt::CaseSensitive, bool isLocaleAware = false);
};
Q_DECLARE_TYPEINFO(QAbstractItemModelPrivate::Change, Q_RELOCATABLE_TYPE);
namespace QtPrivate {
/*!
\internal
This is a workaround for QTBUG-75172.
Some predefined model roles are supposed to use certain enum/flag
types (e.g. fetching Qt::TextAlignmentRole is supposed to return a
variant containing a Qt::Alignment object).
For historical reasons, a plain `int` was used sometimes. This is
surprising to end-users and also sloppy on Qt's part; users were
forced to use `int` rather than the correct datatype.
This function tries both the "right" type and plain `int`, for a
given QVariant. This fixes the problem (using the correct datatype)
but also keeps compatibility with existing code using `int`.
### Qt 7: get rid of this. Always use the correct datatype.
*/
template <typename T>
T legacyEnumValueFromModelData(const QVariant &data)
{
static_assert(std::is_enum_v<T>);
if (data.userType() == qMetaTypeId<T>()) {
return data.value<T>();
} else if (std::is_same_v<std::underlying_type_t<T>, int> ||
std::is_same_v<std::underlying_type_t<T>, uint>) {
return T(data.toInt());
}
return T();
}
template <typename T>
T legacyFlagValueFromModelData(const QVariant &data)
{
if (data.userType() == qMetaTypeId<T>()) {
return data.value<T>();
} else if (std::is_same_v<std::underlying_type_t<typename T::enum_type>, int> ||
std::is_same_v<std::underlying_type_t<typename T::enum_type>, uint>) {
return T::fromInt(data.toInt());
}
return T();
}
} // namespace QtPrivate
QT_END_NAMESPACE
#endif // QABSTRACTITEMMODEL_P_H

View File

@@ -0,0 +1,66 @@
// 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 QABSTRACTPROXYMODEL_P_H
#define QABSTRACTPROXYMODEL_P_H
//
// W A R N I N G
// -------------
//
// This file is not part of the Qt API. It exists for the convenience
// of QAbstractItemModel*. This header file may change from version
// to version without notice, or even be removed.
//
// We mean it.
//
//
#include "private/qabstractitemmodel_p.h"
#include "private/qproperty_p.h"
QT_REQUIRE_CONFIG(proxymodel);
QT_BEGIN_NAMESPACE
class Q_CORE_EXPORT QAbstractProxyModelPrivate : public QAbstractItemModelPrivate
{
Q_DECLARE_PUBLIC(QAbstractProxyModel)
public:
QAbstractProxyModelPrivate()
: QAbstractItemModelPrivate(),
sourceHadZeroRows(false),
sourceHadZeroColumns(false)
{}
void setModelForwarder(QAbstractItemModel *sourceModel)
{
q_func()->setSourceModel(sourceModel);
}
void modelChangedForwarder()
{
Q_EMIT q_func()->sourceModelChanged(QAbstractProxyModel::QPrivateSignal());
}
QAbstractItemModel *getModelForwarder() const { return q_func()->sourceModel(); }
Q_OBJECT_COMPAT_PROPERTY_WITH_ARGS(QAbstractProxyModelPrivate, QAbstractItemModel *, model,
&QAbstractProxyModelPrivate::setModelForwarder,
&QAbstractProxyModelPrivate::modelChangedForwarder,
&QAbstractProxyModelPrivate::getModelForwarder, nullptr)
virtual void _q_sourceModelDestroyed();
void _q_sourceModelRowsAboutToBeInserted(const QModelIndex &parent, int first, int last);
void _q_sourceModelRowsInserted(const QModelIndex &parent, int first, int last);
void _q_sourceModelRowsRemoved(const QModelIndex &parent, int first, int last);
void _q_sourceModelColumnsAboutToBeInserted(const QModelIndex &parent, int first, int last);
void _q_sourceModelColumnsInserted(const QModelIndex &parent, int first, int last);
void _q_sourceModelColumnsRemoved(const QModelIndex &parent, int first, int last);
void mapDropCoordinatesToSource(int row, int column, const QModelIndex &parent,
int *source_row, int *source_column, QModelIndex *source_parent) const;
unsigned int sourceHadZeroRows : 1;
unsigned int sourceHadZeroColumns : 1;
};
QT_END_NAMESPACE
#endif // QABSTRACTPROXYMODEL_P_H

View File

@@ -0,0 +1,58 @@
// 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 QANIMATIONGROUP_P_H
#define QANIMATIONGROUP_P_H
//
// W A R N I N G
// -------------
//
// This file is not part of the Qt API. It exists purely as an
// implementation detail. This header file may change from version to
// version without notice, or even be removed.
//
// We mean it.
//
#include "qanimationgroup.h"
#include <QtCore/qlist.h>
#include "private/qabstractanimation_p.h"
QT_REQUIRE_CONFIG(animation);
QT_BEGIN_NAMESPACE
class QAnimationGroupPrivate : public QAbstractAnimationPrivate
{
Q_DECLARE_PUBLIC(QAnimationGroup)
public:
QAnimationGroupPrivate()
{
isGroup = true;
}
virtual void animationInsertedAt(qsizetype) { }
virtual void animationRemoved(qsizetype, QAbstractAnimation *);
void clear(bool onDestruction);
void disconnectUncontrolledAnimation(QAbstractAnimation *anim)
{
//0 for the signal here because we might be called from the animation destructor
QObject::disconnect(anim, nullptr, q_func(), SLOT(_q_uncontrolledAnimationFinished()));
}
void connectUncontrolledAnimation(QAbstractAnimation *anim)
{
QObject::connect(anim, SIGNAL(finished()), q_func(), SLOT(_q_uncontrolledAnimationFinished()));
}
QList<QAbstractAnimation *> animations;
};
QT_END_NAMESPACE
#endif //QANIMATIONGROUP_P_H

View File

@@ -0,0 +1,114 @@
// Copyright (C) 2022 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 QATOMICSCOPEDVALUEROLLBACK_P_H
#define QATOMICSCOPEDVALUEROLLBACK_P_H
//
// W A R N I N G
// -------------
//
// This file is not part of the Qt API. It exists for the convenience
// of qapplication_*.cpp, qwidget*.cpp and qfiledialog.cpp. This header
// file may change from version to version without notice, or even be removed.
//
// We mean it.
//
#include <QtCore/qglobal.h>
#include <QtCore/qatomic.h>
#include <atomic>
QT_BEGIN_NAMESPACE
template <typename T>
class [[nodiscard]] QAtomicScopedValueRollback
{
std::atomic<T> &m_atomic;
T m_value;
std::memory_order m_mo;
Q_DISABLE_COPY_MOVE(QAtomicScopedValueRollback)
constexpr std::memory_order store_part(std::memory_order mo) noexcept
{
switch (mo) {
case std::memory_order_relaxed:
case std::memory_order_consume:
case std::memory_order_acquire: return std::memory_order_relaxed;
case std::memory_order_release:
case std::memory_order_acq_rel: return std::memory_order_release;
case std::memory_order_seq_cst: return std::memory_order_seq_cst;
}
// GCC 8.x does not tread __builtin_unreachable() as constexpr
#if !defined(Q_CC_GNU_ONLY) || (Q_CC_GNU >= 900)
// NOLINTNEXTLINE(qt-use-unreachable-return): Triggers on Clang, breaking GCC 8
Q_UNREACHABLE();
#endif
return std::memory_order_seq_cst;
}
public:
//
// std::atomic:
//
explicit constexpr
QAtomicScopedValueRollback(std::atomic<T> &var,
std::memory_order mo = std::memory_order_seq_cst)
: m_atomic(var), m_value(var.load(mo)), m_mo(mo) {}
explicit constexpr
QAtomicScopedValueRollback(std::atomic<T> &var, T value,
std::memory_order mo = std::memory_order_seq_cst)
: m_atomic(var), m_value(var.exchange(value, mo)), m_mo(mo) {}
//
// Q(Basic)AtomicInteger:
//
explicit constexpr
QAtomicScopedValueRollback(QBasicAtomicInteger<T> &var,
std::memory_order mo = std::memory_order_seq_cst)
: QAtomicScopedValueRollback(var._q_value, mo) {}
explicit constexpr
QAtomicScopedValueRollback(QBasicAtomicInteger<T> &var, T value,
std::memory_order mo = std::memory_order_seq_cst)
: QAtomicScopedValueRollback(var._q_value, value, mo) {}
//
// Q(Basic)AtomicPointer:
//
explicit constexpr
QAtomicScopedValueRollback(QBasicAtomicPointer<std::remove_pointer_t<T>> &var,
std::memory_order mo = std::memory_order_seq_cst)
: QAtomicScopedValueRollback(var._q_value, mo) {}
explicit constexpr
QAtomicScopedValueRollback(QBasicAtomicPointer<std::remove_pointer_t<T>> &var, T value,
std::memory_order mo = std::memory_order_seq_cst)
: QAtomicScopedValueRollback(var._q_value, value, mo) {}
#if __cpp_constexpr >= 201907L
constexpr
#endif
~QAtomicScopedValueRollback()
{
m_atomic.store(m_value, store_part(m_mo));
}
constexpr void commit()
{
m_value = m_atomic.load(m_mo);
}
};
template <typename T>
QAtomicScopedValueRollback(QBasicAtomicPointer<T> &)
-> QAtomicScopedValueRollback<T*>;
template <typename T>
QAtomicScopedValueRollback(QBasicAtomicPointer<T> &, std::memory_order)
-> QAtomicScopedValueRollback<T*>;
QT_END_NAMESPACE
#endif // QATOMICASCOPEDVALUEROLLBACK_P_H

View File

@@ -0,0 +1,29 @@
// 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 QBYTEARRAY_P_H
#define QBYTEARRAY_P_H
//
// W A R N I N G
// -------------
//
// This file is not part of the Qt API. It exists for the convenience
// of other Qt classes. This header file may change from version to
// version without notice, or even be removed.
//
// We mean it.
//
#include <QtCore/qbytearray.h>
#include "private/qtools_p.h"
QT_BEGIN_NAMESPACE
// -1 because of the terminating NUL
constexpr qsizetype MaxByteArraySize = MaxAllocSize - sizeof(std::remove_pointer<QByteArray::DataPointer>::type) - 1;
constexpr qsizetype MaxStringSize = (MaxAllocSize - sizeof(std::remove_pointer<QByteArray::DataPointer>::type)) / 2 - 1;
QT_END_NAMESPACE
#endif // QBYTEARRAY_P_H

View File

@@ -0,0 +1,285 @@
// 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 QBYTEDATA_P_H
#define QBYTEDATA_P_H
//
// W A R N I N G
// -------------
//
// This file is not part of the Qt API. It exists purely as an
// implementation detail. This header file may change from version to
// version without notice, or even be removed.
//
// We mean it.
//
#include <QtCore/private/qglobal_p.h>
#include <qbytearray.h>
#include <QtCore/qlist.h>
#include <climits>
QT_BEGIN_NAMESPACE
// this class handles a list of QByteArrays. It is a variant of QRingBuffer
// that avoid malloc/realloc/memcpy.
class QByteDataBuffer
{
private:
QList<QByteArray> buffers;
qint64 bufferCompleteSize = 0;
qint64 firstPos = 0;
public:
static inline void popFront(QByteArray &ba, qint64 n)
{
ba = QByteArray(ba.constData() + n, ba.size() - n);
}
inline void squeezeFirst()
{
if (!buffers.isEmpty() && firstPos > 0) {
popFront(buffers.first(), firstPos);
firstPos = 0;
}
}
inline void append(const QByteDataBuffer& other)
{
if (other.isEmpty())
return;
buffers.append(other.buffers);
bufferCompleteSize += other.byteAmount();
if (other.firstPos > 0)
popFront(buffers[bufferCount() - other.bufferCount()], other.firstPos);
}
inline void append(QByteDataBuffer &&other)
{
if (other.isEmpty())
return;
auto otherBufferCount = other.bufferCount();
auto otherByteAmount = other.byteAmount();
buffers.append(std::move(other.buffers));
bufferCompleteSize += otherByteAmount;
if (other.firstPos > 0)
popFront(buffers[bufferCount() - otherBufferCount], other.firstPos);
}
inline void append(const QByteArray& bd)
{
append(QByteArray(bd));
}
inline void append(QByteArray &&bd)
{
if (bd.isEmpty())
return;
bufferCompleteSize += bd.size();
buffers.append(std::move(bd));
}
inline void prepend(const QByteArray& bd)
{
prepend(QByteArray(bd));
}
inline void prepend(QByteArray &&bd)
{
if (bd.isEmpty())
return;
squeezeFirst();
bufferCompleteSize += bd.size();
buffers.prepend(std::move(bd));
}
// return the first QByteData. User of this function has to free() its .data!
// preferably use this function to read data.
inline QByteArray read()
{
Q_ASSERT(!isEmpty());
squeezeFirst();
bufferCompleteSize -= buffers.first().size();
return buffers.takeFirst();
}
// return everything. User of this function has to free() its .data!
// avoid to use this, it might malloc and memcpy.
inline QByteArray readAll()
{
return read(byteAmount());
}
// return amount. User of this function has to free() its .data!
// avoid to use this, it might malloc and memcpy.
inline QByteArray read(qint64 amount)
{
amount = qMin(byteAmount(), amount);
if constexpr (sizeof(qsizetype) == sizeof(int)) { // 32-bit
// While we cannot overall have more than INT_MAX memory allocated,
// the QByteArrays we hold may be shared copies of each other,
// causing byteAmount() to exceed INT_MAX.
if (amount > INT_MAX)
qBadAlloc(); // what resize() would do if it saw past the truncation
}
QByteArray byteData;
byteData.resize(qsizetype(amount));
read(byteData.data(), byteData.size());
return byteData;
}
// return amount bytes. User of this function has to free() its .data!
// avoid to use this, it will memcpy.
qint64 read(char* dst, qint64 amount)
{
amount = qMin(amount, byteAmount());
qint64 originalAmount = amount;
char *writeDst = dst;
while (amount > 0) {
const QByteArray &first = buffers.first();
qint64 firstSize = first.size() - firstPos;
if (amount >= firstSize) {
// take it completely
bufferCompleteSize -= firstSize;
amount -= firstSize;
memcpy(writeDst, first.constData() + firstPos, firstSize);
writeDst += firstSize;
firstPos = 0;
buffers.takeFirst();
} else {
// take a part of it & it is the last one to take
bufferCompleteSize -= amount;
memcpy(writeDst, first.constData() + firstPos, amount);
firstPos += amount;
amount = 0;
}
}
return originalAmount;
}
/*!
\internal
Returns a view into the first QByteArray contained inside,
ignoring any already read data. Call advanceReadPointer()
to advance the view forward. When a QByteArray is exhausted
the view returned by this function will view into another
QByteArray if any. Returns a default constructed view if
no data is available.
\sa advanceReadPointer
*/
QByteArrayView readPointer() const
{
if (isEmpty())
return {};
return { buffers.first().constData() + qsizetype(firstPos),
buffers.first().size() - qsizetype(firstPos) };
}
/*!
\internal
Advances the read pointer by \a distance.
\sa readPointer
*/
void advanceReadPointer(qint64 distance)
{
qint64 newPos = firstPos + distance;
if (isEmpty()) {
newPos = 0;
} else if (auto size = buffers.first().size(); newPos >= size) {
while (newPos >= size) {
bufferCompleteSize -= (size - firstPos);
newPos -= size;
buffers.pop_front();
if (isEmpty()) {
size = 0;
newPos = 0;
break;
}
size = buffers.front().size();
}
bufferCompleteSize -= newPos;
} else {
bufferCompleteSize -= newPos - firstPos;
}
firstPos = newPos;
}
inline char getChar()
{
Q_ASSERT_X(!isEmpty(), "QByteDataBuffer::getChar",
"Cannot read a char from an empty buffer!");
char c;
read(&c, 1);
return c;
}
inline void clear()
{
buffers.clear();
bufferCompleteSize = 0;
firstPos = 0;
}
// The byte count of all QByteArrays
inline qint64 byteAmount() const
{
return bufferCompleteSize;
}
// the number of QByteArrays
qsizetype bufferCount() const
{
return buffers.size();
}
inline bool isEmpty() const
{
return byteAmount() == 0;
}
inline qint64 sizeNextBlock() const
{
if (buffers.isEmpty())
return 0;
else
return buffers.first().size() - firstPos;
}
QByteArray &operator[](qsizetype i)
{
if (i == 0)
squeezeFirst();
return buffers[i];
}
inline bool canReadLine() const {
qsizetype i = 0;
if (i < buffers.size()) {
if (buffers.at(i).indexOf('\n', firstPos) != -1)
return true;
++i;
for (; i < buffers.size(); i++)
if (buffers.at(i).contains('\n'))
return true;
}
return false;
}
};
QT_END_NAMESPACE
#endif // QBYTEDATA_P_H

View File

@@ -0,0 +1,134 @@
// Copyright (C) 2021 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 QCALENDAR_BACKEND_P_H
#define QCALENDAR_BACKEND_P_H
//
// W A R N I N G
// -------------
//
// This file is not part of the Qt API. It exists for the convenience
// of calendar implementations. This header file may change from version to
// version without notice, or even be removed.
//
// We mean it.
//
#include <QtCore/qobjectdefs.h>
#include <QtCore/qcalendar.h>
#include <QtCore/qstringlist.h>
#include <QtCore/qstring.h>
#include <QtCore/qmap.h>
#include <QtCore/qanystringview.h>
#include <QtCore/private/qlocale_p.h>
QT_BEGIN_NAMESPACE
namespace QtPrivate {
class QCalendarRegistry;
}
// Locale-related parts, mostly handled in ../text/qlocale.cpp
struct QCalendarLocale {
quint16 m_language_id, m_script_id, m_territory_id;
#define rangeGetter(name) \
QLocaleData::DataRange name() const { return { m_ ## name ## _idx, m_ ## name ## _size }; }
rangeGetter(longMonthStandalone) rangeGetter(longMonth)
rangeGetter(shortMonthStandalone) rangeGetter(shortMonth)
rangeGetter(narrowMonthStandalone) rangeGetter(narrowMonth)
#undef rangeGetter
// Month name indexes:
quint16 m_longMonthStandalone_idx, m_longMonth_idx;
quint16 m_shortMonthStandalone_idx, m_shortMonth_idx;
quint16 m_narrowMonthStandalone_idx, m_narrowMonth_idx;
// Twelve long month names (separated by commas) can add up to more than 256
// QChars - e.g. kde_TZ gets to 264.
quint16 m_longMonthStandalone_size, m_longMonth_size;
quint8 m_shortMonthStandalone_size, m_shortMonth_size;
quint8 m_narrowMonthStandalone_size, m_narrowMonth_size;
};
// Partial implementation, of methods with common forms, in qcalendar.cpp
class Q_CORE_EXPORT QCalendarBackend
{
friend class QCalendar;
friend class QtPrivate::QCalendarRegistry;
public:
virtual ~QCalendarBackend();
virtual QString name() const = 0;
QStringList names() const;
QCalendar::System calendarSystem() const;
QCalendar::SystemId calendarId() const { return m_id; }
// Date queries:
virtual int daysInMonth(int month, int year = QCalendar::Unspecified) const = 0;
virtual int daysInYear(int year) const;
virtual int monthsInYear(int year) const;
virtual bool isDateValid(int year, int month, int day) const;
// Properties of the calendar:
virtual bool isLeapYear(int year) const = 0;
virtual bool isLunar() const = 0;
virtual bool isLuniSolar() const = 0;
virtual bool isSolar() const = 0;
virtual bool isProleptic() const;
virtual bool hasYearZero() const;
virtual int maximumDaysInMonth() const;
virtual int minimumDaysInMonth() const;
virtual int maximumMonthsInYear() const;
// Julian Day conversions:
virtual bool dateToJulianDay(int year, int month, int day, qint64 *jd) const = 0;
virtual QCalendar::YearMonthDay julianDayToDate(qint64 jd) const = 0;
// Day of week and week numbering:
virtual int dayOfWeek(qint64 jd) const;
// Names of months and week-days (implemented in qlocale.cpp):
virtual QString monthName(const QLocale &locale, int month, int year,
QLocale::FormatType format) const;
virtual QString standaloneMonthName(const QLocale &locale, int month, int year,
QLocale::FormatType format) const;
virtual QString weekDayName(const QLocale &locale, int day,
QLocale::FormatType format) const;
virtual QString standaloneWeekDayName(const QLocale &locale, int day,
QLocale::FormatType format) const;
// Formatting of date-times (implemented in qlocale.cpp):
virtual QString dateTimeToString(QStringView format, const QDateTime &datetime,
QDate dateOnly, QTime timeOnly,
const QLocale &locale) const;
bool isGregorian() const;
QCalendar::SystemId registerCustomBackend(const QStringList &names);
// Calendar enumeration by name:
static QStringList availableCalendars();
protected:
// Locale support:
virtual const QCalendarLocale *localeMonthIndexData() const = 0;
virtual const char16_t *localeMonthData() const = 0;
private:
QCalendar::SystemId m_id;
void setIndex(size_t index);
// QCalendar's access to its registry:
static const QCalendarBackend *fromName(QAnyStringView name);
static const QCalendarBackend *fromId(QCalendar::SystemId id);
// QCalendar's access to singletons:
static const QCalendarBackend *fromEnum(QCalendar::System system);
static const QCalendarBackend *gregorian();
};
QT_END_NAMESPACE
#endif // QCALENDAR_BACKEND_P_H

View File

@@ -0,0 +1,48 @@
// Copyright (C) 2022 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 QCALENDARMATH_P_H
#define QCALENDARMATH_P_H
//
// W A R N I N G
// -------------
//
// This file is not part of the Qt API. It exists for the convenience
// of q*calendar.cpp. This header file may change from version to version
// without notice, or even be removed.
//
// We mean it.
//
#include <QtCore/private/qglobal_p.h>
QT_BEGIN_NAMESPACE
namespace QRoundingDown {
/*
Division, rounding down (rather than towards zero).
From C++11 onwards, integer division is defined to round towards zero, so we
can rely on that when implementing this. This is only used with denominator b
> 0, so we only have to treat negative numerator, a, specially.
If a is a multiple of b, adding 1 before and subtracting it after dividing by
b gets us to where we should be (albeit by an eccentric path), since the
adding caused rounding up, undone by the subtracting. Otherwise, adding 1
doesn't change the result of dividing by b; and we want one less than that
result. This is equivalent to subtracting b - 1 and simply dividing, except
when that subtraction would underflow.
*/
template<typename Int> constexpr Int qDiv(Int a, unsigned b)
{ return a < 0 ? (a + 1) / int(b) - 1 : a / int(b); }
template<typename Int> constexpr Int qMod(Int a, unsigned b)
{ return a - qDiv(a, b) * b; }
} // QRoundingDown
QT_END_NAMESPACE
#endif // QCALENDARMATH_P_H

View File

@@ -0,0 +1,49 @@
// Copyright (C) 2018 Intel Corporation.
// Copyright (C) 2019 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 QCBORCOMMON_P_H
#define QCBORCOMMON_P_H
#include "qcborcommon.h"
#include "private/qglobal_p.h"
//
// W A R N I N G
// -------------
//
// This file is not part of the Qt API. It exists purely as an
// implementation detail. This header file may change from version to
// version without notice, or even be removed.
//
// We mean it.
//
QT_BEGIN_NAMESPACE
#ifdef QT_NO_DEBUG
# define NDEBUG 1
#endif
#undef assert
#define assert Q_ASSERT
QT_WARNING_PUSH
QT_WARNING_DISABLE_GCC("-Wunused-function")
QT_WARNING_DISABLE_CLANG("-Wunused-function")
QT_WARNING_DISABLE_CLANG("-Wundefined-internal")
#define CBOR_NO_VALIDATION_API 1
#define CBOR_NO_PRETTY_API 1
#define CBOR_API static inline
#define CBOR_PRIVATE_API static inline
#define CBOR_INLINE_API static inline
#include <cbor.h>
QT_WARNING_POP
Q_DECLARE_TYPEINFO(CborValue, Q_PRIMITIVE_TYPE);
QT_END_NAMESPACE
#endif // QCBORCOMMON_P_H

View File

@@ -0,0 +1,449 @@
// Copyright (C) 2020 Intel Corporation.
// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only
#ifndef QCBORVALUE_P_H
#define QCBORVALUE_P_H
//
// W A R N I N G
// -------------
//
// This file is not part of the Qt API.
// This header file may change from version to
// version without notice, or even be removed.
//
// We mean it.
//
#include "qcborvalue.h"
#if QT_CONFIG(cborstreamreader)
# include "qcborstreamreader.h"
#endif
#include <private/qglobal_p.h>
#include <private/qstringconverter_p.h>
#include <math.h>
QT_BEGIN_NAMESPACE
namespace QtCbor {
struct Undefined {};
struct Element
{
enum ValueFlag : quint32 {
IsContainer = 0x0001,
HasByteData = 0x0002,
StringIsUtf16 = 0x0004,
StringIsAscii = 0x0008
};
Q_DECLARE_FLAGS(ValueFlags, ValueFlag)
union {
qint64 value;
QCborContainerPrivate *container;
};
QCborValue::Type type;
ValueFlags flags = {};
Element(qint64 v = 0, QCborValue::Type t = QCborValue::Undefined, ValueFlags f = {})
: value(v), type(t), flags(f)
{}
Element(QCborContainerPrivate *d, QCborValue::Type t, ValueFlags f = {})
: container(d), type(t), flags(f | IsContainer)
{}
double fpvalue() const
{
double d;
memcpy(&d, &value, sizeof(d));
return d;
}
};
Q_DECLARE_OPERATORS_FOR_FLAGS(Element::ValueFlags)
static_assert(sizeof(Element) == 16);
struct ByteData
{
QByteArray::size_type len;
const char *byte() const { return reinterpret_cast<const char *>(this + 1); }
char *byte() { return reinterpret_cast<char *>(this + 1); }
const QChar *utf16() const { return reinterpret_cast<const QChar *>(this + 1); }
QChar *utf16() { return reinterpret_cast<QChar *>(this + 1); }
QByteArray toByteArray() const { return QByteArray(byte(), len); }
QString toString() const { return QString(utf16(), len / 2); }
QString toUtf8String() const { return QString::fromUtf8(byte(), len); }
QByteArray asByteArrayView() const { return QByteArray::fromRawData(byte(), len); }
QLatin1StringView asLatin1() const { return {byte(), len}; }
QUtf8StringView asUtf8StringView() const { return QUtf8StringView(byte(), len); }
QStringView asStringView() const{ return QStringView(utf16(), len / 2); }
QString asQStringRaw() const { return QString::fromRawData(utf16(), len / 2); }
};
static_assert(std::is_trivial<ByteData>::value);
static_assert(std::is_standard_layout<ByteData>::value);
} // namespace QtCbor
Q_DECLARE_TYPEINFO(QtCbor::Element, Q_PRIMITIVE_TYPE);
class QCborContainerPrivate : public QSharedData
{
friend class QExplicitlySharedDataPointer<QCborContainerPrivate>;
~QCborContainerPrivate();
public:
enum ContainerDisposition { CopyContainer, MoveContainer };
QByteArray::size_type usedData = 0;
QByteArray data;
QList<QtCbor::Element> elements;
void deref() { if (!ref.deref()) delete this; }
void compact(qsizetype reserved);
static QCborContainerPrivate *clone(QCborContainerPrivate *d, qsizetype reserved = -1);
static QCborContainerPrivate *detach(QCborContainerPrivate *d, qsizetype reserved);
static QCborContainerPrivate *grow(QCborContainerPrivate *d, qsizetype index);
qptrdiff addByteData(const char *block, qsizetype len)
{
// This function does not do overflow checking, since the len parameter
// is expected to be trusted. There's another version of this function
// in decodeStringFromCbor(), which checks.
qptrdiff offset = data.size();
// align offset
offset += alignof(QtCbor::ByteData) - 1;
offset &= ~(alignof(QtCbor::ByteData) - 1);
qptrdiff increment = qptrdiff(sizeof(QtCbor::ByteData)) + len;
usedData += increment;
data.resize(offset + increment);
char *ptr = data.begin() + offset;
auto b = new (ptr) QtCbor::ByteData;
b->len = len;
if (block)
memcpy(b->byte(), block, len);
return offset;
}
const QtCbor::ByteData *byteData(QtCbor::Element e) const
{
if ((e.flags & QtCbor::Element::HasByteData) == 0)
return nullptr;
size_t offset = size_t(e.value);
Q_ASSERT((offset % alignof(QtCbor::ByteData)) == 0);
Q_ASSERT(offset + sizeof(QtCbor::ByteData) <= size_t(data.size()));
auto b = reinterpret_cast<const QtCbor::ByteData *>(data.constData() + offset);
Q_ASSERT(offset + sizeof(*b) + size_t(b->len) <= size_t(data.size()));
return b;
}
const QtCbor::ByteData *byteData(qsizetype idx) const
{
return byteData(elements.at(idx));
}
QCborContainerPrivate *containerAt(qsizetype idx, QCborValue::Type type) const
{
const QtCbor::Element &e = elements.at(idx);
if (e.type != type || (e.flags & QtCbor::Element::IsContainer) == 0)
return nullptr;
return e.container;
}
void replaceAt_complex(QtCbor::Element &e, const QCborValue &value, ContainerDisposition disp);
void replaceAt_internal(QtCbor::Element &e, const QCborValue &value, ContainerDisposition disp)
{
if (value.container)
return replaceAt_complex(e, value, disp);
e = { value.value_helper(), value.type() };
if (value.isContainer())
e.container = nullptr;
}
void replaceAt(qsizetype idx, const QCborValue &value, ContainerDisposition disp = CopyContainer)
{
QtCbor::Element &e = elements[idx];
if (e.flags & QtCbor::Element::IsContainer) {
e.container->deref();
e.container = nullptr;
e.flags = {};
} else if (auto b = byteData(e)) {
usedData -= b->len + sizeof(QtCbor::ByteData);
}
replaceAt_internal(e, value, disp);
}
void insertAt(qsizetype idx, const QCborValue &value, ContainerDisposition disp = CopyContainer)
{
replaceAt_internal(*elements.insert(elements.begin() + int(idx), {}), value, disp);
}
void append(QtCbor::Undefined)
{
elements.append(QtCbor::Element());
}
void append(qint64 value)
{
elements.append(QtCbor::Element(value , QCborValue::Integer));
}
void append(QCborTag tag)
{
elements.append(QtCbor::Element(qint64(tag), QCborValue::Tag));
}
void appendByteData(const char *data, qsizetype len, QCborValue::Type type,
QtCbor::Element::ValueFlags extraFlags = {})
{
elements.append(QtCbor::Element(addByteData(data, len), type,
QtCbor::Element::HasByteData | extraFlags));
}
void appendAsciiString(const QString &s);
void appendAsciiString(const char *str, qsizetype len)
{
appendByteData(str, len, QCborValue::String, QtCbor::Element::StringIsAscii);
}
void appendUtf8String(const char *str, qsizetype len)
{
appendByteData(str, len, QCborValue::String);
}
void append(QLatin1StringView s)
{
if (!QtPrivate::isAscii(s))
return append(QString(s));
// US-ASCII is a subset of UTF-8, so we can keep in 8-bit
appendByteData(s.latin1(), s.size(), QCborValue::String,
QtCbor::Element::StringIsAscii);
}
void appendAsciiString(QStringView s);
void append(const QString &s)
{
append(qToStringViewIgnoringNull(s));
}
void append(QStringView s)
{
if (QtPrivate::isAscii(s))
appendAsciiString(s);
else
appendByteData(reinterpret_cast<const char *>(s.utf16()), s.size() * 2,
QCborValue::String, QtCbor::Element::StringIsUtf16);
}
void append(const QCborValue &v)
{
insertAt(elements.size(), v);
}
QByteArray byteArrayAt(qsizetype idx) const
{
const auto &e = elements.at(idx);
const auto data = byteData(e);
if (!data)
return QByteArray();
return data->toByteArray();
}
QString stringAt(qsizetype idx) const
{
const auto &e = elements.at(idx);
const auto data = byteData(e);
if (!data)
return QString();
if (e.flags & QtCbor::Element::StringIsUtf16)
return data->toString();
if (e.flags & QtCbor::Element::StringIsAscii)
return data->asLatin1();
return data->toUtf8String();
}
static void resetValue(QCborValue &v)
{
v.container = nullptr;
}
static QCborValue makeValue(QCborValue::Type type, qint64 n, QCborContainerPrivate *d = nullptr,
ContainerDisposition disp = CopyContainer)
{
QCborValue result(type);
result.n = n;
result.container = d;
if (d && disp == CopyContainer)
d->ref.ref();
return result;
}
QCborValue valueAt(qsizetype idx) const
{
const auto &e = elements.at(idx);
if (e.flags & QtCbor::Element::IsContainer) {
if (e.type == QCborValue::Tag && e.container->elements.size() != 2) {
// invalid tags can be created due to incomplete parsing
return makeValue(QCborValue::Invalid, 0, nullptr);
}
return makeValue(e.type, -1, e.container);
} else if (e.flags & QtCbor::Element::HasByteData) {
return makeValue(e.type, idx, const_cast<QCborContainerPrivate *>(this));
}
return makeValue(e.type, e.value);
}
QCborValue extractAt_complex(QtCbor::Element e);
QCborValue extractAt(qsizetype idx)
{
QtCbor::Element e;
qSwap(e, elements[idx]);
if (e.flags & QtCbor::Element::IsContainer) {
if (e.type == QCborValue::Tag && e.container->elements.size() != 2) {
// invalid tags can be created due to incomplete parsing
e.container->deref();
return makeValue(QCborValue::Invalid, 0, nullptr);
}
return makeValue(e.type, -1, e.container, MoveContainer);
} else if (e.flags & QtCbor::Element::HasByteData) {
return extractAt_complex(e);
}
return makeValue(e.type, e.value);
}
static QtCbor::Element elementFromValue(const QCborValue &value)
{
if (value.n >= 0 && value.container)
return value.container->elements.at(value.n);
QtCbor::Element e;
e.value = value.n;
e.type = value.t;
if (value.container) {
e.container = value.container;
e.flags = QtCbor::Element::IsContainer;
}
return e;
}
static int compareUtf8(const QtCbor::ByteData *b, QLatin1StringView s)
{
return QUtf8::compareUtf8(QByteArrayView(b->byte(), b->len), s);
}
static int compareUtf8(const QtCbor::ByteData *b, QStringView s)
{
return QUtf8::compareUtf8(QByteArrayView(b->byte(), b->len), s);
}
template<typename String>
int stringCompareElement(const QtCbor::Element &e, String s) const
{
if (e.type != QCborValue::String)
return int(e.type) - int(QCborValue::String);
const QtCbor::ByteData *b = byteData(e);
if (!b)
return s.isEmpty() ? 0 : -1;
if (e.flags & QtCbor::Element::StringIsUtf16)
return QtPrivate::compareStrings(b->asStringView(), s);
return compareUtf8(b, s);
}
template<typename String>
bool stringEqualsElement(const QtCbor::Element &e, String s) const
{
return stringCompareElement(e, s) == 0;
}
template<typename String>
bool stringEqualsElement(qsizetype idx, String s) const
{
return stringEqualsElement(elements.at(idx), s);
}
static int compareElement_helper(const QCborContainerPrivate *c1, QtCbor::Element e1,
const QCborContainerPrivate *c2, QtCbor::Element e2);
int compareElement(qsizetype idx, const QCborValue &value) const
{
auto &e1 = elements.at(idx);
auto e2 = elementFromValue(value);
return compareElement_helper(this, e1, value.container, e2);
}
void removeAt(qsizetype idx)
{
replaceAt(idx, {});
elements.remove(idx);
}
// doesn't apply to JSON
template <typename KeyType> QCborValueConstRef findCborMapKey(KeyType key)
{
qsizetype i = 0;
for ( ; i < elements.size(); i += 2) {
const auto &e = elements.at(i);
bool equals;
if constexpr (std::is_same_v<std::decay_t<KeyType>, QCborValue>) {
equals = (compareElement(i, key) == 0);
} else if constexpr (std::is_integral_v<KeyType>) {
equals = (e.type == QCborValue::Integer && e.value == key);
} else {
// assume it's a string
equals = stringEqualsElement(i, key);
}
if (equals)
break;
}
return { this, i + 1 };
}
template <typename KeyType> static QCborValue findCborMapKey(const QCborValue &self, KeyType key)
{
if (self.isMap() && self.container) {
qsizetype idx = self.container->findCborMapKey(key).i;
if (idx < self.container->elements.size())
return self.container->valueAt(idx);
}
return QCborValue();
}
template <typename KeyType> static QCborValueRef
findOrAddMapKey(QCborContainerPrivate *container, KeyType key)
{
qsizetype size = 0;
qsizetype index = size + 1;
if (container) {
size = container->elements.size();
index = container->findCborMapKey<KeyType>(key).i; // returns size + 1 if not found
}
Q_ASSERT(index & 1);
Q_ASSERT((size & 1) == 0);
container = detach(container, qMax(index + 1, size));
Q_ASSERT(container);
Q_ASSERT((container->elements.size() & 1) == 0);
if (index >= size) {
container->append(key);
container->append(QCborValue());
}
Q_ASSERT(index < container->elements.size());
return { container, index };
}
template <typename KeyType> static QCborValueRef findOrAddMapKey(QCborMap &map, KeyType key);
template <typename KeyType> static QCborValueRef findOrAddMapKey(QCborValue &self, KeyType key);
template <typename KeyType> static QCborValueRef findOrAddMapKey(QCborValueRef self, KeyType key);
#if QT_CONFIG(cborstreamreader)
void decodeValueFromCbor(QCborStreamReader &reader, int remainingStackDepth);
void decodeStringFromCbor(QCborStreamReader &reader);
static inline void setErrorInReader(QCborStreamReader &reader, QCborError error);
#endif
};
QT_END_NAMESPACE
#endif // QCBORVALUE_P_H

View File

@@ -0,0 +1,34 @@
// Copyright (C) 2021 Intel Corporation.
// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only
// no, this is not a misspelling of "coffeeparser"
#ifndef QCOFFPEPARSER_H
#define QCOFFPEPARSER_H
//
// W A R N I N G
// -------------
//
// This file is not part of the Qt API. It exists purely as an
// implementation detail. This header file may change from version to
// version without notice, or even be removed.
//
// We mean it.
//
#include "qlibrary_p.h"
#if defined(Q_OS_WIN)
QT_BEGIN_NAMESPACE
struct QCoffPeParser
{
static QLibraryScanResult parse(QByteArrayView data, QString *errMsg);
};
QT_END_NAMESPACE
#endif // defined(Q_OF_ELF) && defined(Q_CC_GNU)
#endif // QCOFFPEPARSER_H

View File

@@ -0,0 +1,111 @@
// Copyright (C) 2016 The Qt Company Ltd.
// Copyright (C) 2013 Aleix Pol Gonzalez <aleixpol@kde.org>
// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only
#ifndef QCOLLATOR_P_H
#define QCOLLATOR_P_H
//
// W A R N I N G
// -------------
//
// This file is not part of the Qt API. It exists purely as an
// implementation detail. This header file may change from version to
// version without notice, or even be removed.
//
// We mean it.
//
#include <QtCore/private/qglobal_p.h>
#include "qcollator.h"
#include <QList>
#if QT_CONFIG(icu)
#include <unicode/ucol.h>
#elif defined(Q_OS_MACOS)
#include <CoreServices/CoreServices.h>
#elif defined(Q_OS_WIN)
#include <qt_windows.h>
#endif
QT_BEGIN_NAMESPACE
#if QT_CONFIG(icu)
typedef UCollator *CollatorType;
typedef QByteArray CollatorKeyType;
const CollatorType NoCollator = nullptr;
#elif defined(Q_OS_MACOS)
typedef CollatorRef CollatorType;
typedef QList<UCCollationValue> CollatorKeyType;
const CollatorType NoCollator = 0;
#elif defined(Q_OS_WIN)
typedef QString CollatorKeyType;
typedef int CollatorType;
const CollatorType NoCollator = 0;
#else // posix - ignores CollatorType collator, only handles system locale
typedef QList<wchar_t> CollatorKeyType;
typedef bool CollatorType;
const CollatorType NoCollator = false;
#endif
class QCollatorPrivate
{
public:
QAtomicInt ref = 1;
QLocale locale;
#if defined(Q_OS_WIN) && !QT_CONFIG(icu)
LCID localeID;
#endif
Qt::CaseSensitivity caseSensitivity = Qt::CaseSensitive;
bool numericMode = false;
bool ignorePunctuation = false;
bool dirty = true;
CollatorType collator = NoCollator;
QCollatorPrivate(const QLocale &locale) : locale(locale) {}
~QCollatorPrivate() { cleanup(); }
bool isC() { return locale.language() == QLocale::C; }
void clear() {
cleanup();
collator = NoCollator;
}
void ensureInitialized()
{
if (dirty)
init();
}
// Implemented by each back-end, in its own way:
void init();
void cleanup();
private:
Q_DISABLE_COPY_MOVE(QCollatorPrivate)
};
class QCollatorSortKeyPrivate : public QSharedData
{
friend class QCollator;
public:
template <typename...T>
explicit QCollatorSortKeyPrivate(T &&...args)
: QSharedData()
, m_key(std::forward<T>(args)...)
{
}
CollatorKeyType m_key;
private:
Q_DISABLE_COPY_MOVE(QCollatorSortKeyPrivate)
};
QT_END_NAMESPACE
#endif // QCOLLATOR_P_H

View File

@@ -0,0 +1,126 @@
#define QT_FEATURE_use_bfd_linker -1
#define QT_FEATURE_use_gold_linker -1
#define QT_FEATURE_use_lld_linker -1
#define QT_FEATURE_use_mold_linker -1
#define QT_FEATURE_android_style_assets -1
#define QT_FEATURE_gc_binaries -1
#define QT_FEATURE_developer_build -1
#define QT_FEATURE_private_tests -1
#define QT_FEATURE_debug -1
#define QT_FEATURE_reduce_exports -1
#define QT_FEATURE_no_direct_extern_access -1
#define QT_FEATURE_x86intrin 1
#define QT_FEATURE_sse2 1
#define QT_FEATURE_sse3 1
#define QT_FEATURE_ssse3 1
#define QT_FEATURE_sse4_1 1
#define QT_FEATURE_sse4_2 1
#define QT_FEATURE_avx 1
#define QT_FEATURE_f16c 1
#define QT_FEATURE_avx2 1
#define QT_FEATURE_avx512f 1
#define QT_FEATURE_avx512er 1
#define QT_FEATURE_avx512cd 1
#define QT_FEATURE_avx512pf 1
#define QT_FEATURE_avx512dq 1
#define QT_FEATURE_avx512bw 1
#define QT_FEATURE_avx512vl 1
#define QT_FEATURE_avx512ifma 1
#define QT_FEATURE_avx512vbmi 1
#define QT_FEATURE_avx512vbmi2 1
#define QT_FEATURE_aesni 1
#define QT_FEATURE_vaes 1
#define QT_FEATURE_rdrnd 1
#define QT_FEATURE_rdseed 1
#define QT_FEATURE_shani 1
#define QT_FEATURE_mips_dsp -1
#define QT_FEATURE_mips_dspr2 -1
#define QT_FEATURE_neon -1
#define QT_FEATURE_arm_crc32 -1
#define QT_FEATURE_arm_crypto -1
#define QT_FEATURE_posix_fallocate -1
#define QT_FEATURE_alloca_h -1
#define QT_FEATURE_alloca_malloc_h 1
#define QT_FEATURE_alloca 1
#define QT_FEATURE_stack_protector_strong -1
#define QT_FEATURE_system_zlib -1
#define QT_FEATURE_stdlib_libcpp -1
#define QT_FEATURE_dbus 1
#define QT_FEATURE_dbus_linked -1
#define QT_FEATURE_gui 1
#define QT_FEATURE_network 1
#define QT_FEATURE_printsupport 1
#define QT_FEATURE_sql 1
#define QT_FEATURE_testlib 1
#define QT_FEATURE_widgets 1
#define QT_FEATURE_xml 1
#define QT_FEATURE_libudev -1
#define QT_FEATURE_openssl 1
#define QT_FEATURE_dlopen -1
#define QT_FEATURE_relocatable 1
#define QT_FEATURE_intelcet -1
#define QT_COPYRIGHT "Copyright (C) 2023 The Qt Company Ltd and other contributors."
#define QT_COPYRIGHT_YEAR "2023"

View File

@@ -0,0 +1,173 @@
// Copyright (C) 2021 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 QCOREAPPLICATION_P_H
#define QCOREAPPLICATION_P_H
//
// W A R N I N G
// -------------
//
// This file is not part of the Qt API. It exists purely as an
// implementation detail. This header file may change from version to
// version without notice, or even be removed.
//
// We mean it.
//
#include "QtCore/qcoreapplication.h"
#if QT_CONFIG(commandlineparser)
#include "QtCore/qcommandlineoption.h"
#endif
#include "QtCore/qreadwritelock.h"
#include "QtCore/qtranslator.h"
#if QT_CONFIG(settings)
#include "QtCore/qsettings.h"
#endif
#ifndef QT_NO_QOBJECT
#include "private/qobject_p.h"
#include "private/qlocking_p.h"
#endif
#ifdef Q_OS_MACOS
#include "private/qcore_mac_p.h"
#endif
QT_BEGIN_NAMESPACE
typedef QList<QTranslator*> QTranslatorList;
class QAbstractEventDispatcher;
#ifndef QT_NO_QOBJECT
class QEvent;
#endif
class Q_CORE_EXPORT QCoreApplicationPrivate
#ifndef QT_NO_QOBJECT
: public QObjectPrivate
#endif
{
Q_DECLARE_PUBLIC(QCoreApplication)
public:
enum Type {
Tty,
Gui
};
QCoreApplicationPrivate(int &aargc, char **aargv);
// If not inheriting from QObjectPrivate: force this class to be polymorphic
#ifdef QT_NO_QOBJECT
virtual
#endif
~QCoreApplicationPrivate();
void init();
QString appName() const;
QString appVersion() const;
#ifdef Q_OS_DARWIN
static QString infoDictionaryStringProperty(const QString &propertyName);
#endif
void initConsole();
static void initLocale();
static bool checkInstance(const char *method);
#if QT_CONFIG(commandlineparser)
virtual void addQtOptions(QList<QCommandLineOption> *options);
#endif
#ifndef QT_NO_QOBJECT
bool sendThroughApplicationEventFilters(QObject *, QEvent *);
static bool sendThroughObjectEventFilters(QObject *, QEvent *);
static bool notify_helper(QObject *, QEvent *);
static inline void setEventSpontaneous(QEvent *e, bool spontaneous) { e->m_spont = spontaneous; }
virtual void createEventDispatcher();
virtual void eventDispatcherReady();
static void removePostedEvent(QEvent *);
#ifdef Q_OS_WIN
static void removePostedTimerEvent(QObject *object, int timerId);
#endif
QAtomicInt quitLockRef;
void ref();
void deref();
virtual bool canQuitAutomatically();
void quitAutomatically();
virtual void quit();
static QBasicAtomicPointer<QThread> theMainThread;
static QThread *mainThread();
static bool threadRequiresCoreApplication();
static void sendPostedEvents(QObject *receiver, int event_type, QThreadData *data);
static void checkReceiverThread(QObject *receiver);
void cleanupThreadData();
struct QPostEventListLocker
{
QThreadData *threadData;
std::unique_lock<QMutex> locker;
void unlock() { locker.unlock(); }
};
static QPostEventListLocker lockThreadPostEventList(QObject *object);
#endif // QT_NO_QOBJECT
int &argc;
char **argv;
#if defined(Q_OS_WIN)
int origArgc;
char **origArgv; // store unmodified arguments for QCoreApplication::arguments()
bool consoleAllocated = false;
#endif
void appendApplicationPathToLibraryPaths(void);
#ifndef QT_NO_TRANSLATION
QTranslatorList translators;
QReadWriteLock translateMutex;
static bool isTranslatorInstalled(QTranslator *translator);
#endif
QCoreApplicationPrivate::Type application_type;
QString cachedApplicationDirPath;
static QString *cachedApplicationFilePath;
static void setApplicationFilePath(const QString &path);
static inline void clearApplicationFilePath() { delete cachedApplicationFilePath; cachedApplicationFilePath = nullptr; }
#ifndef QT_NO_QOBJECT
void execCleanup();
bool in_exec;
bool aboutToQuitEmitted;
bool threadData_clean;
static QAbstractEventDispatcher *eventDispatcher;
static bool is_app_running;
static bool is_app_closing;
#endif
static bool setuidAllowed;
static uint attribs;
static inline bool testAttribute(uint flag) { return attribs & (1 << flag); }
void processCommandLineArguments();
QString qmljs_debug_arguments; // a string containing arguments for js/qml debugging.
inline QString qmljsDebugArgumentsString() const { return qmljs_debug_arguments; }
#ifdef QT_NO_QOBJECT
QCoreApplication *q_ptr;
#endif
};
QT_END_NAMESPACE
#endif // QCOREAPPLICATION_P_H

View File

@@ -0,0 +1,54 @@
// 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 QCORECMDLINEARGS_P_H
#define QCORECMDLINEARGS_P_H
//
// W A R N I N G
// -------------
//
// This file is not part of the Qt API. It exists purely as an
// implementation detail. This header file may change from version to
// version without notice, or even be removed.
//
// We mean it.
//
#include <QtCore/private/qglobal_p.h>
#include "QtCore/qstring.h"
#include "QtCore/qstringlist.h"
#if defined(Q_OS_WIN)
# ifdef Q_OS_WIN32
# include <qt_windows.h> // first to suppress min, max macros.
# include <shlobj.h>
# else
# include <qt_windows.h>
# endif
QT_BEGIN_NAMESPACE
#if defined(Q_OS_WIN32)
static inline QStringList qWinCmdArgs(const QString &cmdLine)
{
QStringList result;
int size;
if (wchar_t **argv = CommandLineToArgvW((const wchar_t *)cmdLine.utf16(), &size)) {
result.reserve(size);
wchar_t **argvEnd = argv + size;
for (wchar_t **a = argv; a < argvEnd; ++a)
result.append(QString::fromWCharArray(*a));
LocalFree(argv);
}
return result;
}
#endif // Q_OS_WIN32
QT_END_NAMESPACE
#endif // Q_OS_WIN
#endif // QCORECMDLINEARGS_WIN_P_H

View File

@@ -0,0 +1,37 @@
// 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 QDATASTREAM_P_H
#define QDATASTREAM_P_H
//
// W A R N I N G
// -------------
//
// This file is not part of the Qt API. It exists purely as an
// implementation detail. This header file may change from version to
// version without notice, or even be removed.
//
// We mean it.
//
#include <QtCore/private/qglobal_p.h>
#include <qdatastream.h>
QT_BEGIN_NAMESPACE
#if !defined(QT_NO_DATASTREAM) || defined(QT_BOOTSTRAPPED)
class QDataStreamPrivate
{
public:
QDataStreamPrivate() : floatingPointPrecision(QDataStream::DoublePrecision),
transactionDepth(0) { }
QDataStream::FloatingPointPrecision floatingPointPrecision;
int transactionDepth;
};
#endif
QT_END_NAMESPACE
#endif // QDATASTREAM_P_H

View File

@@ -0,0 +1,30 @@
// 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 QDATAURL_P_H
#define QDATAURL_P_H
//
// W A R N I N G
// -------------
//
// This file is not part of the Qt API. It exists for the convenience
// of qDecodeDataUrl. This header file may change from version to
// version without notice, or even be removed.
//
// We mean it.
//
#include <QtCore/private/qglobal_p.h>
#include "QtCore/qurl.h"
#include "QtCore/qbytearray.h"
#include "QtCore/qstring.h"
#include "QtCore/qpair.h"
QT_BEGIN_NAMESPACE
Q_CORE_EXPORT bool qDecodeDataUrl(const QUrl &url, QString &mimeType, QByteArray &payload);
QT_END_NAMESPACE
#endif // QDATAURL_P_H

View File

@@ -0,0 +1,130 @@
// Copyright (C) 2022 The Qt Company Ltd.
// Copyright (C) 2016 Intel Corporation.
// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only
#ifndef QDATETIME_P_H
#define QDATETIME_P_H
//
// W A R N I N G
// -------------
//
// This file is not part of the Qt API. It exists purely as an
// implementation detail. This header file may change from version to
// version without notice, or even be removed.
//
// We mean it.
//
#include <QtCore/private/qglobal_p.h>
#include "qplatformdefs.h"
#include "QtCore/qatomic.h"
#include "QtCore/qdatetime.h"
#include "QtCore/qshareddata.h"
#include "QtCore/qtimezone.h"
#if QT_CONFIG(timezone)
#include "qtimezone.h"
#endif
#include <chrono>
QT_BEGIN_NAMESPACE
class QDateTimePrivate : public QSharedData
{
public:
// forward the declarations from QDateTime (this makes them public)
typedef QDateTime::ShortData QDateTimeShortData;
typedef QDateTime::Data QDateTimeData;
// Never change or delete this enum, it is required for backwards compatible
// serialization of QDateTime before 5.2, so is essentially public API
enum Spec {
LocalUnknown = -1,
LocalStandard = 0,
LocalDST = 1,
UTC = 2,
OffsetFromUTC = 3,
TimeZone = 4
};
// Daylight Time Status
enum DaylightStatus {
UnknownDaylightTime = -1,
StandardTime = 0,
DaylightTime = 1
};
// Status of date/time
enum StatusFlag {
ShortData = 0x01,
ValidDate = 0x02,
ValidTime = 0x04,
ValidDateTime = 0x08,
TimeSpecMask = 0x30,
SetToStandardTime = 0x40,
SetToDaylightTime = 0x80,
ValidityMask = ValidDate | ValidTime | ValidDateTime,
DaylightMask = SetToStandardTime | SetToDaylightTime,
};
Q_DECLARE_FLAGS(StatusFlags, StatusFlag)
enum {
TimeSpecShift = 4,
};
struct ZoneState {
qint64 when; // ms after zone/local 1970 start; may be revised from the input time.
int offset = 0; // seconds
DaylightStatus dst = UnknownDaylightTime;
// Other fields are set, if possible, even when valid is false due to spring-forward.
bool valid = false;
ZoneState(qint64 local) : when(local) {}
ZoneState(qint64 w, int o, DaylightStatus d, bool v = true)
: when(w), offset(o), dst(d), valid(v) {}
};
static QDateTime::Data create(QDate toDate, QTime toTime, const QTimeZone &timeZone);
#if QT_CONFIG(timezone)
static ZoneState zoneStateAtMillis(const QTimeZone &zone, qint64 millis, DaylightStatus dst);
#endif // timezone
static ZoneState expressUtcAsLocal(qint64 utcMSecs);
static ZoneState localStateAtMillis(qint64 millis, DaylightStatus dst);
static QString localNameAtMillis(qint64 millis, DaylightStatus dst); // empty if unknown
StatusFlags m_status = StatusFlag(Qt::LocalTime << TimeSpecShift);
qint64 m_msecs = 0;
int m_offsetFromUtc = 0;
QTimeZone m_timeZone;
};
Q_DECLARE_OPERATORS_FOR_FLAGS(QDateTimePrivate::StatusFlags)
namespace QtPrivate {
namespace DateTimeConstants {
using namespace std::chrono;
constexpr qint64 SECS_PER_MIN = minutes::period::num;
constexpr qint64 SECS_PER_HOUR = hours::period::num;
constexpr qint64 SECS_PER_DAY = SECS_PER_HOUR * 24; // std::chrono::days is C++20
constexpr qint64 MINS_PER_HOUR = std::ratio_divide<hours::period, minutes::period>::num;
constexpr qint64 MSECS_PER_SEC = milliseconds::period::den;
constexpr qint64 MSECS_PER_MIN = SECS_PER_MIN * MSECS_PER_SEC;
constexpr qint64 MSECS_PER_HOUR = SECS_PER_HOUR * MSECS_PER_SEC;
constexpr qint64 MSECS_PER_DAY = SECS_PER_DAY * MSECS_PER_SEC;
constexpr qint64 JULIAN_DAY_FOR_EPOCH = 2440588; // result of QDate(1970, 1, 1).toJulianDay()
}
}
QT_END_NAMESPACE
#endif // QDATETIME_P_H

View File

@@ -0,0 +1,274 @@
// Copyright (C) 2021 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 QDATETIMEPARSER_P_H
#define QDATETIMEPARSER_P_H
//
// W A R N I N G
// -------------
//
// This file is not part of the Qt API. It exists purely as an
// implementation detail. This header file may change from version to
// version without notice, or even be removed.
//
// We mean it.
//
#include <QtCore/private/qglobal_p.h>
#include "qplatformdefs.h"
#include "QtCore/qatomic.h"
#include "QtCore/qcalendar.h"
#include "QtCore/qcoreapplication.h"
#include "QtCore/qdatetime.h"
#include "QtCore/qlist.h"
#include "QtCore/qlocale.h"
#include "QtCore/qstringlist.h"
#ifndef QT_BOOTSTRAPPED
# include "QtCore/qvariant.h"
#endif
QT_REQUIRE_CONFIG(datetimeparser);
#define QDATETIMEEDIT_TIME_MIN QTime(0, 0) // Prefer QDate::startOfDay()
#define QDATETIMEEDIT_TIME_MAX QTime(23, 59, 59, 999) // Prefer QDate::endOfDay()
#define QDATETIMEEDIT_DATE_MIN QDate(100, 1, 1)
#define QDATETIMEEDIT_COMPAT_DATE_MIN QDate(1752, 9, 14)
#define QDATETIMEEDIT_DATE_MAX QDate(9999, 12, 31)
#define QDATETIMEEDIT_DATE_INITIAL QDate(2000, 1, 1)
QT_BEGIN_NAMESPACE
class Q_CORE_EXPORT QDateTimeParser
{
public:
enum Context {
FromString,
DateTimeEdit
};
QDateTimeParser(QMetaType::Type t, Context ctx, const QCalendar &cal = QCalendar())
: parserType(t), context(ctx), calendar(cal)
{
defaultLocale = QLocale::system();
first.type = FirstSection;
first.pos = -1;
first.count = -1;
first.zeroesAdded = 0;
last.type = LastSection;
last.pos = -1;
last.count = -1;
last.zeroesAdded = 0;
none.type = NoSection;
none.pos = -1;
none.count = -1;
none.zeroesAdded = 0;
}
virtual ~QDateTimeParser();
enum Section {
NoSection = 0x00000,
AmPmSection = 0x00001,
MSecSection = 0x00002,
SecondSection = 0x00004,
MinuteSection = 0x00008,
Hour12Section = 0x00010,
Hour24Section = 0x00020,
TimeZoneSection = 0x00040,
HourSectionMask = (Hour12Section | Hour24Section),
TimeSectionMask = (MSecSection | SecondSection | MinuteSection |
HourSectionMask | AmPmSection | TimeZoneSection),
DaySection = 0x00100,
MonthSection = 0x00200,
YearSection = 0x00400,
YearSection2Digits = 0x00800,
YearSectionMask = YearSection | YearSection2Digits,
DayOfWeekSectionShort = 0x01000,
DayOfWeekSectionLong = 0x02000,
DayOfWeekSectionMask = DayOfWeekSectionShort | DayOfWeekSectionLong,
DaySectionMask = DaySection | DayOfWeekSectionMask,
DateSectionMask = DaySectionMask | MonthSection | YearSectionMask,
Internal = 0x10000,
FirstSection = 0x20000 | Internal,
LastSection = 0x40000 | Internal,
CalendarPopupSection = 0x80000 | Internal,
NoSectionIndex = -1,
FirstSectionIndex = -2,
LastSectionIndex = -3,
CalendarPopupIndex = -4
}; // extending qdatetimeedit.h's equivalent
Q_DECLARE_FLAGS(Sections, Section)
struct Q_CORE_EXPORT SectionNode {
Section type;
mutable int pos;
int count; // (used as Case(count) indicator for AmPmSection)
int zeroesAdded;
static QString name(Section s);
QString name() const { return name(type); }
QString format() const;
int maxChange() const;
};
enum State { // duplicated from QValidator
Invalid,
Intermediate,
Acceptable
};
struct StateNode {
StateNode() : state(Invalid), padded(0), conflicts(false) {}
StateNode(const QDateTime &val, State ok=Acceptable, int pad=0, bool bad=false)
: value(val), state(ok), padded(pad), conflicts(bad) {}
QDateTime value;
State state;
int padded;
bool conflicts;
};
enum AmPm {
AmText,
PmText
};
StateNode parse(const QString &input, int position,
const QDateTime &defaultValue, bool fixup) const;
bool fromString(const QString &text, QDate *date, QTime *time) const;
bool fromString(const QString &text, QDateTime* datetime) const;
bool parseFormat(QStringView format);
enum FieldInfoFlag {
Numeric = 0x01,
FixedWidth = 0x02,
AllowPartial = 0x04,
Fraction = 0x08
};
Q_DECLARE_FLAGS(FieldInfo, FieldInfoFlag)
FieldInfo fieldInfo(int index) const;
void setDefaultLocale(const QLocale &loc) { defaultLocale = loc; }
virtual QString displayText() const { return m_text; }
void setCalendar(const QCalendar &calendar);
private:
int sectionMaxSize(Section s, int count) const;
QString sectionText(const QString &text, int sectionIndex, int index) const;
StateNode scanString(const QDateTime &defaultValue, bool fixup) const;
struct ParsedSection {
int value;
int used;
int zeroes;
State state;
constexpr ParsedSection(State ok = Invalid,
int val = 0, int read = 0, int zs = 0)
: value(ok == Invalid ? -1 : val), used(read), zeroes(zs), state(ok)
{}
};
ParsedSection parseSection(const QDateTime &currentValue, int sectionIndex, int offset) const;
int findMonth(const QString &str1, int monthstart, int sectionIndex,
int year, QString *monthName = nullptr, int *used = nullptr) const;
int findDay(const QString &str1, int intDaystart, int sectionIndex,
QString *dayName = nullptr, int *used = nullptr) const;
ParsedSection findUtcOffset(QStringView str, int mode) const;
ParsedSection findTimeZoneName(QStringView str, const QDateTime &when) const;
ParsedSection findTimeZone(QStringView str, const QDateTime &when,
int maxVal, int minVal, int mode) const;
// Implemented in qlocaltime.cpp:
static int startsWithLocalTimeZone(const QStringView name, const QDateTime &when);
enum AmPmFinder {
Neither = -1,
AM = 0,
PM = 1,
PossibleAM = 2,
PossiblePM = 3,
PossibleBoth = 4
};
AmPmFinder findAmPm(QString &str, int index, int *used = nullptr) const;
bool potentialValue(QStringView str, int min, int max, int index,
const QDateTime &currentValue, int insert) const;
bool potentialValue(const QString &str, int min, int max, int index,
const QDateTime &currentValue, int insert) const
{
return potentialValue(QStringView(str), min, max, index, currentValue, insert);
}
enum Case {
NativeCase,
LowerCase,
UpperCase
};
QString getAmPmText(AmPm ap, Case cs) const;
friend class QDTPUnitTestParser;
protected: // for the benefit of QDateTimeEditPrivate
int sectionSize(int index) const;
int sectionMaxSize(int index) const;
int sectionPos(int index) const;
int sectionPos(const SectionNode &sn) const;
const SectionNode &sectionNode(int index) const;
Section sectionType(int index) const;
QString sectionText(int sectionIndex) const;
int getDigit(const QDateTime &dt, int index) const;
bool setDigit(QDateTime &t, int index, int newval) const;
int absoluteMax(int index, const QDateTime &value = QDateTime()) const;
int absoluteMin(int index) const;
bool skipToNextSection(int section, const QDateTime &current, QStringView sectionText) const;
bool skipToNextSection(int section, const QDateTime &current, const QString &sectionText) const
{
return skipToNextSection(section, current, QStringView(sectionText));
}
QString stateName(State s) const;
virtual QDateTime getMinimum() const;
virtual QDateTime getMaximum() const;
virtual int cursorPosition() const { return -1; }
virtual QLocale locale() const { return defaultLocale; }
mutable int currentSectionIndex = int(NoSectionIndex);
Sections display;
/*
This stores the most recently selected day.
It is useful when considering the following scenario:
1. Date is: 31/01/2000
2. User increments month: 29/02/2000
3. User increments month: 31/03/2000
At step 1, cachedDay stores 31. At step 2, the 31 is invalid for February, so the cachedDay is not updated.
At step 3, the month is changed to March, for which 31 is a valid day. Since 29 < 31, the day is set to cachedDay.
This is good for when users have selected their desired day and are scrolling up or down in the month or year section
and do not want smaller months (or non-leap years) to alter the day that they chose.
*/
mutable int cachedDay = -1;
mutable QString m_text;
QList<SectionNode> sectionNodes;
SectionNode first, last, none, popup;
QStringList separators;
QString displayFormat;
QLocale defaultLocale;
QMetaType::Type parserType;
bool fixday = false;
Context context;
QCalendar calendar;
};
Q_DECLARE_TYPEINFO(QDateTimeParser::SectionNode, Q_PRIMITIVE_TYPE);
Q_CORE_EXPORT bool operator==(const QDateTimeParser::SectionNode &s1, const QDateTimeParser::SectionNode &s2);
Q_DECLARE_OPERATORS_FOR_FLAGS(QDateTimeParser::Sections)
Q_DECLARE_OPERATORS_FOR_FLAGS(QDateTimeParser::FieldInfo)
QT_END_NAMESPACE
#endif // QDATETIME_P_H

View File

@@ -0,0 +1,34 @@
// 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 QDEADLINETIMER_P_H
#define QDEADLINETIMER_P_H
//
// W A R N I N G
// -------------
//
// This file is not part of the Qt API. It exists purely as an
// implementation detail. This header file may change from version to
// version without notice, or even be removed.
//
// We mean it.
//
#include <QtCore/private/qglobal_p.h>
QT_BEGIN_NAMESPACE
enum {
#if defined(Q_OS_UNIX) && !defined(Q_OS_DARWIN)
// t1 contains seconds and t2 contains nanoseconds
QDeadlineTimerNanosecondsInT2 = 1
#else
// t1 contains nanoseconds, t2 is always zero
QDeadlineTimerNanosecondsInT2 = 0
#endif
};
QT_END_NAMESPACE
#endif

View File

@@ -0,0 +1,102 @@
// 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 QDEBUG_P_H
#define QDEBUG_P_H
//
// W A R N I N G
// -------------
//
// This file is not part of the Qt API. It exists for the convenience
// of other Qt classes. This header file may change from version to
// version without notice, or even be removed.
//
// We mean it.
//
#include <QtCore/private/qglobal_p.h>
#include "QtCore/qdebug.h"
#include "QtCore/qmetaobject.h"
#include "QtCore/qflags.h"
#include "QtCore/qbytearray.h"
QT_BEGIN_NAMESPACE
namespace QtDebugUtils {
Q_CORE_EXPORT QByteArray toPrintable(const char *data, qint64 len, qsizetype maxSize);
// inline helpers for formatting basic classes.
template <class Point>
static inline void formatQPoint(QDebug &debug, const Point &point)
{
debug << point.x() << ',' << point.y();
}
template <class Size>
static inline void formatQSize(QDebug &debug, const Size &size)
{
debug << size.width() << ", " << size.height();
}
template <class Rect>
static inline void formatQRect(QDebug &debug, const Rect &rect)
{
debug << rect.x() << ',' << rect.y() << ' ' << rect.width() << 'x' << rect.height();
}
template <class Margins>
static inline void formatQMargins(QDebug &debug, const Margins &margins)
{
debug << margins.left() << ", " << margins.top() << ", " << margins.right()
<< ", " << margins.bottom();
}
#ifndef QT_NO_QOBJECT
template <class QEnum>
static inline void formatQEnum(QDebug &debug, QEnum value)
{
const QMetaObject *metaObject = qt_getEnumMetaObject(value);
const QMetaEnum me = metaObject->enumerator(metaObject->indexOfEnumerator(qt_getEnumName(value)));
if (const char *key = me.valueToKey(int(value)))
debug << key;
else
debug << int(value);
}
template <class QEnum>
static inline void formatNonNullQEnum(QDebug &debug, const char *prefix, QEnum value)
{
if (value) {
debug << prefix;
formatQEnum(debug, value);
}
}
template <class Enum>
static inline void formatQFlags(QDebug &debug, const QFlags<Enum> &value)
{
const QMetaEnum me = QMetaEnum::fromType<QFlags<Enum>>();
const QDebugStateSaver saver(debug);
debug.noquote();
debug << me.valueToKeys(value.toInt());
}
template <class Enum>
static inline void formatNonNullQFlags(QDebug &debug, const char *prefix, const QFlags<Enum> &value)
{
if (value) {
debug << prefix;
formatQFlags(debug, value);
}
}
#endif // !QT_NO_QOBJECT
} // namespace QtDebugUtils
QT_END_NAMESPACE
#endif // QDEBUG_P_H

View File

@@ -0,0 +1,80 @@
// 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 QDIR_P_H
#define QDIR_P_H
//
// W A R N I N G
// -------------
//
// This file is not part of the Qt API. It exists purely as an
// implementation detail. This header file may change from version to
// version without notice, or even be removed.
//
// We mean it.
//
#include "qfilesystementry_p.h"
#include "qfilesystemmetadata_p.h"
#include <memory>
QT_BEGIN_NAMESPACE
class QDirPrivate : public QSharedData
{
public:
enum PathNormalization {
DefaultNormalization = 0x00,
AllowUncPaths = 0x01,
RemotePath = 0x02
};
Q_DECLARE_FLAGS(PathNormalizations, PathNormalization)
Q_FLAGS(PathNormalizations)
explicit QDirPrivate(const QString &path, const QStringList &nameFilters_ = QStringList(),
QDir::SortFlags sort_ = QDir::SortFlags(QDir::Name | QDir::IgnoreCase),
QDir::Filters filters_ = QDir::AllEntries);
explicit QDirPrivate(const QDirPrivate &copy);
bool exists() const;
void initFileEngine();
void initFileLists(const QDir &dir) const;
static void sortFileList(QDir::SortFlags, const QFileInfoList &, QStringList *, QFileInfoList *);
static inline QChar getFilterSepChar(const QString &nameFilter);
static inline QStringList splitFilters(const QString &nameFilter, QChar sep = {});
void setPath(const QString &path);
void clearFileLists();
void resolveAbsoluteEntry() const;
mutable bool fileListsInitialized;
mutable QStringList files;
mutable QFileInfoList fileInfos;
QStringList nameFilters;
QDir::SortFlags sort;
QDir::Filters filters;
std::unique_ptr<QAbstractFileEngine> fileEngine;
QFileSystemEntry dirEntry;
mutable QFileSystemEntry absoluteDirEntry;
mutable QFileSystemMetaData metaData;
};
Q_DECLARE_OPERATORS_FOR_FLAGS(QDirPrivate::PathNormalizations)
Q_AUTOTEST_EXPORT QString qt_normalizePathSegments(const QString &name, QDirPrivate::PathNormalizations flags, bool *ok = nullptr);
QT_END_NAMESPACE
#endif

View File

@@ -0,0 +1,120 @@
// Copyright (C) 2021 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 QDOUBLESCANPRINT_P_H
#define QDOUBLESCANPRINT_P_H
//
// W A R N I N G
// -------------
//
// This file is not part of the Qt API. It exists for the convenience
// of internal files. This header file may change from version to version
// without notice, or even be removed.
//
// We mean it.
//
#include <private/qglobal_p.h>
#if defined(Q_CC_MSVC) && (defined(QT_BOOTSTRAPPED) || defined(QT_NO_DOUBLECONVERSION))
# include <stdio.h>
# include <locale.h>
QT_BEGIN_NAMESPACE
// We can always use _sscanf_l and _snprintf_l on MSVC as those were introduced in 2005.
// MSVC doesn't document what it will do with a NULL locale passed to _sscanf_l or _snprintf_l.
// The documentation for _create_locale() does not formally document "C" to be valid, but an example
// code snippet in the same documentation shows it.
struct QCLocaleT {
QCLocaleT() : locale(_create_locale(LC_ALL, "C"))
{
}
~QCLocaleT()
{
_free_locale(locale);
}
const _locale_t locale;
};
# define QT_CLOCALE_HOLDER Q_GLOBAL_STATIC(QCLocaleT, cLocaleT)
# define QT_CLOCALE cLocaleT()->locale
inline int qDoubleSscanf(const char *buf, _locale_t locale, const char *format, double *d,
int *processed)
{
return _sscanf_l(buf, format, locale, d, processed);
}
inline int qDoubleSnprintf(char *buf, size_t buflen, _locale_t locale, const char *format, double d)
{
return _snprintf_l(buf, buflen, format, locale, d);
}
QT_END_NAMESPACE
#elif defined(QT_BOOTSTRAPPED)
# include <stdio.h>
QT_BEGIN_NAMESPACE
// When bootstrapping we don't have libdouble-conversion available, yet. We can also not use locale
// aware snprintf and sscanf variants in the general case because those are only available on select
// platforms. We can use the regular snprintf and sscanf because we don't do setlocale(3) when
// bootstrapping and the locale is always "C" then.
# define QT_CLOCALE_HOLDER
# define QT_CLOCALE 0
inline int qDoubleSscanf(const char *buf, int, const char *format, double *d, int *processed)
{
return sscanf(buf, format, d, processed);
}
inline int qDoubleSnprintf(char *buf, size_t buflen, int, const char *format, double d)
{
return snprintf(buf, buflen, format, d);
}
QT_END_NAMESPACE
#else // !QT_BOOTSTRAPPED && (!Q_CC_MSVC || !QT_NO_DOUBLECONVERSION)
# ifdef QT_NO_DOUBLECONVERSION
# include <stdio.h>
# include <xlocale.h>
QT_BEGIN_NAMESPACE
// OS X and FreeBSD both treat NULL as the "C" locale for snprintf_l and sscanf_l.
// When other implementations with different behavior show up, we'll have to do newlocale(3) and
// freelocale(3) here. The arguments to those will depend on what the other implementations will
// offer. OS X and FreeBSD again interpret a locale name of NULL as "C", but "C" itself is not
// documented as valid locale name. Mind that the names of the LC_* constants differ between e.g.
// BSD variants and linux.
# define QT_CLOCALE_HOLDER
# define QT_CLOCALE NULL
inline int qDoubleSscanf(const char *buf, locale_t locale, const char *format, double *d,
int *processed)
{
return sscanf_l(buf, locale, format, d, processed);
}
inline int qDoubleSnprintf(char *buf, size_t buflen, locale_t locale, const char *format, double d)
{
return snprintf_l(buf, buflen, locale, format, d);
}
QT_END_NAMESPACE
# else // !QT_NO_DOUBLECONVERSION
# include <double-conversion/double-conversion.h>
# define QT_CLOCALE_HOLDER
# endif // QT_NO_DOUBLECONVERSION
#endif // QT_BOOTSTRAPPED
#endif // QDOUBLESCANPRINT_P_H

View File

@@ -0,0 +1,124 @@
// Copyright (C) 2020 Klarälvdalens Datakonsult AB, a KDAB Group company, info@kdab.com, author Marc Mutz <marc.mutz@kdab.com>
// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only
#ifndef QDUPLICATETRACKER_P_H
#define QDUPLICATETRACKER_P_H
//
// W A R N I N G
// -------------
//
// This file is not part of the Qt API. It exists purely as an
// implementation detail. This header file may change from version to
// version without notice, or even be removed.
//
// We mean it.
//
#include <private/qglobal_p.h>
#ifdef __cpp_lib_memory_resource
# include <unordered_set>
# include <memory_resource>
# include <qhash.h> // for the hashing helpers
#else
# include <qset.h>
#endif
QT_BEGIN_NAMESPACE
template <typename T, size_t Prealloc = 32>
class QDuplicateTracker {
#ifdef __cpp_lib_memory_resource
template <typename HT>
struct QHasher {
size_t storedSeed = QHashSeed::globalSeed();
size_t operator()(const HT &t) const {
return QHashPrivate::calculateHash(t, storedSeed);
}
};
struct node_guesstimate { void *next; size_t hash; T value; };
static constexpr size_t bufferSize(size_t N) {
return N * sizeof(void*) // bucket list
+ N * sizeof(node_guesstimate); // nodes
}
char buffer[bufferSize(Prealloc)];
std::pmr::monotonic_buffer_resource res{buffer, sizeof buffer};
std::pmr::unordered_set<T, QHasher<T>> set{Prealloc, &res};
#else
class Set : public QSet<T> {
qsizetype setSize = 0;
public:
explicit Set(qsizetype n) : QSet<T>{}
{ this->reserve(n); }
auto insert(const T &e) {
auto it = QSet<T>::insert(e);
const auto n = this->size();
return std::pair{it, std::exchange(setSize, n) != n};
}
auto insert(T &&e) {
auto it = QSet<T>::insert(std::move(e));
const auto n = this->size();
return std::pair{it, std::exchange(setSize, n) != n};
}
};
Set set{Prealloc};
#endif
Q_DISABLE_COPY_MOVE(QDuplicateTracker);
public:
static constexpr inline bool uses_pmr =
#ifdef __cpp_lib_memory_resource
true
#else
false
#endif
;
QDuplicateTracker() = default;
explicit QDuplicateTracker(qsizetype n)
#ifdef __cpp_lib_memory_resource
: set{size_t(n), &res}
#else
: set{n}
#endif
{}
Q_DECL_DEPRECATED_X("Pass the capacity to reserve() to the ctor instead.")
void reserve(qsizetype n) { set.reserve(n); }
[[nodiscard]] bool hasSeen(const T &s)
{
return !set.insert(s).second;
}
[[nodiscard]] bool hasSeen(T &&s)
{
return !set.insert(std::move(s)).second;
}
template <typename C>
void appendTo(C &c) const &
{
for (const auto &e : set)
c.push_back(e);
}
template <typename C>
void appendTo(C &c) &&
{
if constexpr (uses_pmr) {
while (!set.empty())
c.push_back(std::move(set.extract(set.begin()).value()));
} else {
return appendTo(c); // lvalue version
}
}
void clear()
{
set.clear();
}
};
QT_END_NAMESPACE
#endif /* QDUPLICATETRACKER_P_H */

View File

@@ -0,0 +1,211 @@
// Copyright (C) 2020 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 QENDIAN_P_H
#define QENDIAN_P_H
//
// W A R N I N G
// -------------
//
// This file is not part of the Qt API. It exists purely as an
// implementation detail. This header file may change from version to
// version without notice, or even be removed.
//
// We mean it.
//
#include <QtCore/qendian.h>
#include <QtCore/private/qglobal_p.h>
QT_BEGIN_NAMESPACE
enum class QSpecialIntegerBitfieldInitializer {};
constexpr QSpecialIntegerBitfieldInitializer QSpecialIntegerBitfieldZero{};
template<class S>
class QSpecialIntegerStorage
{
public:
using UnsignedStorageType = std::make_unsigned_t<typename S::StorageType>;
constexpr QSpecialIntegerStorage() = default;
constexpr QSpecialIntegerStorage(QSpecialIntegerBitfieldInitializer) : val(0) {}
constexpr QSpecialIntegerStorage(UnsignedStorageType initial) : val(initial) {}
UnsignedStorageType val;
};
template<class S, int pos, int width, class T = typename S::StorageType>
class QSpecialIntegerAccessor;
template<class S, int pos, int width, class T = typename S::StorageType>
class QSpecialIntegerConstAccessor
{
Q_DISABLE_COPY_MOVE(QSpecialIntegerConstAccessor)
public:
using Storage = const QSpecialIntegerStorage<S>;
using Type = T;
using UnsignedType = std::make_unsigned_t<T>;
operator Type() const noexcept
{
if constexpr (std::is_signed_v<Type>) {
UnsignedType i = S::fromSpecial(storage->val);
i <<= (sizeof(Type) * 8) - width - pos;
Type t = Type(i);
t >>= (sizeof(Type) * 8) - width;
return t;
}
return (S::fromSpecial(storage->val) & mask()) >> pos;
}
bool operator!() const noexcept { return !(storage->val & S::toSpecial(mask())); }
static constexpr UnsignedType mask() noexcept
{
if constexpr (width == sizeof(UnsignedType) * 8) {
static_assert(pos == 0);
return ~UnsignedType(0);
} else {
return ((UnsignedType(1) << width) - 1) << pos;
}
}
private:
template<class Storage, typename... Accessors>
friend class QSpecialIntegerBitfieldUnion;
friend class QSpecialIntegerAccessor<S, pos, width, T>;
explicit QSpecialIntegerConstAccessor(Storage *storage) : storage(storage) {}
friend bool operator==(const QSpecialIntegerConstAccessor<S, pos, width, T> &i,
const QSpecialIntegerConstAccessor<S, pos, width, T> &j) noexcept
{
return ((i.storage->val ^ j.storage->val) & S::toSpecial(mask())) == 0;
}
friend bool operator!=(const QSpecialIntegerConstAccessor<S, pos, width, T> &i,
const QSpecialIntegerConstAccessor<S, pos, width, T> &j) noexcept
{
return ((i.storage->val ^ j.storage->val) & S::toSpecial(mask())) != 0;
}
Storage *storage;
};
template<class S, int pos, int width, class T>
class QSpecialIntegerAccessor
{
Q_DISABLE_COPY_MOVE(QSpecialIntegerAccessor)
public:
using Const = QSpecialIntegerConstAccessor<S, pos, width, T>;
using Storage = QSpecialIntegerStorage<S>;
using Type = T;
using UnsignedType = std::make_unsigned_t<T>;
QSpecialIntegerAccessor &operator=(Type t)
{
UnsignedType i = S::fromSpecial(storage->val);
i &= ~Const::mask();
i |= (UnsignedType(t) << pos) & Const::mask();
storage->val = S::toSpecial(i);
return *this;
}
operator Const() { return Const(storage); }
private:
template<class Storage, typename... Accessors>
friend class QSpecialIntegerBitfieldUnion;
explicit QSpecialIntegerAccessor(Storage *storage) : storage(storage) {}
Storage *storage;
};
template<class S, typename... Accessors>
class QSpecialIntegerBitfieldUnion
{
public:
constexpr QSpecialIntegerBitfieldUnion() = default;
constexpr QSpecialIntegerBitfieldUnion(QSpecialIntegerBitfieldInitializer initial)
: storage(initial)
{}
constexpr QSpecialIntegerBitfieldUnion(
typename QSpecialIntegerStorage<S>::UnsignedStorageType initial)
: storage(initial)
{}
template<typename A>
void set(typename A::Type value)
{
member<A>() = value;
}
template<typename A>
typename A::Type get() const
{
return member<A>();
}
typename QSpecialIntegerStorage<S>::UnsignedStorageType data() const
{
return storage.val;
}
private:
template<typename A>
static constexpr bool isAccessor = std::disjunction_v<std::is_same<A, Accessors>...>;
template<typename A>
A member()
{
static_assert(isAccessor<A>);
return A(&storage);
}
template<typename A>
typename A::Const member() const
{
static_assert(isAccessor<A>);
return typename A::Const(&storage);
}
QSpecialIntegerStorage<S> storage;
};
template<typename T, typename... Accessors>
using QLEIntegerBitfieldUnion
= QSpecialIntegerBitfieldUnion<QLittleEndianStorageType<T>, Accessors...>;
template<typename T, typename... Accessors>
using QBEIntegerBitfieldUnion
= QSpecialIntegerBitfieldUnion<QBigEndianStorageType<T>, Accessors...>;
template<typename... Accessors>
using qint32_le_bitfield_union = QLEIntegerBitfieldUnion<int, Accessors...>;
template<typename... Accessors>
using quint32_le_bitfield_union = QLEIntegerBitfieldUnion<uint, Accessors...>;
template<typename... Accessors>
using qint32_be_bitfield_union = QBEIntegerBitfieldUnion<int, Accessors...>;
template<typename... Accessors>
using quint32_be_bitfield_union = QBEIntegerBitfieldUnion<uint, Accessors...>;
template<int pos, int width, typename T = int>
using qint32_le_bitfield_member
= QSpecialIntegerAccessor<QLittleEndianStorageType<int>, pos, width, T>;
template<int pos, int width, typename T = uint>
using quint32_le_bitfield_member
= QSpecialIntegerAccessor<QLittleEndianStorageType<uint>, pos, width, T>;
template<int pos, int width, typename T = int>
using qint32_be_bitfield_member
= QSpecialIntegerAccessor<QBigEndianStorageType<int>, pos, width, T>;
template<int pos, int width, typename T = uint>
using quint32_be_bitfield_member
= QSpecialIntegerAccessor<QBigEndianStorageType<uint>, pos, width, T>;
QT_END_NAMESPACE
#endif // QENDIAN_P_H

View File

@@ -0,0 +1,149 @@
// 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 QEVENTDISPATCHER_WIN_P_H
#define QEVENTDISPATCHER_WIN_P_H
//
// W A R N I N G
// -------------
//
// This file is not part of the Qt API. It exists purely as an
// implementation detail. This header file may change from version to
// version without notice, or even be removed.
//
// We mean it.
//
#include "QtCore/qabstracteventdispatcher.h"
#include "QtCore/qt_windows.h"
#include "QtCore/qhash.h"
#include "QtCore/qatomic.h"
#include "qabstracteventdispatcher_p.h"
QT_BEGIN_NAMESPACE
class QEventDispatcherWin32Private;
// forward declaration
LRESULT QT_WIN_CALLBACK qt_internal_proc(HWND hwnd, UINT message, WPARAM wp, LPARAM lp);
quint64 qt_msectime();
class Q_CORE_EXPORT QEventDispatcherWin32 : public QAbstractEventDispatcher
{
Q_OBJECT
Q_DECLARE_PRIVATE(QEventDispatcherWin32)
public:
explicit QEventDispatcherWin32(QObject *parent = nullptr);
~QEventDispatcherWin32();
bool QT_ENSURE_STACK_ALIGNED_FOR_SSE processEvents(QEventLoop::ProcessEventsFlags flags) override;
void registerSocketNotifier(QSocketNotifier *notifier) override;
void unregisterSocketNotifier(QSocketNotifier *notifier) override;
void registerTimer(int timerId, qint64 interval, Qt::TimerType timerType, QObject *object) override;
bool unregisterTimer(int timerId) override;
bool unregisterTimers(QObject *object) override;
QList<TimerInfo> registeredTimers(QObject *object) const override;
int remainingTime(int timerId) override;
void wakeUp() override;
void interrupt() override;
void startingUp() override;
void closingDown() override;
bool event(QEvent *e) override;
HWND internalHwnd();
protected:
QEventDispatcherWin32(QEventDispatcherWin32Private &dd, QObject *parent = nullptr);
virtual void sendPostedEvents();
void doUnregisterSocketNotifier(QSocketNotifier *notifier);
private:
friend LRESULT QT_WIN_CALLBACK qt_internal_proc(HWND hwnd, UINT message, WPARAM wp, LPARAM lp);
};
struct QSockNot {
QSocketNotifier *obj;
int fd;
};
typedef QHash<int, QSockNot *> QSNDict;
struct QSockFd {
long event;
long mask;
bool selected;
explicit inline QSockFd(long ev = 0, long ma = 0) : event(ev), mask(ma), selected(false) { }
};
typedef QHash<int, QSockFd> QSFDict;
struct WinTimerInfo { // internal timer info
QObject *dispatcher;
int timerId;
qint64 interval;
Qt::TimerType timerType;
quint64 timeout; // - when to actually fire
QObject *obj; // - object to receive events
bool inTimerEvent;
UINT fastTimerId;
};
class QZeroTimerEvent : public QTimerEvent
{
public:
explicit inline QZeroTimerEvent(int timerId)
: QTimerEvent(timerId)
{ t = QEvent::ZeroTimerEvent; }
};
typedef QHash<int, WinTimerInfo*> WinTimerDict; // fast dict of timers
class Q_CORE_EXPORT QEventDispatcherWin32Private : public QAbstractEventDispatcherPrivate
{
Q_DECLARE_PUBLIC(QEventDispatcherWin32)
public:
QEventDispatcherWin32Private();
~QEventDispatcherWin32Private();
QAtomicInt interrupt;
// internal window handle used for socketnotifiers/timers/etc
HWND internalHwnd;
// for controlling when to send posted events
UINT_PTR sendPostedEventsTimerId;
QAtomicInt wakeUps;
void startPostedEventsTimer();
// timers
WinTimerDict timerDict;
void registerTimer(WinTimerInfo *t);
void unregisterTimer(WinTimerInfo *t);
void sendTimerEvent(int timerId);
// socket notifiers
QSNDict sn_read;
QSNDict sn_write;
QSNDict sn_except;
QSFDict active_fd;
bool activateNotifiersPosted;
void postActivateSocketNotifiers();
void doWsaAsyncSelect(int socket, long event);
bool closingDown = false;
QList<MSG> queuedUserInputEvents;
QList<MSG> queuedSocketEvents;
};
QT_END_NAMESPACE
#endif // QEVENTDISPATCHER_WIN_P_H

View File

@@ -0,0 +1,55 @@
// 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 QEVENTLOOP_P_H
#define QEVENTLOOP_P_H
//
// W A R N I N G
// -------------
//
// This file is not part of the Qt API. It exists purely as an
// implementation detail. This header file may change from version to
// version without notice, or even be removed.
//
// We mean it.
//
#include "qcoreapplication.h"
#include "qobject_p.h"
QT_BEGIN_NAMESPACE
class QEventLoopPrivate : public QObjectPrivate
{
Q_DECLARE_PUBLIC(QEventLoop)
public:
inline QEventLoopPrivate()
: inExec(false)
{
returnCode.storeRelaxed(-1);
exit.storeRelaxed(true);
}
QAtomicInt quitLockRef;
QBasicAtomicInt exit; // bool
QBasicAtomicInt returnCode;
bool inExec;
void ref()
{
quitLockRef.ref();
}
void deref()
{
if (!quitLockRef.deref() && inExec) {
qApp->postEvent(q_ptr, new QEvent(QEvent::Quit));
}
}
};
QT_END_NAMESPACE
#endif // QEVENTLOOP_P_H

View File

@@ -0,0 +1,52 @@
// Copyright (C) 2022 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 QFACTORYCACHEREGISTRATION_P_H
#define QFACTORYCACHEREGISTRATION_P_H
//
// W A R N I N G
// -------------
//
// This file is not part of the Qt API. It exists purely as an
// implementation detail. This header file may change from version to
// version without notice, or even be removed.
//
// We mean it.
//
#include <QtCore/qglobal.h>
#if !defined(QT_BOOTSTRAPPED) && QT_CONFIG(cpp_winrt)
# define QT_USE_FACTORY_CACHE_REGISTRATION
#endif
#ifdef QT_USE_FACTORY_CACHE_REGISTRATION
#include "qt_winrtbase_p.h"
QT_BEGIN_NAMESPACE
namespace detail {
class QWinRTFactoryCacheRegistration
{
public:
Q_CORE_EXPORT explicit QWinRTFactoryCacheRegistration(QFunctionPointer clearFunction);
Q_CORE_EXPORT ~QWinRTFactoryCacheRegistration();
Q_CORE_EXPORT static void clearAllCaches();
Q_DISABLE_COPY_MOVE(QWinRTFactoryCacheRegistration)
private:
QWinRTFactoryCacheRegistration **m_prevNext = nullptr;
QWinRTFactoryCacheRegistration *m_next = nullptr;
QFunctionPointer m_clearFunction;
};
inline QWinRTFactoryCacheRegistration reg([]() noexcept { winrt::clear_factory_cache(); });
}
QT_END_NAMESPACE
#endif
#endif // QFACTORYCACHEREGISTRATION_P_H

View File

@@ -0,0 +1,113 @@
// Copyright (C) 2017 The Qt Company Ltd.
// Copyright (C) 2022 Intel Corporation.
// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only
#ifndef QFACTORYLOADER_P_H
#define QFACTORYLOADER_P_H
//
// W A R N I N G
// -------------
//
// This file is not part of the Qt API. It exists purely as an
// implementation detail. This header file may change from version to
// version without notice, or even be removed.
//
// We mean it.
//
#include "QtCore/qglobal.h"
#ifndef QT_NO_QOBJECT
#include "QtCore/private/qplugin_p.h"
#include "QtCore/qcbormap.h"
#include "QtCore/qcborvalue.h"
#include "QtCore/qmap.h"
#include "QtCore/qobject.h"
#include "QtCore/qplugin.h"
QT_BEGIN_NAMESPACE
class QJsonObject;
class QLibraryPrivate;
class QPluginParsedMetaData
{
QCborValue data;
bool setError(const QString &errorString) Q_DECL_COLD_FUNCTION
{
data = errorString;
return false;
}
public:
QPluginParsedMetaData() = default;
QPluginParsedMetaData(QByteArrayView input) { parse(input); }
bool isError() const { return !data.isMap(); }
QString errorString() const { return data.toString(); }
bool parse(QByteArrayView input);
bool parse(QPluginMetaData metaData)
{ return parse(QByteArrayView(reinterpret_cast<const char *>(metaData.data), metaData.size)); }
QJsonObject toJson() const; // only for QLibrary & QPluginLoader
// if data is not a map, toMap() returns empty, so shall these functions
QCborMap toCbor() const { return data.toMap(); }
QCborValue value(QtPluginMetaDataKeys k) const { return data[int(k)]; }
};
class QFactoryLoaderPrivate;
class Q_CORE_EXPORT QFactoryLoader : public QObject
{
Q_OBJECT
Q_DECLARE_PRIVATE(QFactoryLoader)
public:
explicit QFactoryLoader(const char *iid,
const QString &suffix = QString(),
Qt::CaseSensitivity = Qt::CaseSensitive);
#if QT_CONFIG(library)
~QFactoryLoader();
void update();
static void refreshAll();
#if defined(Q_OS_UNIX) && !defined (Q_OS_MAC)
QLibraryPrivate *library(const QString &key) const;
#endif // Q_OS_UNIX && !Q_OS_MAC
#endif // QT_CONFIG(library)
void setExtraSearchPath(const QString &path);
QMultiMap<int, QString> keyMap() const;
int indexOf(const QString &needle) const;
using MetaDataList = QList<QPluginParsedMetaData>;
MetaDataList metaData() const;
QObject *instance(int index) const;
};
template <class PluginInterface, class FactoryInterface, typename ...Args>
PluginInterface *qLoadPlugin(const QFactoryLoader *loader, const QString &key, Args &&...args)
{
const int index = loader->indexOf(key);
if (index != -1) {
QObject *factoryObject = loader->instance(index);
if (FactoryInterface *factory = qobject_cast<FactoryInterface *>(factoryObject))
if (PluginInterface *result = factory->create(key, std::forward<Args>(args)...))
return result;
}
return nullptr;
}
template <class PluginInterface, class FactoryInterface, typename Arg>
Q_DECL_DEPRECATED PluginInterface *qLoadPlugin1(const QFactoryLoader *loader, const QString &key, Arg &&arg)
{ return qLoadPlugin<PluginInterface, FactoryInterface>(loader, key, std::forward<Arg>(arg)); }
QT_END_NAMESPACE
#endif // QT_NO_QOBJECT
#endif // QFACTORYLOADER_P_H

View File

@@ -0,0 +1,44 @@
// 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 QFILE_P_H
#define QFILE_P_H
//
// W A R N I N G
// -------------
//
// This file is not part of the Qt API. It exists purely as an
// implementation detail. This header file may change from version to
// version without notice, or even be removed.
//
// We mean it.
//
#include "qfile.h"
#include "private/qfiledevice_p.h"
QT_BEGIN_NAMESPACE
class QTemporaryFile;
class QFilePrivate : public QFileDevicePrivate
{
Q_DECLARE_PUBLIC(QFile)
friend class QTemporaryFile;
protected:
QFilePrivate();
~QFilePrivate();
bool openExternalFile(QIODevice::OpenMode flags, int fd, QFile::FileHandleFlags handleFlags);
bool openExternalFile(QIODevice::OpenMode flags, FILE *fh, QFile::FileHandleFlags handleFlags);
QAbstractFileEngine *engine() const override;
QString fileName;
};
QT_END_NAMESPACE
#endif // QFILE_P_H

View File

@@ -0,0 +1,138 @@
// Copyright (C) 2022 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 QFILEDEVICE_P_H
#define QFILEDEVICE_P_H
//
// W A R N I N G
// -------------
//
// This file is not part of the Qt API. It exists purely as an
// implementation detail. This header file may change from version to
// version without notice, or even be removed.
//
// We mean it.
//
#include "private/qiodevice_p.h"
#include "qfiledevice.h"
#include <memory>
#if defined(Q_OS_UNIX)
# include <sys/types.h> // for mode_t
# include <sys/stat.h> // for mode_t constants
#elif defined(Q_OS_WINDOWS)
# include <qt_windows.h>
# include <winnt.h> // for SECURITY_DESCRIPTOR
# include <optional>
# if defined(QT_BOOTSTRAPPED)
# define QT_FEATURE_fslibs -1
# else
# define QT_FEATURE_fslibs 1
# endif // QT_BOOTSTRAPPED
#endif
QT_BEGIN_NAMESPACE
class QAbstractFileEngine;
class QFSFileEngine;
class QFileDevicePrivate : public QIODevicePrivate
{
Q_DECLARE_PUBLIC(QFileDevice)
protected:
QFileDevicePrivate();
~QFileDevicePrivate();
virtual QAbstractFileEngine *engine() const;
inline bool ensureFlushed() const;
bool putCharHelper(char c) override;
void setError(QFileDevice::FileError err);
void setError(QFileDevice::FileError err, const QString &errorString);
void setError(QFileDevice::FileError err, int errNum);
mutable std::unique_ptr<QAbstractFileEngine> fileEngine;
mutable qint64 cachedSize;
QFileDevice::FileHandleFlags handleFlags;
QFileDevice::FileError error;
bool lastWasWrite;
};
inline bool QFileDevicePrivate::ensureFlushed() const
{
// This function ensures that the write buffer has been flushed (const
// because certain const functions need to call it.
if (lastWasWrite) {
const_cast<QFileDevicePrivate *>(this)->lastWasWrite = false;
if (!const_cast<QFileDevice *>(q_func())->flush())
return false;
}
return true;
}
#ifdef Q_OS_UNIX
namespace QtPrivate {
constexpr mode_t toMode_t(QFileDevice::Permissions permissions)
{
mode_t mode = 0;
if (permissions & (QFileDevice::ReadOwner | QFileDevice::ReadUser))
mode |= S_IRUSR;
if (permissions & (QFileDevice::WriteOwner | QFileDevice::WriteUser))
mode |= S_IWUSR;
if (permissions & (QFileDevice::ExeOwner | QFileDevice::ExeUser))
mode |= S_IXUSR;
if (permissions & QFileDevice::ReadGroup)
mode |= S_IRGRP;
if (permissions & QFileDevice::WriteGroup)
mode |= S_IWGRP;
if (permissions & QFileDevice::ExeGroup)
mode |= S_IXGRP;
if (permissions & QFileDevice::ReadOther)
mode |= S_IROTH;
if (permissions & QFileDevice::WriteOther)
mode |= S_IWOTH;
if (permissions & QFileDevice::ExeOther)
mode |= S_IXOTH;
return mode;
}
} // namespace QtPrivate
#elif defined(Q_OS_WINDOWS)
class QNativeFilePermissions
{
public:
QNativeFilePermissions(std::optional<QFileDevice::Permissions> perms, bool isDir);
SECURITY_ATTRIBUTES *securityAttributes();
bool isOk() const { return ok; }
private:
bool ok = false;
bool isNull = true;
// At most 1 allow + 1 deny ACEs for user and group, 1 allow ACE for others
static constexpr auto MaxNumACEs = 5;
static constexpr auto MaxACLSize =
sizeof(ACL) + (sizeof(ACCESS_ALLOWED_ACE) + SECURITY_MAX_SID_SIZE) * MaxNumACEs;
SECURITY_ATTRIBUTES sa;
#if QT_CONFIG(fslibs)
SECURITY_DESCRIPTOR sd;
alignas(DWORD) char aclStorage[MaxACLSize];
#endif
};
#endif // Q_OS_UNIX
QT_END_NAMESPACE
#endif // QFILEDEVICE_P_H

View File

@@ -0,0 +1,173 @@
// 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 QFILEINFO_P_H
#define QFILEINFO_P_H
//
// W A R N I N G
// -------------
//
// This file is not part of the Qt API. It exists purely as an
// implementation detail. This header file may change from version to
// version without notice, or even be removed.
//
// We mean it.
//
#include "qfileinfo.h"
#include "qdatetime.h"
#include "qatomic.h"
#include "qshareddata.h"
#include "qfilesystemengine_p.h"
#include <QtCore/private/qabstractfileengine_p.h>
#include <QtCore/private/qfilesystementry_p.h>
#include <QtCore/private/qfilesystemmetadata_p.h>
#include <memory>
QT_BEGIN_NAMESPACE
class QFileInfoPrivate : public QSharedData
{
public:
enum {
// note: cachedFlags is only 30-bits wide
CachedFileFlags = 0x01,
CachedLinkTypeFlag = 0x02,
CachedBundleTypeFlag = 0x04,
CachedSize = 0x08,
CachedATime = 0x10,
CachedBTime = 0x20,
CachedMCTime = 0x40,
CachedMTime = 0x80,
CachedPerms = 0x100
};
inline QFileInfoPrivate()
: QSharedData(), fileEngine(nullptr),
cachedFlags(0),
isDefaultConstructed(true),
cache_enabled(true), fileFlags(0), fileSize(0)
{}
inline QFileInfoPrivate(const QFileInfoPrivate &copy)
: QSharedData(copy),
fileEntry(copy.fileEntry),
metaData(copy.metaData),
fileEngine(QFileSystemEngine::resolveEntryAndCreateLegacyEngine(fileEntry, metaData)),
cachedFlags(0),
#ifndef QT_NO_FSFILEENGINE
isDefaultConstructed(false),
#else
isDefaultConstructed(!fileEngine),
#endif
cache_enabled(copy.cache_enabled), fileFlags(0), fileSize(0)
{}
inline QFileInfoPrivate(const QString &file)
: fileEntry(file),
fileEngine(QFileSystemEngine::resolveEntryAndCreateLegacyEngine(fileEntry, metaData)),
cachedFlags(0),
#ifndef QT_NO_FSFILEENGINE
isDefaultConstructed(file.isEmpty()),
#else
isDefaultConstructed(!fileEngine),
#endif
cache_enabled(true), fileFlags(0), fileSize(0)
{
}
inline QFileInfoPrivate(const QFileSystemEntry &file, const QFileSystemMetaData &data)
: QSharedData(),
fileEntry(file),
metaData(data),
fileEngine(QFileSystemEngine::resolveEntryAndCreateLegacyEngine(fileEntry, metaData)),
cachedFlags(0),
isDefaultConstructed(false),
cache_enabled(true), fileFlags(0), fileSize(0)
{
//If the file engine is not null, this maybe a "mount point" for a custom file engine
//in which case we can't trust the metadata
if (fileEngine)
metaData = QFileSystemMetaData();
}
inline QFileInfoPrivate(const QFileSystemEntry &file, const QFileSystemMetaData &data, std::unique_ptr<QAbstractFileEngine> engine)
: fileEntry(file),
metaData(data),
fileEngine{std::move(engine)},
cachedFlags(0),
#ifndef QT_NO_FSFILEENGINE
isDefaultConstructed(false),
#else
isDefaultConstructed(!fileEngine),
#endif
cache_enabled(true), fileFlags(0), fileSize(0)
{
}
inline void clearFlags() const {
fileFlags = 0;
cachedFlags = 0;
if (fileEngine)
(void)fileEngine->fileFlags(QAbstractFileEngine::Refresh);
}
inline void clear() {
metaData.clear();
clearFlags();
for (int i = QAbstractFileEngine::NFileNames - 1 ; i >= 0 ; --i)
fileNames[i].clear();
fileOwners[1].clear();
fileOwners[0].clear();
}
uint getFileFlags(QAbstractFileEngine::FileFlags) const;
QDateTime &getFileTime(QAbstractFileEngine::FileTime) const;
QString getFileName(QAbstractFileEngine::FileName) const;
QString getFileOwner(QAbstractFileEngine::FileOwner own) const;
QFileSystemEntry fileEntry;
mutable QFileSystemMetaData metaData;
std::unique_ptr<QAbstractFileEngine> const fileEngine;
mutable QString fileNames[QAbstractFileEngine::NFileNames];
mutable QString fileOwners[2]; // QAbstractFileEngine::FileOwner: OwnerUser and OwnerGroup
mutable QDateTime fileTimes[4]; // QAbstractFileEngine::FileTime: BirthTime, MetadataChangeTime, ModificationTime, AccessTime
mutable uint cachedFlags : 30;
bool const isDefaultConstructed : 1; // QFileInfo is a default constructed instance
bool cache_enabled : 1;
mutable uint fileFlags;
mutable qint64 fileSize;
inline bool getCachedFlag(uint c) const
{ return cache_enabled ? (cachedFlags & c) : 0; }
inline void setCachedFlag(uint c) const
{ if (cache_enabled) cachedFlags |= c; }
template <typename Ret, typename FSLambda, typename EngineLambda>
Ret checkAttribute(Ret defaultValue, QFileSystemMetaData::MetaDataFlags fsFlags, const FSLambda &fsLambda,
const EngineLambda &engineLambda) const
{
if (isDefaultConstructed)
return defaultValue;
if (fileEngine)
return engineLambda();
if (!cache_enabled || !metaData.hasFlags(fsFlags)) {
QFileSystemEngine::fillMetaData(fileEntry, metaData, fsFlags);
// ignore errors, fillMetaData will have cleared the flags
}
return fsLambda();
}
template <typename Ret, typename FSLambda, typename EngineLambda>
Ret checkAttribute(QFileSystemMetaData::MetaDataFlags fsFlags, const FSLambda &fsLambda,
const EngineLambda &engineLambda) const
{
return checkAttribute(Ret(), fsFlags, fsLambda, engineLambda);
}
};
QT_END_NAMESPACE
#endif // QFILEINFO_P_H

View File

@@ -0,0 +1,48 @@
// Copyright (C) 2013 BlackBerry Limited. All rights reserved.
// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only
#ifndef QFILESELECTOR_P_H
#define QFILESELECTOR_P_H
//
// W A R N I N G
// -------------
//
// This file is not part of the Qt API. It exists purely as an
// implementation detail. This header file may change from version to
// version without notice, or even be removed.
//
// We mean it.
//
#include <QtCore/QString>
#include <QtCore/QFileSelector>
#include <private/qobject_p.h>
QT_BEGIN_NAMESPACE
struct QFileSelectorSharedData //Not QSharedData because currently is just a global store
{
QStringList staticSelectors;
QStringList preloadedStatics;
};
class Q_CORE_EXPORT QFileSelectorPrivate : QObjectPrivate //Exported for use in other modules (like QtGui)
{
Q_DECLARE_PUBLIC(QFileSelector)
public:
static void updateSelectors();
static QStringList platformSelectors();
static void addStatics(const QStringList &); //For loading GUI statics from other Qt modules
static QString selectionHelper(const QString &path, const QString &fileName,
const QStringList &selectors, QChar indicator = u'+');
QFileSelectorPrivate();
QString select(const QString &filePath) const;
QStringList extras;
};
QT_END_NAMESPACE
#endif

View File

@@ -0,0 +1,153 @@
// 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 QFILESYSTEMENGINE_P_H
#define QFILESYSTEMENGINE_P_H
//
// W A R N I N G
// -------------
//
// This file is not part of the Qt API. It exists purely as an
// implementation detail. This header file may change from version to
// version without notice, or even be removed.
//
// We mean it.
//
#include "qfile.h"
#include "qfilesystementry_p.h"
#include "qfilesystemmetadata_p.h"
#include <QtCore/private/qsystemerror_p.h>
#include <optional>
QT_BEGIN_NAMESPACE
#define Q_RETURN_ON_INVALID_FILENAME(message, result) \
{ \
QMessageLogger(QT_MESSAGELOG_FILE, QT_MESSAGELOG_LINE, QT_MESSAGELOG_FUNC).warning(message); \
errno = EINVAL; \
return (result); \
}
inline bool qIsFilenameBroken(const QByteArray &name)
{
return name.contains('\0');
}
inline bool qIsFilenameBroken(const QString &name)
{
return name.contains(QLatin1Char('\0'));
}
inline bool qIsFilenameBroken(const QFileSystemEntry &entry)
{
return qIsFilenameBroken(entry.nativeFilePath());
}
#define Q_CHECK_FILE_NAME(name, result) \
do { \
if (Q_UNLIKELY((name).isEmpty())) \
Q_RETURN_ON_INVALID_FILENAME("Empty filename passed to function", (result)); \
if (Q_UNLIKELY(qIsFilenameBroken(name))) \
Q_RETURN_ON_INVALID_FILENAME("Broken filename passed to function", (result)); \
} while (false)
class Q_AUTOTEST_EXPORT QFileSystemEngine
{
public:
static bool isCaseSensitive()
{
#ifndef Q_OS_WIN
return true;
#else
return false;
#endif
}
static QFileSystemEntry getLinkTarget(const QFileSystemEntry &link, QFileSystemMetaData &data);
static QFileSystemEntry getJunctionTarget(const QFileSystemEntry &link, QFileSystemMetaData &data);
static QFileSystemEntry canonicalName(const QFileSystemEntry &entry, QFileSystemMetaData &data);
static QFileSystemEntry absoluteName(const QFileSystemEntry &entry);
static QByteArray id(const QFileSystemEntry &entry);
static QString resolveUserName(const QFileSystemEntry &entry, QFileSystemMetaData &data);
static QString resolveGroupName(const QFileSystemEntry &entry, QFileSystemMetaData &data);
#if defined(Q_OS_UNIX)
static QString resolveUserName(uint userId);
static QString resolveGroupName(uint groupId);
#endif
#if defined(Q_OS_DARWIN)
static QString bundleName(const QFileSystemEntry &entry);
#else
static QString bundleName(const QFileSystemEntry &) { return QString(); }
#endif
static bool fillMetaData(const QFileSystemEntry &entry, QFileSystemMetaData &data,
QFileSystemMetaData::MetaDataFlags what);
#if defined(Q_OS_UNIX)
static bool cloneFile(int srcfd, int dstfd, const QFileSystemMetaData &knownData);
static bool fillMetaData(int fd, QFileSystemMetaData &data); // what = PosixStatFlags
static QByteArray id(int fd);
static bool setFileTime(int fd, const QDateTime &newDate,
QAbstractFileEngine::FileTime whatTime, QSystemError &error);
static bool setPermissions(int fd, QFile::Permissions permissions, QSystemError &error,
QFileSystemMetaData *data = nullptr);
#endif
#if defined(Q_OS_WIN)
static QFileSystemEntry junctionTarget(const QFileSystemEntry &link, QFileSystemMetaData &data);
static bool uncListSharesOnServer(const QString &server, QStringList *list); //Used also by QFSFileEngineIterator::hasNext()
static bool fillMetaData(int fd, QFileSystemMetaData &data,
QFileSystemMetaData::MetaDataFlags what);
static bool fillMetaData(HANDLE fHandle, QFileSystemMetaData &data,
QFileSystemMetaData::MetaDataFlags what);
static bool fillPermissions(const QFileSystemEntry &entry, QFileSystemMetaData &data,
QFileSystemMetaData::MetaDataFlags what);
static QByteArray id(HANDLE fHandle);
static bool setFileTime(HANDLE fHandle, const QDateTime &newDate,
QAbstractFileEngine::FileTime whatTime, QSystemError &error);
static QString owner(const QFileSystemEntry &entry, QAbstractFileEngine::FileOwner own);
static QString nativeAbsoluteFilePath(const QString &path);
static bool isDirPath(const QString &path, bool *existed);
#endif
//homePath, rootPath and tempPath shall return clean paths
static QString homePath();
static QString rootPath();
static QString tempPath();
static bool createDirectory(const QFileSystemEntry &entry, bool createParents,
std::optional<QFile::Permissions> permissions = std::nullopt);
static bool removeDirectory(const QFileSystemEntry &entry, bool removeEmptyParents);
static bool createLink(const QFileSystemEntry &source, const QFileSystemEntry &target, QSystemError &error);
static bool copyFile(const QFileSystemEntry &source, const QFileSystemEntry &target, QSystemError &error);
static bool moveFileToTrash(const QFileSystemEntry &source, QFileSystemEntry &newLocation, QSystemError &error);
static bool renameFile(const QFileSystemEntry &source, const QFileSystemEntry &target, QSystemError &error);
static bool renameOverwriteFile(const QFileSystemEntry &source, const QFileSystemEntry &target, QSystemError &error);
static bool removeFile(const QFileSystemEntry &entry, QSystemError &error);
static bool setPermissions(const QFileSystemEntry &entry, QFile::Permissions permissions, QSystemError &error,
QFileSystemMetaData *data = nullptr);
// unused, therefore not implemented
static bool setFileTime(const QFileSystemEntry &entry, const QDateTime &newDate,
QAbstractFileEngine::FileTime whatTime, QSystemError &error);
static bool setCurrentPath(const QFileSystemEntry &entry);
static QFileSystemEntry currentPath();
static QAbstractFileEngine *resolveEntryAndCreateLegacyEngine(QFileSystemEntry &entry,
QFileSystemMetaData &data);
private:
static QString slowCanonicalized(const QString &path);
#if defined(Q_OS_WIN)
static void clearWinStatData(QFileSystemMetaData &data);
#endif
};
QT_END_NAMESPACE
#endif // include guard

View File

@@ -0,0 +1,91 @@
// 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
//
// W A R N I N G
// -------------
//
// This file is not part of the Qt API. It exists purely as an
// implementation detail. This header file may change from version to
// version without notice, or even be removed.
//
// We mean it.
//
#include <QtCore/private/qglobal_p.h>
#include <QtCore/qstring.h>
#include <QtCore/qbytearray.h>
QT_BEGIN_NAMESPACE
class QFileSystemEntry
{
public:
#ifndef Q_OS_WIN
typedef QByteArray NativePath;
#else
typedef QString NativePath;
#endif
struct FromNativePath{};
struct FromInternalPath{};
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)
Q_AUTOTEST_EXPORT bool isDriveRoot() const;
static bool isDriveRootPath(const QString &path);
static QString removeUncOrLongPathPrefix(QString path);
#endif
Q_AUTOTEST_EXPORT bool isRoot() const;
Q_AUTOTEST_EXPORT bool isEmpty() const;
void clear()
{
*this = QFileSystemEntry();
}
Q_CORE_EXPORT static bool isRootPath(const QString &path);
private:
// creates the QString version out of the bytearray version
void resolveFilePath() const;
// creates the bytearray version out of the QString version
void resolveNativeFilePath() const;
// resolves the separator
void findLastSeparator() const;
// resolves the dots and the separator
void findFileNameSeparators() const;
mutable QString m_filePath; // always has slashes as separator
mutable NativePath m_nativeFilePath; // native encoding and separators
mutable qint16 m_lastSeparator; // index in m_filePath of last separator
mutable qint16 m_firstDotInFileName; // index after m_filePath for first dot (.)
mutable qint16 m_lastDotInFileName; // index after m_firstDotInFileName for last dot (.)
};
QT_END_NAMESPACE
#endif // include guard

View File

@@ -0,0 +1,70 @@
// 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 QFILESYSTEMITERATOR_P_H
#define QFILESYSTEMITERATOR_P_H
//
// W A R N I N G
// -------------
//
// This file is not part of the Qt API. It exists purely as an
// implementation detail. This header file may change from version to
// version without notice, or even be removed.
//
// We mean it.
//
#include <QtCore/qglobal.h>
#ifndef QT_NO_FILESYSTEMITERATOR
#include <QtCore/qdir.h>
#include <QtCore/qdiriterator.h>
#include <QtCore/qstringlist.h>
#include <QtCore/private/qfilesystementry_p.h>
#include <QtCore/private/qfilesystemmetadata_p.h>
// Platform-specific headers
#if !defined(Q_OS_WIN)
#include <QtCore/qscopedpointer.h>
#endif
QT_BEGIN_NAMESPACE
class QFileSystemIterator
{
public:
QFileSystemIterator(const QFileSystemEntry &entry, QDir::Filters filters,
const QStringList &nameFilters, QDirIterator::IteratorFlags flags
= QDirIterator::FollowSymlinks | QDirIterator::Subdirectories);
~QFileSystemIterator();
bool advance(QFileSystemEntry &fileEntry, QFileSystemMetaData &metaData);
private:
QFileSystemEntry::NativePath nativePath;
// Platform-specific data
#if defined(Q_OS_WIN)
QString dirPath;
HANDLE findFileHandle;
QStringList uncShares;
bool uncFallback;
int uncShareIndex;
bool onlyDirs;
#else
QT_DIR *dir;
QT_DIRENT *dirEntry;
int lastError;
#endif
Q_DISABLE_COPY_MOVE(QFileSystemIterator)
};
QT_END_NAMESPACE
#endif // QT_NO_FILESYSTEMITERATOR
#endif // include guard

View File

@@ -0,0 +1,375 @@
// 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 QFILESYSTEMMETADATA_P_H
#define QFILESYSTEMMETADATA_P_H
//
// W A R N I N G
// -------------
//
// This file is not part of the Qt API. It exists purely as an
// implementation detail. This header file may change from version to
// version without notice, or even be removed.
//
// We mean it.
//
#include "qplatformdefs.h"
#include <QtCore/qglobal.h>
#include <QtCore/qdatetime.h>
#include <QtCore/qtimezone.h>
#include <QtCore/private/qabstractfileengine_p.h>
// Platform-specific includes
#ifdef Q_OS_WIN
# include <QtCore/qt_windows.h>
# ifndef IO_REPARSE_TAG_SYMLINK
# define IO_REPARSE_TAG_SYMLINK (0xA000000CL)
# endif
#endif
#ifdef Q_OS_UNIX
struct statx;
#endif
QT_BEGIN_NAMESPACE
class QFileSystemEngine;
class Q_AUTOTEST_EXPORT QFileSystemMetaData
{
public:
QFileSystemMetaData()
: size_(-1)
{
}
enum MetaDataFlag {
// Permissions, overlaps with QFile::Permissions
OtherReadPermission = 0x00000004, OtherWritePermission = 0x00000002, OtherExecutePermission = 0x00000001,
GroupReadPermission = 0x00000040, GroupWritePermission = 0x00000020, GroupExecutePermission = 0x00000010,
UserReadPermission = 0x00000400, UserWritePermission = 0x00000200, UserExecutePermission = 0x00000100,
OwnerReadPermission = 0x00004000, OwnerWritePermission = 0x00002000, OwnerExecutePermission = 0x00001000,
OtherPermissions = OtherReadPermission | OtherWritePermission | OtherExecutePermission,
GroupPermissions = GroupReadPermission | GroupWritePermission | GroupExecutePermission,
UserPermissions = UserReadPermission | UserWritePermission | UserExecutePermission,
OwnerPermissions = OwnerReadPermission | OwnerWritePermission | OwnerExecutePermission,
ReadPermissions = OtherReadPermission | GroupReadPermission | UserReadPermission | OwnerReadPermission,
WritePermissions = OtherWritePermission | GroupWritePermission | UserWritePermission | OwnerWritePermission,
ExecutePermissions = OtherExecutePermission | GroupExecutePermission | UserExecutePermission | OwnerExecutePermission,
Permissions = OtherPermissions | GroupPermissions | UserPermissions | OwnerPermissions,
// Type
LinkType = 0x00010000,
FileType = 0x00020000,
DirectoryType = 0x00040000,
#if defined(Q_OS_DARWIN)
BundleType = 0x00080000,
AliasType = 0x08000000,
#else
BundleType = 0x0,
AliasType = 0x0,
#endif
#if defined(Q_OS_WIN)
JunctionType = 0x04000000,
WinLnkType = 0x08000000, // Note: Uses the same position for AliasType on Mac
#else
JunctionType = 0x0,
WinLnkType = 0x0,
#endif
SequentialType = 0x00800000, // Note: overlaps with QAbstractFileEngine::RootFlag
LegacyLinkType = LinkType | AliasType | WinLnkType,
Type = LinkType | FileType | DirectoryType | BundleType | SequentialType | AliasType,
// Attributes
HiddenAttribute = 0x00100000,
SizeAttribute = 0x00200000, // Note: overlaps with QAbstractFileEngine::LocalDiskFlag
ExistsAttribute = 0x00400000, // For historical reasons, indicates existence of data, not the file
#if defined(Q_OS_WIN)
WasDeletedAttribute = 0x0,
#else
WasDeletedAttribute = 0x40000000, // Indicates the file was deleted
#endif
Attributes = HiddenAttribute | SizeAttribute | ExistsAttribute | WasDeletedAttribute,
// Times - if we know one of them, we know them all
AccessTime = 0x02000000,
BirthTime = 0x02000000,
MetadataChangeTime = 0x02000000,
ModificationTime = 0x02000000,
Times = AccessTime | BirthTime | MetadataChangeTime | ModificationTime,
// Owner IDs
UserId = 0x10000000,
GroupId = 0x20000000,
OwnerIds = UserId | GroupId,
PosixStatFlags = QFileSystemMetaData::OtherPermissions
| QFileSystemMetaData::GroupPermissions
| QFileSystemMetaData::OwnerPermissions
| QFileSystemMetaData::FileType
| QFileSystemMetaData::DirectoryType
| QFileSystemMetaData::SequentialType
| QFileSystemMetaData::SizeAttribute
| QFileSystemMetaData::WasDeletedAttribute
| QFileSystemMetaData::Times
| QFileSystemMetaData::OwnerIds,
#if defined(Q_OS_WIN)
WinStatFlags = QFileSystemMetaData::FileType
| QFileSystemMetaData::DirectoryType
| QFileSystemMetaData::HiddenAttribute
| QFileSystemMetaData::ExistsAttribute
| QFileSystemMetaData::SizeAttribute
| QFileSystemMetaData::Times,
#endif
AllMetaDataFlags = 0xFFFFFFFF
};
Q_DECLARE_FLAGS(MetaDataFlags, MetaDataFlag)
bool hasFlags(MetaDataFlags flags) const
{
return ((knownFlagsMask & flags) == flags);
}
MetaDataFlags missingFlags(MetaDataFlags flags)
{
return flags & ~knownFlagsMask;
}
void clear()
{
knownFlagsMask = {};
}
void clearFlags(MetaDataFlags flags = AllMetaDataFlags)
{
knownFlagsMask &= ~flags;
}
bool exists() const { return entryFlags.testAnyFlag(ExistsAttribute); }
bool isLink() const { return entryFlags.testAnyFlag(LinkType); }
bool isFile() const { return entryFlags.testAnyFlag(FileType); }
bool isDirectory() const { return entryFlags.testAnyFlag(DirectoryType); }
bool isBundle() const;
bool isAlias() const;
bool isLegacyLink() const { return entryFlags.testAnyFlag(LegacyLinkType); }
bool isSequential() const { return entryFlags.testAnyFlag(SequentialType); }
bool isHidden() const { return entryFlags.testAnyFlag(HiddenAttribute); }
bool wasDeleted() const { return entryFlags.testAnyFlag(WasDeletedAttribute); }
#if defined(Q_OS_WIN)
bool isLnkFile() const { return entryFlags.testAnyFlag(WinLnkType); }
bool isJunction() const { return entryFlags.testAnyFlag(JunctionType); }
#else
bool isLnkFile() const { return false; }
bool isJunction() const { return false; }
#endif
qint64 size() const { return size_; }
QFile::Permissions permissions() const;
QDateTime accessTime() const;
QDateTime birthTime() const;
QDateTime metadataChangeTime() const;
QDateTime modificationTime() const;
QDateTime fileTime(QAbstractFileEngine::FileTime time) const;
uint userId() const;
uint groupId() const;
uint ownerId(QAbstractFileEngine::FileOwner owner) const;
#ifdef Q_OS_UNIX
void fillFromStatxBuf(const struct statx &statBuffer);
void fillFromStatBuf(const QT_STATBUF &statBuffer);
void fillFromDirEnt(const QT_DIRENT &statBuffer);
#endif
#if defined(Q_OS_WIN)
inline void fillFromFileAttribute(DWORD fileAttribute, bool isDriveRoot = false);
inline void fillFromFindData(WIN32_FIND_DATA &findData, bool setLinkType = false, bool isDriveRoot = false);
inline void fillFromFindInfo(BY_HANDLE_FILE_INFORMATION &fileInfo);
#endif
private:
friend class QFileSystemEngine;
MetaDataFlags knownFlagsMask;
MetaDataFlags entryFlags;
qint64 size_ = 0;
// Platform-specific data goes here:
#if defined(Q_OS_WIN)
DWORD fileAttribute_;
FILETIME birthTime_;
FILETIME changeTime_;
FILETIME lastAccessTime_;
FILETIME lastWriteTime_;
#else
// msec precision
qint64 accessTime_ = 0;
qint64 birthTime_ = 0;
qint64 metadataChangeTime_ = 0;
qint64 modificationTime_ = 0;
uint userId_ = (uint) -2;
uint groupId_ = (uint) -2;
#endif
};
Q_DECLARE_OPERATORS_FOR_FLAGS(QFileSystemMetaData::MetaDataFlags)
inline QFile::Permissions QFileSystemMetaData::permissions() const { return QFile::Permissions::fromInt((Permissions & entryFlags).toInt()); }
#if defined(Q_OS_DARWIN)
inline bool QFileSystemMetaData::isBundle() const { return entryFlags.testAnyFlag(BundleType); }
inline bool QFileSystemMetaData::isAlias() const { return entryFlags.testAnyFlag(AliasType); }
#else
inline bool QFileSystemMetaData::isBundle() const { return false; }
inline bool QFileSystemMetaData::isAlias() const { return false; }
#endif
#if defined(Q_OS_UNIX) || defined (Q_OS_WIN)
inline QDateTime QFileSystemMetaData::fileTime(QAbstractFileEngine::FileTime time) const
{
switch (time) {
case QAbstractFileEngine::ModificationTime:
return modificationTime();
case QAbstractFileEngine::AccessTime:
return accessTime();
case QAbstractFileEngine::BirthTime:
return birthTime();
case QAbstractFileEngine::MetadataChangeTime:
return metadataChangeTime();
}
return QDateTime();
}
#endif
#if defined(Q_OS_UNIX)
inline QDateTime QFileSystemMetaData::birthTime() const
{
return birthTime_
? QDateTime::fromMSecsSinceEpoch(birthTime_, QTimeZone::UTC)
: QDateTime();
}
inline QDateTime QFileSystemMetaData::metadataChangeTime() const
{
return metadataChangeTime_
? QDateTime::fromMSecsSinceEpoch(metadataChangeTime_, QTimeZone::UTC)
: QDateTime();
}
inline QDateTime QFileSystemMetaData::modificationTime() const
{
return modificationTime_
? QDateTime::fromMSecsSinceEpoch(modificationTime_, QTimeZone::UTC)
: QDateTime();
}
inline QDateTime QFileSystemMetaData::accessTime() const
{
return accessTime_
? QDateTime::fromMSecsSinceEpoch(accessTime_, QTimeZone::UTC)
: QDateTime();
}
inline uint QFileSystemMetaData::userId() const { return userId_; }
inline uint QFileSystemMetaData::groupId() const { return groupId_; }
inline uint QFileSystemMetaData::ownerId(QAbstractFileEngine::FileOwner owner) const
{
if (owner == QAbstractFileEngine::OwnerUser)
return userId();
else
return groupId();
}
#endif
#if defined(Q_OS_WIN)
inline uint QFileSystemMetaData::userId() const { return (uint) -2; }
inline uint QFileSystemMetaData::groupId() const { return (uint) -2; }
inline uint QFileSystemMetaData::ownerId(QAbstractFileEngine::FileOwner owner) const
{
if (owner == QAbstractFileEngine::OwnerUser)
return userId();
else
return groupId();
}
inline void QFileSystemMetaData::fillFromFileAttribute(DWORD fileAttribute,bool isDriveRoot)
{
fileAttribute_ = fileAttribute;
// Ignore the hidden attribute for drives.
if (!isDriveRoot && (fileAttribute_ & FILE_ATTRIBUTE_HIDDEN))
entryFlags |= HiddenAttribute;
entryFlags |= ((fileAttribute & FILE_ATTRIBUTE_DIRECTORY) ? DirectoryType: FileType);
entryFlags |= ExistsAttribute;
knownFlagsMask |= FileType | DirectoryType | HiddenAttribute | ExistsAttribute;
}
inline void QFileSystemMetaData::fillFromFindData(WIN32_FIND_DATA &findData, bool setLinkType, bool isDriveRoot)
{
fillFromFileAttribute(findData.dwFileAttributes, isDriveRoot);
birthTime_ = findData.ftCreationTime;
lastAccessTime_ = findData.ftLastAccessTime;
changeTime_ = lastWriteTime_ = findData.ftLastWriteTime;
if (fileAttribute_ & FILE_ATTRIBUTE_DIRECTORY) {
size_ = 0;
} else {
size_ = findData.nFileSizeHigh;
size_ <<= 32;
size_ += findData.nFileSizeLow;
}
knownFlagsMask |= Times | SizeAttribute;
if (setLinkType) {
knownFlagsMask |= LinkType;
entryFlags &= ~LinkType;
if (fileAttribute_ & FILE_ATTRIBUTE_REPARSE_POINT) {
if (findData.dwReserved0 == IO_REPARSE_TAG_SYMLINK) {
entryFlags |= LinkType;
#if defined(IO_REPARSE_TAG_MOUNT_POINT)
} else if ((fileAttribute_ & FILE_ATTRIBUTE_DIRECTORY)
&& (findData.dwReserved0 == IO_REPARSE_TAG_MOUNT_POINT)) {
entryFlags |= JunctionType;
#endif
}
}
}
}
inline void QFileSystemMetaData::fillFromFindInfo(BY_HANDLE_FILE_INFORMATION &fileInfo)
{
fillFromFileAttribute(fileInfo.dwFileAttributes);
birthTime_ = fileInfo.ftCreationTime;
lastAccessTime_ = fileInfo.ftLastAccessTime;
changeTime_ = lastWriteTime_ = fileInfo.ftLastWriteTime;
if (fileAttribute_ & FILE_ATTRIBUTE_DIRECTORY) {
size_ = 0;
} else {
size_ = fileInfo.nFileSizeHigh;
size_ <<= 32;
size_ += fileInfo.nFileSizeLow;
}
knownFlagsMask |= Times | SizeAttribute;
}
#endif // Q_OS_WIN
QT_END_NAMESPACE
#endif // include guard

View File

@@ -0,0 +1,87 @@
// 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 QFILESYSTEMWATCHER_P_H
#define QFILESYSTEMWATCHER_P_H
//
// W A R N I N G
// -------------
//
// This file is not part of the Qt API. It exists purely as an
// implementation detail. This header file may change from version to
// version without notice, or even be removed.
//
// We mean it.
//
#include "qfilesystemwatcher.h"
QT_REQUIRE_CONFIG(filesystemwatcher);
#include <private/qobject_p.h>
#include <QtCore/qstringlist.h>
#include <QtCore/qhash.h>
QT_BEGIN_NAMESPACE
class QFileSystemWatcherEngine : public QObject
{
Q_OBJECT
protected:
inline QFileSystemWatcherEngine(QObject *parent)
: QObject(parent)
{
}
public:
// fills \a files and \a directories with the \a paths it could
// watch, and returns a list of paths this engine could not watch
virtual QStringList addPaths(const QStringList &paths,
QStringList *files,
QStringList *directories) = 0;
// removes \a paths from \a files and \a directories, and returns
// a list of paths this engine does not know about (either addPath
// failed or wasn't called)
virtual QStringList removePaths(const QStringList &paths,
QStringList *files,
QStringList *directories) = 0;
Q_SIGNALS:
void fileChanged(const QString &path, bool removed);
void directoryChanged(const QString &path, bool removed);
};
class QFileSystemWatcherPrivate : public QObjectPrivate
{
Q_DECLARE_PUBLIC(QFileSystemWatcher)
static QFileSystemWatcherEngine *createNativeEngine(QObject *parent);
public:
QFileSystemWatcherPrivate();
void init();
void initPollerEngine();
QFileSystemWatcherEngine *native, *poller;
QStringList files, directories;
// private slots
void _q_fileChanged(const QString &path, bool removed);
void _q_directoryChanged(const QString &path, bool removed);
#if defined(Q_OS_WIN)
void _q_winDriveLockForRemoval(const QString &);
void _q_winDriveLockForRemovalFailed(const QString &);
void _q_winDriveRemoved(const QString &);
private:
QHash<QChar, QStringList> temporarilyRemovedPaths;
#endif // Q_OS_WIN
};
QT_END_NAMESPACE
#endif // QFILESYSTEMWATCHER_P_H

View File

@@ -0,0 +1,89 @@
// 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 QFILESYSTEMWATCHER_POLLING_P_H
#define QFILESYSTEMWATCHER_POLLING_P_H
//
// W A R N I N G
// -------------
//
// This file is not part of the Qt API. It exists purely as an
// implementation detail. This header file may change from version to
// version without notice, or even be removed.
//
// We mean it.
//
#include <QtCore/qfileinfo.h>
#include <QtCore/qmutex.h>
#include <QtCore/qdatetime.h>
#include <QtCore/qdir.h>
#include <QtCore/qtimer.h>
#include <QtCore/qhash.h>
#include "qfilesystemwatcher_p.h"
QT_REQUIRE_CONFIG(filesystemwatcher);
QT_BEGIN_NAMESPACE
enum { PollingInterval = 1000 };
class QPollingFileSystemWatcherEngine : public QFileSystemWatcherEngine
{
Q_OBJECT
class FileInfo
{
uint ownerId;
uint groupId;
QFile::Permissions permissions;
QDateTime lastModified;
QStringList entries;
public:
FileInfo(const QFileInfo &fileInfo)
: ownerId(fileInfo.ownerId()),
groupId(fileInfo.groupId()),
permissions(fileInfo.permissions()),
lastModified(fileInfo.lastModified())
{
if (fileInfo.isDir()) {
entries = fileInfo.absoluteDir().entryList(QDir::AllEntries);
}
}
FileInfo &operator=(const QFileInfo &fileInfo)
{
*this = FileInfo(fileInfo);
return *this;
}
bool operator!=(const QFileInfo &fileInfo) const
{
if (fileInfo.isDir() && entries != fileInfo.absoluteDir().entryList(QDir::AllEntries))
return true;
return (ownerId != fileInfo.ownerId()
|| groupId != fileInfo.groupId()
|| permissions != fileInfo.permissions()
|| lastModified != fileInfo.lastModified());
}
};
QHash<QString, FileInfo> files, directories;
public:
QPollingFileSystemWatcherEngine(QObject *parent);
QStringList addPaths(const QStringList &paths, QStringList *files, QStringList *directories) override;
QStringList removePaths(const QStringList &paths, QStringList *files, QStringList *directories) override;
private Q_SLOTS:
void timeout();
private:
QTimer timer;
};
QT_END_NAMESPACE
#endif // QFILESYSTEMWATCHER_POLLING_P_H

View File

@@ -0,0 +1,141 @@
// 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 QFILESYSTEMWATCHER_WIN_P_H
#define QFILESYSTEMWATCHER_WIN_P_H
//
// W A R N I N G
// -------------
//
// This file is not part of the Qt API. It exists purely as an
// implementation detail. This header file may change from version to
// version without notice, or even be removed.
//
// We mean it.
//
#include "qfilesystemwatcher_p.h"
#include <QtCore/qdatetime.h>
#include <QtCore/qfile.h>
#include <QtCore/qfileinfo.h>
#include <QtCore/qhash.h>
#include <QtCore/qlist.h>
#include <QtCore/qmutex.h>
#include <QtCore/qthread.h>
QT_BEGIN_NAMESPACE
class QWindowsFileSystemWatcherEngineThread;
class QWindowsRemovableDriveListener;
// Even though QWindowsFileSystemWatcherEngine is derived of QThread
// via QFileSystemWatcher, it does not start a thread.
// Instead QWindowsFileSystemWatcher creates QWindowsFileSystemWatcherEngineThreads
// to do the actually watching.
class QWindowsFileSystemWatcherEngine : public QFileSystemWatcherEngine
{
Q_OBJECT
public:
explicit QWindowsFileSystemWatcherEngine(QObject *parent);
~QWindowsFileSystemWatcherEngine();
QStringList addPaths(const QStringList &paths, QStringList *files, QStringList *directories) override;
QStringList removePaths(const QStringList &paths, QStringList *files, QStringList *directories) override;
class Handle
{
public:
Qt::HANDLE handle;
uint flags;
Handle();
};
class PathInfo {
public:
QString absolutePath;
QString path;
bool isDir;
// fileinfo bits
uint ownerId;
uint groupId;
QFile::Permissions permissions;
QDateTime lastModified;
PathInfo &operator=(const QFileInfo &fileInfo)
{
ownerId = fileInfo.ownerId();
groupId = fileInfo.groupId();
permissions = fileInfo.permissions();
lastModified = fileInfo.lastModified();
return *this;
}
bool operator!=(const QFileInfo &fileInfo) const
{
return (ownerId != fileInfo.ownerId()
|| groupId != fileInfo.groupId()
|| permissions != fileInfo.permissions()
|| lastModified != fileInfo.lastModified());
}
};
signals:
void driveLockForRemoval(const QString &);
void driveLockForRemovalFailed(const QString &);
void driveRemoved(const QString &);
private:
QList<QWindowsFileSystemWatcherEngineThread *> threads;
QWindowsRemovableDriveListener *m_driveListener = nullptr;
};
class QFileSystemWatcherPathKey : public QString
{
public:
QFileSystemWatcherPathKey() {}
explicit QFileSystemWatcherPathKey(const QString &other) : QString(other) {}
QFileSystemWatcherPathKey(const QFileSystemWatcherPathKey &other) : QString(other) {}
bool operator==(const QFileSystemWatcherPathKey &other) const { return !compare(other, Qt::CaseInsensitive); }
};
Q_DECLARE_TYPEINFO(QFileSystemWatcherPathKey, Q_RELOCATABLE_TYPE);
inline size_t qHash(const QFileSystemWatcherPathKey &key, size_t seed = 0)
{
return qHash(key.toCaseFolded(), seed);
}
class QWindowsFileSystemWatcherEngineThread : public QThread
{
Q_OBJECT
public:
typedef QHash<QFileSystemWatcherPathKey, QWindowsFileSystemWatcherEngine::Handle> HandleForDirHash;
typedef QHash<QFileSystemWatcherPathKey, QWindowsFileSystemWatcherEngine::PathInfo> PathInfoHash;
QWindowsFileSystemWatcherEngineThread();
~QWindowsFileSystemWatcherEngineThread();
void run() override;
void stop();
void wakeup();
QMutex mutex;
QList<Qt::HANDLE> handles;
int msg;
HandleForDirHash handleForDir;
QHash<Qt::HANDLE, PathInfoHash> pathInfoForHandle;
Q_SIGNALS:
void fileChanged(const QString &path, bool removed);
void directoryChanged(const QString &path, bool removed);
};
QT_END_NAMESPACE
#endif // QFILESYSTEMWATCHER_WIN_P_H

File diff suppressed because it is too large Load Diff

View File

@@ -0,0 +1,252 @@
// 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 QFREELIST_P_H
#define QFREELIST_P_H
//
// W A R N I N G
// -------------
//
// This file is not part of the Qt API. It exists purely as an
// implementation detail. This header file may change from version to
// version without notice, or even be removed.
//
// We mean it.
//
#include <QtCore/private/qglobal_p.h>
#include <QtCore/qatomic.h>
QT_BEGIN_NAMESPACE
/*! \internal
Element in a QFreeList. ConstReferenceType and ReferenceType are used as
the return values for QFreeList::at() and QFreeList::operator[](). Contains
the real data storage (_t) and the id of the next free element (next).
Note: the t() functions should be used to access the data, not _t.
*/
template <typename T>
struct QFreeListElement
{
typedef const T &ConstReferenceType;
typedef T &ReferenceType;
T _t;
QAtomicInt next;
inline ConstReferenceType t() const { return _t; }
inline ReferenceType t() { return _t; }
};
/*! \internal
Element in a QFreeList without a payload. ConstReferenceType and
ReferenceType are void, the t() functions return void and are empty.
*/
template <>
struct QFreeListElement<void>
{
typedef void ConstReferenceType;
typedef void ReferenceType;
QAtomicInt next;
inline void t() const { }
inline void t() { }
};
/*! \internal
Defines default constants used by QFreeList:
- The initial value returned by QFreeList::next() is zero.
- QFreeList allows for up to 16777216 elements in QFreeList and uses the top
8 bits to store a serial counter for ABA protection.
- QFreeList will make a maximum of 4 allocations (blocks), with each
successive block larger than the previous.
- Sizes static int[] array to define the size of each block.
It is possible to define your own constants struct/class and give this to
QFreeList to customize/tune the behavior.
*/
struct Q_AUTOTEST_EXPORT QFreeListDefaultConstants
{
// used by QFreeList, make sure to define all of when customizing
enum {
InitialNextValue = 0,
IndexMask = 0x00ffffff,
SerialMask = ~IndexMask & ~0x80000000,
SerialCounter = IndexMask + 1,
MaxIndex = IndexMask,
BlockCount = 4
};
static const int Sizes[BlockCount];
};
/*! \internal
This is a generic implementation of a lock-free free list. Use next() to
get the next free entry in the list, and release(id) when done with the id.
This version is templated and allows having a payload of type T which can
be accessed using the id returned by next(). The payload is allocated and
deallocated automatically by the free list, but *NOT* when calling
next()/release(). Initialization should be done by code needing it after
next() returns. Likewise, cleanup() should happen before calling release().
It is possible to have use 'void' as the payload type, in which case the
free list only contains indexes to the next free entry.
The ConstantsType type defaults to QFreeListDefaultConstants above. You can
define your custom ConstantsType, see above for details on what needs to be
available.
*/
template <typename T, typename ConstantsType = QFreeListDefaultConstants>
class QFreeList
{
typedef T ValueType;
typedef QFreeListElement<T> ElementType;
typedef typename ElementType::ConstReferenceType ConstReferenceType;
typedef typename ElementType::ReferenceType ReferenceType;
// return which block the index \a x falls in, and modify \a x to be the index into that block
static inline int blockfor(int &x)
{
for (int i = 0; i < ConstantsType::BlockCount; ++i) {
int size = ConstantsType::Sizes[i];
if (x < size)
return i;
x -= size;
}
Q_UNREACHABLE_RETURN(-1);
}
// allocate a block of the given \a size, initialized starting with the given \a offset
static inline ElementType *allocate(int offset, int size)
{
// qDebug("QFreeList: allocating %d elements (%ld bytes) with offset %d", size, size * sizeof(ElementType), offset);
ElementType *v = new ElementType[size];
for (int i = 0; i < size; ++i)
v[i].next.storeRelaxed(offset + i + 1);
return v;
}
// take the current serial number from \a o, increment it, and store it in \a n
static inline int incrementserial(int o, int n)
{
return int((uint(n) & ConstantsType::IndexMask) | ((uint(o) + ConstantsType::SerialCounter) & ConstantsType::SerialMask));
}
// the blocks
QAtomicPointer<ElementType> _v[ConstantsType::BlockCount];
// the next free id
QAtomicInt _next;
// QFreeList is not copyable
Q_DISABLE_COPY_MOVE(QFreeList)
public:
constexpr inline QFreeList();
inline ~QFreeList();
// returns the payload for the given index \a x
inline ConstReferenceType at(int x) const;
inline ReferenceType operator[](int x);
/*
Return the next free id. Use this id to access the payload (see above).
Call release(id) when done using the id.
*/
inline int next();
inline void release(int id);
};
template <typename T, typename ConstantsType>
constexpr inline QFreeList<T, ConstantsType>::QFreeList()
:
_v{}, // uniform initialization required
_next(ConstantsType::InitialNextValue)
{ }
template <typename T, typename ConstantsType>
inline QFreeList<T, ConstantsType>::~QFreeList()
{
for (int i = 0; i < ConstantsType::BlockCount; ++i)
delete [] _v[i].loadAcquire();
}
template <typename T, typename ConstantsType>
inline typename QFreeList<T, ConstantsType>::ConstReferenceType QFreeList<T, ConstantsType>::at(int x) const
{
const int block = blockfor(x);
return (_v[block].loadRelaxed())[x].t();
}
template <typename T, typename ConstantsType>
inline typename QFreeList<T, ConstantsType>::ReferenceType QFreeList<T, ConstantsType>::operator[](int x)
{
const int block = blockfor(x);
return (_v[block].loadRelaxed())[x].t();
}
template <typename T, typename ConstantsType>
inline int QFreeList<T, ConstantsType>::next()
{
int id, newid, at;
ElementType *v;
do {
id = _next.loadAcquire();
at = id & ConstantsType::IndexMask;
const int block = blockfor(at);
v = _v[block].loadAcquire();
if (!v) {
v = allocate((id & ConstantsType::IndexMask) - at, ConstantsType::Sizes[block]);
if (!_v[block].testAndSetRelease(nullptr, v)) {
// race with another thread lost
delete[] v;
v = _v[block].loadAcquire();
Q_ASSERT(v != nullptr);
}
}
newid = v[at].next.loadRelaxed() | (id & ~ConstantsType::IndexMask);
} while (!_next.testAndSetRelease(id, newid));
// qDebug("QFreeList::next(): returning %d (_next now %d, serial %d)",
// id & ConstantsType::IndexMask,
// newid & ConstantsType::IndexMask,
// (newid & ~ConstantsType::IndexMask) >> 24);
return id & ConstantsType::IndexMask;
}
template <typename T, typename ConstantsType>
inline void QFreeList<T, ConstantsType>::release(int id)
{
int at = id & ConstantsType::IndexMask;
const int block = blockfor(at);
ElementType *v = _v[block].loadRelaxed();
int x, newid;
do {
x = _next.loadAcquire();
v[at].next.storeRelaxed(x & ConstantsType::IndexMask);
newid = incrementserial(x, id);
} while (!_next.testAndSetRelease(x, newid));
// qDebug("QFreeList::release(%d): _next now %d (was %d), serial %d",
// id & ConstantsType::IndexMask,
// newid & ConstantsType::IndexMask,
// x & ConstantsType::IndexMask,
// (newid & ~ConstantsType::IndexMask) >> 24);
}
QT_END_NAMESPACE
#endif // QFREELIST_P_H

View File

@@ -0,0 +1,53 @@
// 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 QFSFILEENGINE_ITERATOR_P_H
#define QFSFILEENGINE_ITERATOR_P_H
//
// W A R N I N G
// -------------
//
// This file is not part of the Qt API. It exists purely as an
// implementation detail. This header file may change from version to
// version without notice, or even be removed.
//
// We mean it.
//
#include "private/qabstractfileengine_p.h"
#include "qfilesystemiterator_p.h"
#include "qdir.h"
#ifndef QT_NO_FILESYSTEMITERATOR
QT_BEGIN_NAMESPACE
class QFSFileEngineIteratorPrivate;
class QFSFileEngineIteratorPlatformSpecificData;
class QFSFileEngineIterator : public QAbstractFileEngineIterator
{
public:
QFSFileEngineIterator(QDir::Filters filters, const QStringList &filterNames);
~QFSFileEngineIterator();
QString next() override;
bool hasNext() const override;
QString currentFileName() const override;
QFileInfo currentFileInfo() const override;
private:
void advance() const;
mutable QScopedPointer<QFileSystemIterator> nativeIterator;
mutable QFileInfo currentInfo;
mutable QFileInfo nextInfo;
mutable bool done;
};
QT_END_NAMESPACE
#endif // QT_NO_FILESYSTEMITERATOR
#endif // QFSFILEENGINE_ITERATOR_P_H

View File

@@ -0,0 +1,227 @@
// 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 QFSFILEENGINE_P_H
#define QFSFILEENGINE_P_H
//
// W A R N I N G
// -------------
//
// This file is not part of the Qt API. It exists purely as an
// implementation detail. This header file may change from version to
// version without notice, or even be removed.
//
// We mean it.
//
#include "qplatformdefs.h"
#include "QtCore/private/qabstractfileengine_p.h"
#include <QtCore/private/qfilesystementry_p.h>
#include <QtCore/private/qfilesystemmetadata_p.h>
#include <qhash.h>
#include <optional>
#ifdef Q_OS_UNIX
#include <sys/types.h> // for mode_t
#endif
#ifndef QT_NO_FSFILEENGINE
QT_BEGIN_NAMESPACE
struct ProcessOpenModeResult
{
bool ok;
QIODevice::OpenMode openMode;
QString error;
};
Q_CORE_EXPORT ProcessOpenModeResult processOpenModeFlags(QIODevice::OpenMode mode);
class QFSFileEnginePrivate;
class Q_CORE_EXPORT QFSFileEngine : public QAbstractFileEngine
{
Q_DECLARE_PRIVATE(QFSFileEngine)
public:
QFSFileEngine();
explicit QFSFileEngine(const QString &file);
~QFSFileEngine();
bool open(QIODevice::OpenMode openMode, std::optional<QFile::Permissions> permissions) override;
bool open(QIODevice::OpenMode flags, FILE *fh);
bool close() override;
bool flush() override;
bool syncToDisk() override;
qint64 size() const override;
qint64 pos() const override;
bool seek(qint64) override;
bool isSequential() const override;
bool remove() override;
bool copy(const QString &newName) override;
bool rename(const QString &newName) override;
bool renameOverwrite(const QString &newName) override;
bool link(const QString &newName) override;
bool mkdir(const QString &dirName, bool createParentDirectories,
std::optional<QFile::Permissions> permissions) const override;
bool rmdir(const QString &dirName, bool recurseParentDirectories) const override;
bool setSize(qint64 size) override;
bool caseSensitive() const override;
bool isRelativePath() const override;
QStringList entryList(QDir::Filters filters, const QStringList &filterNames) const override;
FileFlags fileFlags(FileFlags type) const override;
bool setPermissions(uint perms) override;
QByteArray id() const override;
QString fileName(FileName file) const override;
uint ownerId(FileOwner) const override;
QString owner(FileOwner) const override;
bool setFileTime(const QDateTime &newDate, FileTime time) override;
QDateTime fileTime(FileTime time) const override;
void setFileName(const QString &file) override;
int handle() const override;
#ifndef QT_NO_FILESYSTEMITERATOR
Iterator *beginEntryList(QDir::Filters filters, const QStringList &filterNames) override;
Iterator *endEntryList() override;
#endif
qint64 read(char *data, qint64 maxlen) override;
qint64 readLine(char *data, qint64 maxlen) override;
qint64 write(const char *data, qint64 len) override;
bool cloneTo(QAbstractFileEngine *target) override;
virtual bool isUnnamedFile() const
{ return false; }
bool extension(Extension extension, const ExtensionOption *option = nullptr, ExtensionReturn *output = nullptr) override;
bool supportsExtension(Extension extension) const override;
//FS only!!
bool open(QIODevice::OpenMode flags, int fd);
bool open(QIODevice::OpenMode flags, int fd, QFile::FileHandleFlags handleFlags);
bool open(QIODevice::OpenMode flags, FILE *fh, QFile::FileHandleFlags handleFlags);
static bool setCurrentPath(const QString &path);
static QString currentPath(const QString &path = QString());
static QString homePath();
static QString rootPath();
static QString tempPath();
static QFileInfoList drives();
protected:
QFSFileEngine(QFSFileEnginePrivate &dd);
};
class Q_AUTOTEST_EXPORT QFSFileEnginePrivate : public QAbstractFileEnginePrivate
{
Q_DECLARE_PUBLIC(QFSFileEngine)
public:
#ifdef Q_OS_WIN
static QString longFileName(const QString &path);
#endif
QFileSystemEntry fileEntry;
QIODevice::OpenMode openMode;
bool nativeOpen(QIODevice::OpenMode openMode, std::optional<QFile::Permissions> permissions);
bool openFh(QIODevice::OpenMode flags, FILE *fh);
bool openFd(QIODevice::OpenMode flags, int fd);
bool nativeClose();
bool closeFdFh();
bool nativeFlush();
bool nativeSyncToDisk();
bool flushFh();
qint64 nativeSize() const;
#ifndef Q_OS_WIN
qint64 sizeFdFh() const;
#endif
qint64 nativePos() const;
qint64 posFdFh() const;
bool nativeSeek(qint64);
bool seekFdFh(qint64);
qint64 nativeRead(char *data, qint64 maxlen);
qint64 readFdFh(char *data, qint64 maxlen);
qint64 nativeReadLine(char *data, qint64 maxlen);
qint64 readLineFdFh(char *data, qint64 maxlen);
qint64 nativeWrite(const char *data, qint64 len);
qint64 writeFdFh(const char *data, qint64 len);
int nativeHandle() const;
bool nativeIsSequential() const;
#ifndef Q_OS_WIN
bool isSequentialFdFh() const;
#endif
uchar *map(qint64 offset, qint64 size, QFile::MemoryMapFlags flags);
bool unmap(uchar *ptr);
void unmapAll();
mutable QFileSystemMetaData metaData;
FILE *fh;
#ifdef Q_OS_WIN
HANDLE fileHandle;
HANDLE mapHandle;
QHash<uchar *, DWORD /* offset % AllocationGranularity */> maps;
mutable int cachedFd;
mutable DWORD fileAttrib;
#else
struct StartAndLength {
int start; // offset % PageSize
size_t length; // length + offset % PageSize
};
QHash<uchar *, StartAndLength> maps;
#endif
int fd;
enum LastIOCommand
{
IOFlushCommand,
IOReadCommand,
IOWriteCommand
};
LastIOCommand lastIOCommand;
bool lastFlushFailed;
bool closeFileHandle;
mutable uint is_sequential : 2;
mutable uint tried_stat : 1;
mutable uint need_lstat : 1;
mutable uint is_link : 1;
#if defined(Q_OS_WIN)
bool doStat(QFileSystemMetaData::MetaDataFlags flags) const;
#else
bool doStat(QFileSystemMetaData::MetaDataFlags flags = QFileSystemMetaData::PosixStatFlags) const;
#endif
bool isSymlink() const;
#if defined(Q_OS_WIN32)
int sysOpen(const QString &, int flags);
#endif
static bool openModeCanCreate(QIODevice::OpenMode openMode)
{
// WriteOnly can create, but only when ExistingOnly isn't specified.
// ReadOnly by itself never creates.
return (openMode & QFile::WriteOnly) && !(openMode & QFile::ExistingOnly);
}
protected:
QFSFileEnginePrivate();
void init();
QAbstractFileEngine::FileFlags getPermissions(QAbstractFileEngine::FileFlags type) const;
#ifdef Q_OS_UNIX
bool nativeOpenImpl(QIODevice::OpenMode openMode, mode_t mode);
#endif
};
QT_END_NAMESPACE
#endif // QT_NO_FSFILEENGINE
#endif // QFSFILEENGINE_P_H

View File

@@ -0,0 +1,25 @@
// 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
//
// W A R N I N G
// -------------
//
// This file is not part of the Qt API. It exists for the convenience
// of qfunctions_*. This header file may change from version to version
// without notice, or even be removed.
//
// We mean it.
//
#ifndef QFUNCTIONS_P_H
#define QFUNCTIONS_P_H
#include <QtCore/private/qglobal_p.h>
#if defined(Q_OS_VXWORKS)
# include "QtCore/qfunctions_vxworks.h"
#endif
#endif

View File

@@ -0,0 +1,50 @@
// Copyright (C) 2022 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 QFUNCTIONS_WIN_P_H
#define QFUNCTIONS_WIN_P_H
//
// W A R N I N G
// -------------
//
// This file is not part of the Qt API. It exists purely as an
// implementation detail. This header file may change from version to
// version without notice, or even be removed.
//
// We mean it.
//
#include <QtCore/private/qglobal_p.h>
#if defined(Q_OS_WIN) || defined(Q_QDOC)
#if !defined(QT_BOOTSTRAPPED)
#include <QtCore/private/qfunctions_winrt_p.h>
#endif
#include <QtCore/qt_windows.h>
QT_BEGIN_NAMESPACE
class Q_CORE_EXPORT QComHelper
{
Q_DISABLE_COPY_MOVE(QComHelper)
public:
QComHelper(COINIT concurrencyModel = COINIT_APARTMENTTHREADED);
~QComHelper();
bool isValid() const { return SUCCEEDED(m_initResult); }
explicit operator bool() const { return isValid(); }
private:
HRESULT m_initResult = E_FAIL;
};
Q_CORE_EXPORT bool qt_win_hasPackageIdentity();
QT_END_NAMESPACE
#endif // Q_OS_WIN
#endif // QFUNCTIONS_WIN_P_H

View File

@@ -0,0 +1,159 @@
// Copyright (C) 2020 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 QFUNCTIONS_WINRT_P_H
#define QFUNCTIONS_WINRT_P_H
//
// W A R N I N G
// -------------
//
// This file is not part of the Qt API. It exists purely as an
// implementation detail. This header file may change from version to
// version without notice, or even be removed.
//
// We mean it.
//
#include <QtCore/private/qglobal_p.h>
#if defined(Q_OS_WIN) && defined(Q_CC_MSVC)
#include <QtCore/QCoreApplication>
#include <QtCore/QThread>
#include <QtCore/QAbstractEventDispatcher>
#include <QtCore/QElapsedTimer>
#include <QtCore/qt_windows.h>
#include <wrl.h>
#include <windows.foundation.h>
// Convenience macros for handling HRESULT values
#define RETURN_IF_FAILED(msg, ret) \
if (FAILED(hr)) { \
qErrnoWarning(hr, msg); \
ret; \
}
#define RETURN_IF_FAILED_WITH_ARGS(msg, ret, ...) \
if (FAILED(hr)) { \
qErrnoWarning(hr, msg, __VA_ARGS__); \
ret; \
}
#define RETURN_HR_IF_FAILED(msg) RETURN_IF_FAILED(msg, return hr)
#define RETURN_OK_IF_FAILED(msg) RETURN_IF_FAILED(msg, return S_OK)
#define RETURN_FALSE_IF_FAILED(msg) RETURN_IF_FAILED(msg, return false)
#define RETURN_VOID_IF_FAILED(msg) RETURN_IF_FAILED(msg, return)
#define RETURN_HR_IF_FAILED_WITH_ARGS(msg, ...) RETURN_IF_FAILED_WITH_ARGS(msg, return hr, __VA_ARGS__)
#define RETURN_OK_IF_FAILED_WITH_ARGS(msg, ...) RETURN_IF_FAILED_WITH_ARGS(msg, return S_OK, __VA_ARGS__)
#define RETURN_FALSE_IF_FAILED_WITH_ARGS(msg, ...) RETURN_IF_FAILED_WITH_ARGS(msg, return false, __VA_ARGS__)
#define RETURN_VOID_IF_FAILED_WITH_ARGS(msg, ...) RETURN_IF_FAILED_WITH_ARGS(msg, return, __VA_ARGS__)
#define Q_ASSERT_SUCCEEDED(hr) \
Q_ASSERT_X(SUCCEEDED(hr), Q_FUNC_INFO, qPrintable(qt_error_string(hr)));
QT_BEGIN_NAMESPACE
namespace QWinRTFunctions {
// Synchronization methods
enum AwaitStyle
{
YieldThread = 0,
ProcessThreadEvents = 1,
ProcessMainThreadEvents = 2
};
using EarlyExitConditionFunction = std::function<bool(void)>;
template<typename T>
static inline HRESULT _await_impl(const Microsoft::WRL::ComPtr<T> &asyncOp, AwaitStyle awaitStyle,
uint timeout, EarlyExitConditionFunction func)
{
Microsoft::WRL::ComPtr<ABI::Windows::Foundation::IAsyncInfo> asyncInfo;
HRESULT hr = asyncOp.As(&asyncInfo);
if (FAILED(hr))
return hr;
AsyncStatus status;
QElapsedTimer t;
if (timeout)
t.start();
switch (awaitStyle) {
case ProcessMainThreadEvents:
while (SUCCEEDED(hr = asyncInfo->get_Status(&status)) && status == AsyncStatus::Started) {
QCoreApplication::processEvents();
if (func && func())
return E_ABORT;
if (timeout && t.hasExpired(timeout))
return HRESULT_FROM_WIN32(ERROR_TIMEOUT);
}
break;
case ProcessThreadEvents:
if (QAbstractEventDispatcher *dispatcher = QThread::currentThread()->eventDispatcher()) {
while (SUCCEEDED(hr = asyncInfo->get_Status(&status)) && status == AsyncStatus::Started) {
dispatcher->processEvents(QEventLoop::AllEvents);
if (func && func())
return E_ABORT;
if (timeout && t.hasExpired(timeout))
return HRESULT_FROM_WIN32(ERROR_TIMEOUT);
}
break;
}
// fall through
default:
case YieldThread:
while (SUCCEEDED(hr = asyncInfo->get_Status(&status)) && status == AsyncStatus::Started) {
QThread::yieldCurrentThread();
if (timeout && t.hasExpired(timeout))
return HRESULT_FROM_WIN32(ERROR_TIMEOUT);
}
break;
}
if (FAILED(hr) || status != AsyncStatus::Completed) {
HRESULT ec;
hr = asyncInfo->get_ErrorCode(&ec);
if (FAILED(hr))
return hr;
hr = asyncInfo->Close();
if (FAILED(hr))
return hr;
return ec;
}
return hr;
}
template<typename T>
static inline HRESULT await(const Microsoft::WRL::ComPtr<T> &asyncOp,
AwaitStyle awaitStyle = YieldThread, uint timeout = 0,
EarlyExitConditionFunction func = nullptr)
{
HRESULT hr = _await_impl(asyncOp, awaitStyle, timeout, func);
if (FAILED(hr))
return hr;
return asyncOp->GetResults();
}
template<typename T, typename U>
static inline HRESULT await(const Microsoft::WRL::ComPtr<T> &asyncOp, U *results,
AwaitStyle awaitStyle = YieldThread, uint timeout = 0,
EarlyExitConditionFunction func = nullptr)
{
HRESULT hr = _await_impl(asyncOp, awaitStyle, timeout, func);
if (FAILED(hr))
return hr;
return asyncOp->GetResults(results);
}
} // QWinRTFunctions
QT_END_NAMESPACE
#endif // Q_OS_WIN && Q_CC_MSVC
#endif // QFUNCTIONS_WINRT_P_H

View File

@@ -0,0 +1,150 @@
// Copyright (C) 2017 Intel Corporation.
// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only
#ifndef QFUTEX_P_H
#define QFUTEX_P_H
//
// W A R N I N G
// -------------
//
// This file is not part of the Qt API. It exists purely as an
// implementation detail. This header file may change from version to
// version without notice, or even be removed.
//
// We mean it.
//
#include <private/qglobal_p.h>
#include <QtCore/qtsan_impl.h>
QT_BEGIN_NAMESPACE
namespace QtDummyFutex {
constexpr inline bool futexAvailable() { return false; }
template <typename Atomic>
inline bool futexWait(Atomic &, typename Atomic::Type, int = 0)
{ Q_UNREACHABLE_RETURN(false); }
template <typename Atomic> inline void futexWakeOne(Atomic &)
{ Q_UNREACHABLE(); }
template <typename Atomic> inline void futexWakeAll(Atomic &)
{ Q_UNREACHABLE(); }
}
QT_END_NAMESPACE
#if defined(Q_OS_LINUX) && !defined(QT_LINUXBASE)
// use Linux mutexes everywhere except for LSB builds
# include <sys/syscall.h>
# include <errno.h>
# include <limits.h>
# include <unistd.h>
# include <asm/unistd.h>
# include <linux/futex.h>
# define QT_ALWAYS_USE_FUTEX
// if not defined in linux/futex.h
# define FUTEX_PRIVATE_FLAG 128 // added in v2.6.22
// RISC-V does not supply __NR_futex
# ifndef __NR_futex
# define __NR_futex __NR_futex_time64
# endif
QT_BEGIN_NAMESPACE
namespace QtLinuxFutex {
constexpr inline bool futexAvailable() { return true; }
inline int _q_futex(int *addr, int op, int val, quintptr val2 = 0,
int *addr2 = nullptr, int val3 = 0) noexcept
{
QtTsan::futexRelease(addr, addr2);
// we use __NR_futex because some libcs (like Android's bionic) don't
// provide SYS_futex etc.
int result = syscall(__NR_futex, addr, op | FUTEX_PRIVATE_FLAG, val, val2, addr2, val3);
QtTsan::futexAcquire(addr, addr2);
return result;
}
template <typename T> int *addr(T *ptr)
{
int *int_addr = reinterpret_cast<int *>(ptr);
#if Q_BYTE_ORDER == Q_BIG_ENDIAN
if (sizeof(T) > sizeof(int))
int_addr++; //We want a pointer to the least significant half
#endif
return int_addr;
}
template <typename Atomic>
inline void futexWait(Atomic &futex, typename Atomic::Type expectedValue)
{
_q_futex(addr(&futex), FUTEX_WAIT, qintptr(expectedValue));
}
template <typename Atomic>
inline bool futexWait(Atomic &futex, typename Atomic::Type expectedValue, qint64 nstimeout)
{
struct timespec ts;
ts.tv_sec = nstimeout / 1000 / 1000 / 1000;
ts.tv_nsec = nstimeout % (1000 * 1000 * 1000);
int r = _q_futex(addr(&futex), FUTEX_WAIT, qintptr(expectedValue), quintptr(&ts));
return r == 0 || errno != ETIMEDOUT;
}
template <typename Atomic> inline void futexWakeOne(Atomic &futex)
{
_q_futex(addr(&futex), FUTEX_WAKE, 1);
}
template <typename Atomic> inline void futexWakeAll(Atomic &futex)
{
_q_futex(addr(&futex), FUTEX_WAKE, INT_MAX);
}
template <typename Atomic> inline
void futexWakeOp(Atomic &futex1, int wake1, int wake2, Atomic &futex2, quint32 op)
{
_q_futex(addr(&futex1), FUTEX_WAKE_OP, wake1, wake2, addr(&futex2), op);
}
}
namespace QtFutex = QtLinuxFutex;
QT_END_NAMESPACE
#elif defined(Q_OS_WIN)
# include <qt_windows.h>
QT_BEGIN_NAMESPACE
namespace QtWindowsFutex {
#define QT_ALWAYS_USE_FUTEX
constexpr inline bool futexAvailable() { return true; }
template <typename Atomic>
inline void futexWait(Atomic &futex, typename Atomic::Type expectedValue)
{
QtTsan::futexRelease(&futex);
WaitOnAddress(&futex, &expectedValue, sizeof(expectedValue), INFINITE);
QtTsan::futexAcquire(&futex);
}
template <typename Atomic>
inline bool futexWait(Atomic &futex, typename Atomic::Type expectedValue, qint64 nstimeout)
{
BOOL r = WaitOnAddress(&futex, &expectedValue, sizeof(expectedValue), DWORD(nstimeout / 1000 / 1000));
return r || GetLastError() != ERROR_TIMEOUT;
}
template <typename Atomic> inline void futexWakeAll(Atomic &futex)
{
WakeByAddressAll(&futex);
}
template <typename Atomic> inline void futexWakeOne(Atomic &futex)
{
WakeByAddressSingle(&futex);
}
}
namespace QtFutex = QtWindowsFutex;
QT_END_NAMESPACE
#else
QT_BEGIN_NAMESPACE
namespace QtFutex = QtDummyFutex;
QT_END_NAMESPACE
#endif
#endif // QFUTEX_P_H

View File

@@ -0,0 +1,187 @@
// 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 QFUTUREINTERFACE_P_H
#define QFUTUREINTERFACE_P_H
//
// W A R N I N G
// -------------
//
// This file is not part of the Qt API. It exists purely as an
// implementation detail. This header file may change from version to
// version without notice, or even be removed.
//
// We mean it.
//
#include <QtCore/private/qglobal_p.h>
#include <QtCore/qelapsedtimer.h>
#include <QtCore/qcoreevent.h>
#include <QtCore/qlist.h>
#include <QtCore/qwaitcondition.h>
#include <QtCore/qrunnable.h>
#include <QtCore/qthreadpool.h>
#include <QtCore/qfutureinterface.h>
#include <QtCore/qexception.h>
QT_REQUIRE_CONFIG(future);
QT_BEGIN_NAMESPACE
// Although QFutureCallOutEvent and QFutureCallOutInterface are private,
// for historical reasons they were used externally (in QtJambi, see
// https://github.com/OmixVisualization/qtjambi), so we export them to
// not break the pre-existing code.
class Q_CORE_EXPORT QFutureCallOutEvent : public QEvent
{
Q_DECL_EVENT_COMMON(QFutureCallOutEvent)
public:
enum CallOutType {
Started,
Finished,
Canceled,
Suspending,
Suspended,
Resumed,
Progress,
ProgressRange,
ResultsReady
};
QFutureCallOutEvent()
: QEvent(QEvent::FutureCallOut), callOutType(CallOutType(0)), index1(-1), index2(-1)
{ }
explicit QFutureCallOutEvent(CallOutType callOutType, int index1 = -1)
: QEvent(QEvent::FutureCallOut), callOutType(callOutType), index1(index1), index2(-1)
{ }
QFutureCallOutEvent(CallOutType callOutType, int index1, int index2)
: QEvent(QEvent::FutureCallOut), callOutType(callOutType), index1(index1), index2(index2)
{ }
QFutureCallOutEvent(CallOutType callOutType, int index1, const QString &text)
: QEvent(QEvent::FutureCallOut),
callOutType(callOutType),
index1(index1),
index2(-1),
text(text)
{ }
CallOutType callOutType;
int index1;
int index2;
QString text;
};
class Q_CORE_EXPORT QFutureCallOutInterface
{
public:
virtual ~QFutureCallOutInterface();
virtual void postCallOutEvent(const QFutureCallOutEvent &) = 0;
virtual void callOutInterfaceDisconnected() = 0;
};
class QFutureInterfaceBasePrivate
{
public:
QFutureInterfaceBasePrivate(QFutureInterfaceBase::State initialState);
~QFutureInterfaceBasePrivate();
// When the last QFuture<T> reference is removed, we need to make
// sure that data stored in the ResultStore is cleaned out.
// Since QFutureInterfaceBasePrivate can be shared between QFuture<T>
// and QFuture<void> objects, we use a separate ref. counter
// to keep track of QFuture<T> objects.
class RefCount
{
public:
inline RefCount(int r = 0, int rt = 0)
: m_refCount(r), m_refCountT(rt) {}
// Default ref counter for QFIBP
inline bool ref() { return m_refCount.ref(); }
inline bool deref() { return m_refCount.deref(); }
inline int load() const { return m_refCount.loadRelaxed(); }
// Ref counter for type T
inline bool refT() { return m_refCountT.ref(); }
inline bool derefT() { return m_refCountT.deref(); }
inline int loadT() const { return m_refCountT.loadRelaxed(); }
private:
QAtomicInt m_refCount;
QAtomicInt m_refCountT;
};
// T: accessed from executing thread
// Q: accessed from the waiting/querying thread
mutable QMutex m_mutex;
QBasicMutex continuationMutex;
QList<QFutureCallOutInterface *> outputConnections;
QElapsedTimer progressTime;
QWaitCondition waitCondition;
QWaitCondition pausedWaitCondition;
union Data {
QtPrivate::ResultStoreBase m_results;
QtPrivate::ExceptionStore m_exceptionStore;
#ifndef QT_NO_EXCEPTIONS
void setException(const std::exception_ptr &e)
{
m_results.~ResultStoreBase();
new (&m_exceptionStore) QtPrivate::ExceptionStore();
m_exceptionStore.setException(e);
}
#endif
~Data() { }
};
Data data = { QtPrivate::ResultStoreBase() };
QRunnable *runnable = nullptr;
QThreadPool *m_pool = nullptr;
// Wrapper for continuation
std::function<void(const QFutureInterfaceBase &)> continuation;
QFutureInterfaceBasePrivate *continuationData = nullptr;
RefCount refCount = 1;
QAtomicInt state; // reads and writes can happen unprotected, both must be atomic
int m_progressValue = 0; // TQ
struct ProgressData
{
int minimum = 0; // TQ
int maximum = 0; // TQ
QString text;
};
QScopedPointer<ProgressData> m_progress;
int m_expectedResultCount = 0;
bool launchAsync = false;
bool isValid = false;
bool hasException = false;
enum ContinuationState : quint8 { Default, Canceled, Cleaned };
std::atomic<ContinuationState> continuationState { Default };
inline QThreadPool *pool() const
{ return m_pool ? m_pool : QThreadPool::globalInstance(); }
// Internal functions that does not change the mutex state.
// The mutex must be locked when calling these.
int internal_resultCount() const;
bool internal_isResultReadyAt(int index) const;
bool internal_waitForNextResult();
bool internal_updateProgressValue(int progress);
bool internal_updateProgress(int progress, const QString &progressText = QString());
void internal_setThrottled(bool enable);
void sendCallOut(const QFutureCallOutEvent &callOut);
void sendCallOuts(const QFutureCallOutEvent &callOut1, const QFutureCallOutEvent &callOut2);
void connectOutputInterface(QFutureCallOutInterface *iface);
void disconnectOutputInterface(QFutureCallOutInterface *iface);
void setState(QFutureInterfaceBase::State state);
};
QT_END_NAMESPACE
#endif

View File

@@ -0,0 +1,49 @@
// 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 QFUTUREWATCHER_P_H
#define QFUTUREWATCHER_P_H
//
// W A R N I N G
// -------------
//
// This file is not part of the Qt API. It exists purely as an
// implementation detail. This header file may change from version to
// version without notice, or even be removed.
//
// We mean it.
//
#include "qfutureinterface_p.h"
#include <qlist.h>
#include <private/qobject_p.h>
QT_REQUIRE_CONFIG(future);
QT_BEGIN_NAMESPACE
class QFutureWatcherBase;
class QFutureWatcherBasePrivate : public QObjectPrivate,
public QFutureCallOutInterface
{
Q_DECLARE_PUBLIC(QFutureWatcherBase)
public:
QFutureWatcherBasePrivate();
void postCallOutEvent(const QFutureCallOutEvent &callOutEvent) override;
void callOutInterfaceDisconnected() override;
void sendCallOutEvent(QFutureCallOutEvent *event);
QAtomicInt pendingResultsReady;
int maximumPendingResultsReady;
QAtomicInt resultAtConnected;
};
QT_END_NAMESPACE
#endif

View File

@@ -0,0 +1,145 @@
// Copyright (C) 2017 The Qt Company Ltd.
// Copyright (C) 2015 Intel Corporation.
// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only
#ifndef QGLOBAL_P_H
#define QGLOBAL_P_H
//
// W A R N I N G
// -------------
//
// This file is not part of the Qt API. It exists purely as an
// implementation detail. This header file may change from version to
// version without notice, or even be removed.
//
// We mean it.
//
#include "qglobal.h"
#include "qglobal_p.h" // include self to avoid syncqt warning - no-op
#ifndef QT_BOOTSTRAPPED
#include <QtCore/private/qconfig_p.h>
#include <QtCore/private/qtcore-config_p.h>
#endif
#if defined(Q_CC_MSVC)
// By default, dynamic initialization uses subsection "$XCU", which is
// equivalent to #pragma init_seg(user). Additionally, #pragma
// init_seg(compiler) and init_seg(lib) use "$XCC" and "$XCL" respectively. So
// place us between "compiler" and "lib".
# define QT_SUPPORTS_INIT_PRIORITY 1
// warning C4075: initializers put in unrecognized initialization area
# define Q_DECL_INIT_PRIORITY(nn) \
__pragma(warning(disable: 4075)) \
__pragma(init_seg(".CRT$XCK" QT_STRINGIFY(nn))) Q_DECL_UNUSED
#elif defined(Q_OS_QNX)
// init_priority fails on QNX and we didn't bother investigating why
# define QT_SUPPORTS_INIT_PRIORITY 0
#elif defined(Q_OS_WIN) || defined(Q_OF_ELF)
# define QT_SUPPORTS_INIT_PRIORITY 1
// priorities 0 to 1000 are reserved to the runtime;
// we use above 2000 in case someone REALLY needs to go before us
# define Q_DECL_INIT_PRIORITY(nn) __attribute__((init_priority(2000 + nn), used))
#elif defined(QT_SHARED)
// it doesn't support this exactly, but we can work around it
# define QT_SUPPORTS_INIT_PRIORITY -1
# define Q_DECL_INIT_PRIORITY(nn) Q_DECL_UNUSED
#else
# define QT_SUPPORTS_INIT_PRIORITY 0
#endif
#if defined(__cplusplus)
#ifdef Q_CC_MINGW
# include <unistd.h> // Define _POSIX_THREAD_SAFE_FUNCTIONS to obtain localtime_r()
#endif
#include <time.h>
QT_BEGIN_NAMESPACE
// These behave as if they consult the environment, so need to share its locking:
Q_CORE_EXPORT void qTzSet();
Q_CORE_EXPORT time_t qMkTime(struct tm *when);
#if !defined(Q_CC_MSVC)
Q_NORETURN
#endif
Q_CORE_EXPORT void qAbort();
QT_END_NAMESPACE
#if !__has_builtin(__builtin_available)
#include <initializer_list>
#include <QtCore/qoperatingsystemversion.h>
#include <QtCore/qversionnumber.h>
QT_BEGIN_NAMESPACE
struct qt_clang_builtin_available_os_version_data {
QOperatingSystemVersion::OSType type;
const char *version;
};
static inline bool qt_clang_builtin_available(
const std::initializer_list<qt_clang_builtin_available_os_version_data> &versions)
{
for (auto it = versions.begin(); it != versions.end(); ++it) {
if (QOperatingSystemVersion::currentType() == it->type) {
const auto current = QOperatingSystemVersion::current();
return QVersionNumber(
current.majorVersion(),
current.minorVersion(),
current.microVersion()) >= QVersionNumber::fromString(
QString::fromLatin1(it->version));
}
}
// Result is true if the platform is not any of the checked ones; this matches behavior of
// LLVM __builtin_available and @available constructs
return true;
}
QT_END_NAMESPACE
#define QT_AVAILABLE_OS_VER(os, ver) \
QT_PREPEND_NAMESPACE(qt_clang_builtin_available_os_version_data){\
QT_PREPEND_NAMESPACE(QOperatingSystemVersion)::os, #ver}
#define QT_AVAILABLE_CAT(L, R) QT_AVAILABLE_CAT_(L, R)
#define QT_AVAILABLE_CAT_(L, R) L ## R
#define QT_AVAILABLE_EXPAND(...) QT_AVAILABLE_OS_VER(__VA_ARGS__)
#define QT_AVAILABLE_SPLIT(os_ver) QT_AVAILABLE_EXPAND(QT_AVAILABLE_CAT(QT_AVAILABLE_SPLIT_, os_ver))
#define QT_AVAILABLE_SPLIT_macOS MacOS,
#define QT_AVAILABLE_SPLIT_iOS IOS,
#define QT_AVAILABLE_SPLIT_tvOS TvOS,
#define QT_AVAILABLE_SPLIT_watchOS WatchOS,
#define QT_BUILTIN_AVAILABLE0(e) \
QT_PREPEND_NAMESPACE(qt_clang_builtin_available)({})
#define QT_BUILTIN_AVAILABLE1(a, e) \
QT_PREPEND_NAMESPACE(qt_clang_builtin_available)({QT_AVAILABLE_SPLIT(a)})
#define QT_BUILTIN_AVAILABLE2(a, b, e) \
QT_PREPEND_NAMESPACE(qt_clang_builtin_available)({QT_AVAILABLE_SPLIT(a), \
QT_AVAILABLE_SPLIT(b)})
#define QT_BUILTIN_AVAILABLE3(a, b, c, e) \
QT_PREPEND_NAMESPACE(qt_clang_builtin_available)({QT_AVAILABLE_SPLIT(a), \
QT_AVAILABLE_SPLIT(b), \
QT_AVAILABLE_SPLIT(c)})
#define QT_BUILTIN_AVAILABLE4(a, b, c, d, e) \
QT_PREPEND_NAMESPACE(qt_clang_builtin_available)({QT_AVAILABLE_SPLIT(a), \
QT_AVAILABLE_SPLIT(b), \
QT_AVAILABLE_SPLIT(c), \
QT_AVAILABLE_SPLIT(d)})
#define QT_BUILTIN_AVAILABLE_ARG(arg0, arg1, arg2, arg3, arg4, arg5, ...) arg5
#define QT_BUILTIN_AVAILABLE_CHOOSER(...) QT_BUILTIN_AVAILABLE_ARG(__VA_ARGS__, \
QT_BUILTIN_AVAILABLE4, \
QT_BUILTIN_AVAILABLE3, \
QT_BUILTIN_AVAILABLE2, \
QT_BUILTIN_AVAILABLE1, \
QT_BUILTIN_AVAILABLE0, )
#define __builtin_available(...) QT_BUILTIN_AVAILABLE_CHOOSER(__VA_ARGS__)(__VA_ARGS__)
#endif // !__has_builtin(__builtin_available)
#endif // defined(__cplusplus)
#endif // QGLOBAL_P_H

View File

@@ -0,0 +1,56 @@
// Copyright (C) 2021 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 QGREGORIAN_CALENDAR_P_H
#define QGREGORIAN_CALENDAR_P_H
//
// W A R N I N G
// -------------
//
// This file is not part of the Qt API. It exists for the convenience
// of calendar implementations. This header file may change from version to
// version without notice, or even be removed.
//
// We mean it.
//
#include "qromancalendar_p.h"
QT_BEGIN_NAMESPACE
class Q_CORE_EXPORT QGregorianCalendar : public QRomanCalendar
{
// TODO: provide static methods, called by the overrides, that can be called
// directly by QDate to optimize various parts.
public:
// Calendar property:
QString name() const override;
static QStringList nameList();
// Date queries:
bool isLeapYear(int year) const override;
// Julian Day conversions:
bool dateToJulianDay(int year, int month, int day, qint64 *jd) const override;
QCalendar::YearMonthDay julianDayToDate(qint64 jd) const override;
// Names of months (implemented in qlocale.cpp):
QString monthName(const QLocale &locale, int month, int year,
QLocale::FormatType format) const override;
QString standaloneMonthName(const QLocale &locale, int month, int year,
QLocale::FormatType format) const override;
// Static optimized versions for the benefit of QDate:
static int weekDayOfJulian(qint64 jd);
static bool leapTest(int year);
static int monthLength(int month, int year);
static bool validParts(int year, int month, int day);
static QCalendar::YearMonthDay partsFromJulian(qint64 jd);
static bool julianFromParts(int year, int month, int day, qint64 *jd);
// Used internally:
static int yearStartWeekDay(int year);
static int yearSharingWeekDays(QDate date);
};
QT_END_NAMESPACE
#endif // QGREGORIAN_CALENDAR_P_H

File diff suppressed because it is too large Load Diff

View File

@@ -0,0 +1,44 @@
// Copyright (C) 2020 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 QHIJRI_CALENDAR_P_H
#define QHIJRI_CALENDAR_P_H
//
// W A R N I N G
// -------------
//
// This file is not part of the Qt API. It exists for the convenience
// of calendar implementations. This header file may change from version to
// version without notice, or even be removed.
//
// We mean it.
//
#include <QtCore/private/qglobal_p.h>
#include "qcalendarbackend_p.h"
QT_REQUIRE_CONFIG(hijricalendar);
QT_BEGIN_NAMESPACE
// Base for sharing with other variants on the Islamic calendar, as needed:
class Q_CORE_EXPORT QHijriCalendar : public QCalendarBackend
{
public:
int daysInMonth(int month, int year = QCalendar::Unspecified) const override;
int maximumDaysInMonth() const override;
int daysInYear(int year) const override;
bool isLunar() const override;
bool isLuniSolar() const override;
bool isSolar() const override;
protected:
const QCalendarLocale *localeMonthIndexData() const override;
const char16_t *localeMonthData() const override;
};
QT_END_NAMESPACE
#endif // QHIJRI_CALENDAR_P_H

View File

@@ -0,0 +1,48 @@
// Copyright (C) 2014 Klarälvdalens Datakonsult AB, a KDAB Group company, info@kdab.com, author Volker Krause <volker.krause@kdab.com>
// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only
#ifndef QHOOKS_H
#define QHOOKS_H
//
// W A R N I N G
// -------------
//
// This file is not part of the Qt API. It exists purely as an
// implementation detail. This header file may change from version to
// version without notice, or even be removed.
//
// We mean it.
//
#include <QtCore/private/qglobal_p.h>
QT_BEGIN_NAMESPACE
class QObject;
namespace QHooks {
enum HookIndex {
HookDataVersion = 0,
HookDataSize = 1,
QtVersion = 2,
AddQObject = 3,
RemoveQObject = 4,
Startup = 5,
TypeInformationVersion = 6,
LastHookIndex
};
typedef void(*AddQObjectCallback)(QObject*);
typedef void(*RemoveQObjectCallback)(QObject*);
typedef void(*StartupCallback)();
}
extern quintptr Q_CORE_EXPORT qtHookData[];
QT_END_NAMESPACE
#endif

View File

@@ -0,0 +1,62 @@
// Copyright (C) 2021 Klarälvdalens Datakonsult AB, a KDAB Group company, info@kdab.com, author Stephen Kelly <stephen.kelly@kdab.com>
// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only
#ifndef QIDENTITYPROXYMODEL_P_H
#define QIDENTITYPROXYMODEL_P_H
//
// W A R N I N G
// -------------
//
// This file is not part of the Qt API. It exists for the convenience
// of QAbstractItemModel*. This header file may change from version
// to version without notice, or even be removed.
//
// We mean it.
//
//
#include <QtCore/private/qabstractproxymodel_p.h>
#include <QtCore/qidentityproxymodel.h>
QT_BEGIN_NAMESPACE
class Q_CORE_EXPORT QIdentityProxyModelPrivate : public QAbstractProxyModelPrivate
{
Q_DECLARE_PUBLIC(QIdentityProxyModel)
public:
QIdentityProxyModelPrivate()
{
}
QList<QPersistentModelIndex> layoutChangePersistentIndexes;
QModelIndexList proxyIndexes;
void _q_sourceRowsAboutToBeInserted(const QModelIndex &parent, int start, int end);
void _q_sourceRowsInserted(const QModelIndex &parent, int start, int end);
void _q_sourceRowsAboutToBeRemoved(const QModelIndex &parent, int start, int end);
void _q_sourceRowsRemoved(const QModelIndex &parent, int start, int end);
void _q_sourceRowsAboutToBeMoved(const QModelIndex &sourceParent, int sourceStart, int sourceEnd, const QModelIndex &destParent, int dest);
void _q_sourceRowsMoved(const QModelIndex &sourceParent, int sourceStart, int sourceEnd, const QModelIndex &destParent, int dest);
void _q_sourceColumnsAboutToBeInserted(const QModelIndex &parent, int start, int end);
void _q_sourceColumnsInserted(const QModelIndex &parent, int start, int end);
void _q_sourceColumnsAboutToBeRemoved(const QModelIndex &parent, int start, int end);
void _q_sourceColumnsRemoved(const QModelIndex &parent, int start, int end);
void _q_sourceColumnsAboutToBeMoved(const QModelIndex &sourceParent, int sourceStart, int sourceEnd, const QModelIndex &destParent, int dest);
void _q_sourceColumnsMoved(const QModelIndex &sourceParent, int sourceStart, int sourceEnd, const QModelIndex &destParent, int dest);
void _q_sourceDataChanged(const QModelIndex &topLeft, const QModelIndex &bottomRight, const QList<int> &roles);
void _q_sourceHeaderDataChanged(Qt::Orientation orientation, int first, int last);
void _q_sourceLayoutAboutToBeChanged(const QList<QPersistentModelIndex> &sourceParents, QAbstractItemModel::LayoutChangeHint hint);
void _q_sourceLayoutChanged(const QList<QPersistentModelIndex> &sourceParents, QAbstractItemModel::LayoutChangeHint hint);
void _q_sourceModelAboutToBeReset();
void _q_sourceModelReset();
};
QT_END_NAMESPACE
#endif // QIDENTITYPROXYMODEL_P_H

View File

@@ -0,0 +1,168 @@
// 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 QIODEVICE_P_H
#define QIODEVICE_P_H
//
// W A R N I N G
// -------------
//
// This file is not part of the Qt API. It exists for the convenience
// of QIODevice. This header file may change from version to
// version without notice, or even be removed.
//
// We mean it.
//
#include "QtCore/qbytearray.h"
#include "QtCore/qiodevice.h"
#include "QtCore/qobjectdefs.h"
#include "QtCore/qstring.h"
#include "QtCore/qvarlengtharray.h"
#include "private/qringbuffer_p.h"
#ifndef QT_NO_QOBJECT
#include "private/qobject_p.h"
#endif
QT_BEGIN_NAMESPACE
#ifndef QIODEVICE_BUFFERSIZE
#define QIODEVICE_BUFFERSIZE 16384
#endif
Q_CORE_EXPORT int qt_subtract_from_timeout(int timeout, int elapsed);
class Q_CORE_EXPORT QIODevicePrivate
#ifndef QT_NO_QOBJECT
: public QObjectPrivate
#endif
{
Q_DECLARE_PUBLIC(QIODevice)
Q_DISABLE_COPY_MOVE(QIODevicePrivate)
public:
QIODevicePrivate();
virtual ~QIODevicePrivate();
// The size of this class is a subject of the library hook data.
// When adding a new member, do not make gaps and be aware
// about the padding. Accordingly, adjust offsets in
// tests/auto/other/toolsupport and bump the TypeInformationVersion
// field in src/corelib/global/qhooks.cpp, to notify the developers.
qint64 pos = 0;
qint64 devicePos = 0;
qint64 transactionPos = 0;
class QRingBufferRef
{
QRingBuffer *m_buf;
inline QRingBufferRef() : m_buf(nullptr) { }
friend class QIODevicePrivate;
public:
// wrap functions from QRingBuffer
inline void setChunkSize(int size) { Q_ASSERT(m_buf); m_buf->setChunkSize(size); }
inline int chunkSize() const { Q_ASSERT(m_buf); return m_buf->chunkSize(); }
inline qint64 nextDataBlockSize() const { return (m_buf ? m_buf->nextDataBlockSize() : Q_INT64_C(0)); }
inline const char *readPointer() const { return (m_buf ? m_buf->readPointer() : nullptr); }
inline const char *readPointerAtPosition(qint64 pos, qint64 &length) const { Q_ASSERT(m_buf); return m_buf->readPointerAtPosition(pos, length); }
inline void free(qint64 bytes) { Q_ASSERT(m_buf); m_buf->free(bytes); }
inline char *reserve(qint64 bytes) { Q_ASSERT(m_buf); return m_buf->reserve(bytes); }
inline char *reserveFront(qint64 bytes) { Q_ASSERT(m_buf); return m_buf->reserveFront(bytes); }
inline void truncate(qint64 pos) { Q_ASSERT(m_buf); m_buf->truncate(pos); }
inline void chop(qint64 bytes) { Q_ASSERT(m_buf); m_buf->chop(bytes); }
inline bool isEmpty() const { return !m_buf || m_buf->isEmpty(); }
inline int getChar() { return (m_buf ? m_buf->getChar() : -1); }
inline void putChar(char c) { Q_ASSERT(m_buf); m_buf->putChar(c); }
inline void ungetChar(char c) { Q_ASSERT(m_buf); m_buf->ungetChar(c); }
inline qint64 size() const { return (m_buf ? m_buf->size() : Q_INT64_C(0)); }
inline void clear() { if (m_buf) m_buf->clear(); }
inline qint64 indexOf(char c) const { return (m_buf ? m_buf->indexOf(c, m_buf->size()) : Q_INT64_C(-1)); }
inline qint64 indexOf(char c, qint64 maxLength, qint64 pos = 0) const { return (m_buf ? m_buf->indexOf(c, maxLength, pos) : Q_INT64_C(-1)); }
inline qint64 read(char *data, qint64 maxLength) { return (m_buf ? m_buf->read(data, maxLength) : Q_INT64_C(0)); }
inline QByteArray read() { return (m_buf ? m_buf->read() : QByteArray()); }
inline qint64 peek(char *data, qint64 maxLength, qint64 pos = 0) const { return (m_buf ? m_buf->peek(data, maxLength, pos) : Q_INT64_C(0)); }
inline void append(const char *data, qint64 size) { Q_ASSERT(m_buf); m_buf->append(data, size); }
inline void append(const QByteArray &qba) { Q_ASSERT(m_buf); m_buf->append(qba); }
inline qint64 skip(qint64 length) { return (m_buf ? m_buf->skip(length) : Q_INT64_C(0)); }
inline qint64 readLine(char *data, qint64 maxLength) { return (m_buf ? m_buf->readLine(data, maxLength) : Q_INT64_C(-1)); }
inline bool canReadLine() const { return m_buf && m_buf->canReadLine(); }
};
QRingBufferRef buffer;
QRingBufferRef writeBuffer;
const QByteArray *currentWriteChunk = nullptr;
int readChannelCount = 0;
int writeChannelCount = 0;
int currentReadChannel = 0;
int currentWriteChannel = 0;
int readBufferChunkSize = QIODEVICE_BUFFERSIZE;
int writeBufferChunkSize = 0;
QVarLengthArray<QRingBuffer, 2> readBuffers;
QVarLengthArray<QRingBuffer, 1> writeBuffers;
QString errorString;
QIODevice::OpenMode openMode = QIODevice::NotOpen;
bool transactionStarted = false;
bool baseReadLineDataCalled = false;
virtual bool putCharHelper(char c);
enum AccessMode : quint8 {
Unset,
Sequential,
RandomAccess
};
mutable AccessMode accessMode = Unset;
inline bool isSequential() const
{
if (accessMode == Unset)
accessMode = q_func()->isSequential() ? Sequential : RandomAccess;
return accessMode == Sequential;
}
inline bool isBufferEmpty() const
{
return buffer.isEmpty() || (transactionStarted && isSequential()
&& transactionPos == buffer.size());
}
bool allWriteBuffersEmpty() const;
void seekBuffer(qint64 newPos);
inline void setCurrentReadChannel(int channel)
{
buffer.m_buf = (channel < readBuffers.size() ? &readBuffers[channel] : nullptr);
currentReadChannel = channel;
}
inline void setCurrentWriteChannel(int channel)
{
writeBuffer.m_buf = (channel < writeBuffers.size() ? &writeBuffers[channel] : nullptr);
currentWriteChannel = channel;
}
void setReadChannelCount(int count);
void setWriteChannelCount(int count);
qint64 read(char *data, qint64 maxSize, bool peeking = false);
qint64 readLine(char *data, qint64 maxSize);
virtual qint64 peek(char *data, qint64 maxSize);
virtual QByteArray peek(qint64 maxSize);
qint64 skipByReading(qint64 maxSize);
void write(const char *data, qint64 size);
inline bool isWriteChunkCached(const char *data, qint64 size) const
{
return currentWriteChunk != nullptr
&& currentWriteChunk->constData() == data
&& currentWriteChunk->size() == size;
}
#ifdef QT_NO_QOBJECT
QIODevice *q_ptr = nullptr;
#endif
};
QT_END_NAMESPACE
#endif // QIODEVICE_P_H

View File

@@ -0,0 +1,37 @@
// Copyright (C) 2016 Intel Corporation.
// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only
#ifndef QIPADDRESS_P_H
#define QIPADDRESS_P_H
//
// W A R N I N G
// -------------
//
// This file is not part of the Qt API. It exists purely as an
// implementation detail. This header file may change from version to
// version without notice, or even be removed.
//
// We mean it.
//
#include <QtCore/private/qglobal_p.h>
#include "qstring.h"
QT_BEGIN_NAMESPACE
namespace QIPAddressUtils {
typedef quint32 IPv4Address;
typedef quint8 IPv6Address[16];
Q_CORE_EXPORT bool parseIp4(IPv4Address &address, const QChar *begin, const QChar *end);
Q_CORE_EXPORT const QChar *parseIp6(IPv6Address &address, const QChar *begin, const QChar *end);
Q_CORE_EXPORT void toString(QString &appendTo, IPv4Address address);
Q_CORE_EXPORT void toString(QString &appendTo, const IPv6Address address);
} // namespace
QT_END_NAMESPACE
#endif // QIPADDRESS_P_H

View File

@@ -0,0 +1,39 @@
// Copyright (C) 2020 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 QISLAMIC_CIVIL_CALENDAR_P_H
#define QISLAMIC_CIVIL_CALENDAR_P_H
//
// W A R N I N G
// -------------
//
// This file is not part of the Qt API. It exists for the convenience
// of calendar implementations. This header file may change from version to
// version without notice, or even be removed.
//
// We mean it.
//
#include "qhijricalendar_p.h"
QT_REQUIRE_CONFIG(islamiccivilcalendar);
QT_BEGIN_NAMESPACE
class Q_CORE_EXPORT QIslamicCivilCalendar : public QHijriCalendar
{
public:
// Calendar properties:
QString name() const override;
static QStringList nameList();
// Date queries:
bool isLeapYear(int year) const override;
// Julian Day conversions:
bool dateToJulianDay(int year, int month, int day, qint64 *jd) const override;
QCalendar::YearMonthDay julianDayToDate(qint64 jd) const override;
};
QT_END_NAMESPACE
#endif // QISLAMIC_CIVIL_CALENDAR_P_H

View File

@@ -0,0 +1,95 @@
// 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 QITEMSELECTIONMODEL_P_H
#define QITEMSELECTIONMODEL_P_H
//
// W A R N I N G
// -------------
//
// This file is not part of the Qt API. It exists purely as an
// implementation detail. This header file may change from version to
// version without notice, or even be removed.
//
// We mean it.
//
#include "private/qobject_p.h"
#include "private/qproperty_p.h"
#include <array>
QT_REQUIRE_CONFIG(itemmodel);
QT_BEGIN_NAMESPACE
class QItemSelectionModelPrivate: public QObjectPrivate
{
Q_DECLARE_PUBLIC(QItemSelectionModel)
public:
QItemSelectionModelPrivate()
: currentCommand(QItemSelectionModel::NoUpdate),
tableSelected(false), tableColCount(0), tableRowCount(0) {}
QItemSelection expandSelection(const QItemSelection &selection,
QItemSelectionModel::SelectionFlags command) const;
void initModel(QAbstractItemModel *model);
void rowsAboutToBeRemoved(const QModelIndex &parent, int start, int end);
void columnsAboutToBeRemoved(const QModelIndex &parent, int start, int end);
void rowsAboutToBeInserted(const QModelIndex &parent, int start, int end);
void columnsAboutToBeInserted(const QModelIndex &parent, int start, int end);
void layoutAboutToBeChanged(const QList<QPersistentModelIndex> &parents, QAbstractItemModel::LayoutChangeHint hint);
void triggerLayoutToBeChanged()
{
layoutAboutToBeChanged(QList<QPersistentModelIndex>(), QAbstractItemModel::NoLayoutChangeHint);
}
void layoutChanged(const QList<QPersistentModelIndex> &parents, QAbstractItemModel::LayoutChangeHint hint);
void triggerLayoutChanged()
{
layoutChanged(QList<QPersistentModelIndex>(), QAbstractItemModel::NoLayoutChangeHint);
}
void modelDestroyed();
inline void remove(QList<QItemSelectionRange> &r)
{
QList<QItemSelectionRange>::const_iterator it = r.constBegin();
for (; it != r.constEnd(); ++it)
ranges.removeAll(*it);
}
inline void finalize()
{
ranges.merge(currentSelection, currentCommand);
if (!currentSelection.isEmpty()) // ### perhaps this should be in QList
currentSelection.clear();
}
void setModel(QAbstractItemModel *mod) { q_func()->setModel(mod); }
void disconnectModel();
void modelChanged(QAbstractItemModel *mod) { emit q_func()->modelChanged(mod); }
Q_OBJECT_COMPAT_PROPERTY_WITH_ARGS(QItemSelectionModelPrivate, QAbstractItemModel *, model,
&QItemSelectionModelPrivate::setModel,
&QItemSelectionModelPrivate::modelChanged, nullptr)
QItemSelection ranges;
QItemSelection currentSelection;
QPersistentModelIndex currentIndex;
QItemSelectionModel::SelectionFlags currentCommand;
QList<QPersistentModelIndex> savedPersistentIndexes;
QList<QPersistentModelIndex> savedPersistentCurrentIndexes;
QList<QPair<QPersistentModelIndex, uint>> savedPersistentRowLengths;
QList<QPair<QPersistentModelIndex, uint>> savedPersistentCurrentRowLengths;
// optimization when all indexes are selected
bool tableSelected;
QPersistentModelIndex tableParent;
int tableColCount, tableRowCount;
std::array<QMetaObject::Connection, 12> connections;
};
QT_END_NAMESPACE
#endif // QITEMSELECTIONMODEL_P_H

View File

@@ -0,0 +1,42 @@
// Copyright (C) 2020 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 QITERABLE_P_H
#define QITERABLE_P_H
//
// W A R N I N G
// -------------
//
// This file is not part of the Qt API. It exists purely as an
// implementation detail. This header file may change from version to
// version without notice, or even be removed.
//
// We mean it.
//
#include <QtCore/private/qglobal_p.h>
#include <QtCore/qvariant.h>
QT_BEGIN_NAMESPACE
namespace QIterablePrivate {
template<typename Callback>
static QVariant retrieveElement(QMetaType type, Callback callback)
{
QVariant v(type);
void *dataPtr;
if (type == QMetaType::fromType<QVariant>())
dataPtr = &v;
else
dataPtr = v.data();
callback(dataPtr);
return v;
}
} // namespace QIterablePrivate
QT_END_NAMESPACE
#endif // QITERABLE_P_H

View File

@@ -0,0 +1,982 @@
// Copyright (C) 2019 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 QPERSIANCALENDAR_DATA_P_H
#define QPERSIANCALENDAR_DATA_P_H
//
// W A R N I N G
// -------------
//
// This file is not part of the Qt API. It exists for the convenience
// of qapplication_*.cpp, qwidget*.cpp and qfiledialog.cpp. This header
// file may change from version to version without notice, or even be removed.
//
// We mean it.
//
#include <QtCore/private/qglobal_p.h>
#include <QtCore/private/qcalendarbackend_p.h>
QT_BEGIN_NAMESPACE
namespace QtPrivate::Jalali {
// GENERATED PART STARTS HERE
/*
This part of the file was generated on 2023-08-03 from the
Common Locale Data Repository v43
http://www.unicode.org/cldr/
Do not edit this section: instead regenerate it using
cldr2qlocalexml.py and qlocalexml2cpp.py on updated (or
edited) CLDR data; see qtbase/util/locale_database/.
*/
static constexpr QCalendarLocale locale_data[] = {
// lang script terr sLong long sShrt short sNarw narow Sizes...
{ 1, 0, 0, 0, 0, 83, 83, 130, 153, 83, 83, 47, 47, 23, 26 },// C/AnyScript/AnyTerritory
{ 2, 27, 90, 0, 0, 0, 0, 153, 153, 83, 83, 83, 83, 26, 26 },// Abkhazian/Cyrillic/Georgia
{ 3, 66, 77, 0, 0, 0, 0, 153, 153, 83, 83, 83, 83, 26, 26 },// Afar/Latin/Ethiopia
{ 3, 66, 67, 0, 0, 0, 0, 153, 153, 83, 83, 83, 83, 26, 26 },// Afar/Latin/Djibouti
{ 3, 66, 74, 0, 0, 0, 0, 153, 153, 83, 83, 83, 83, 26, 26 },// Afar/Latin/Eritrea
{ 4, 66, 216, 0, 0, 0, 0, 153, 153, 83, 83, 83, 83, 26, 26 },// Afrikaans/Latin/South Africa
{ 4, 66, 162, 0, 0, 0, 0, 153, 153, 83, 83, 83, 83, 26, 26 },// Afrikaans/Latin/Namibia
{ 5, 66, 40, 0, 0, 0, 0, 153, 153, 83, 83, 83, 83, 26, 26 },// Aghem/Latin/Cameroon
{ 6, 66, 92, 0, 0, 0, 0, 153, 153, 83, 83, 83, 83, 26, 26 },// Akan/Latin/Ghana
{ 8, 66, 40, 0, 0, 0, 0, 153, 153, 83, 83, 83, 83, 26, 26 },// Akoose/Latin/Cameroon
{ 9, 66, 3, 0, 0, 0, 0, 153, 153, 83, 83, 83, 83, 26, 26 },// Albanian/Latin/Albania
{ 9, 66, 126, 0, 0, 0, 0, 153, 153, 83, 83, 83, 83, 26, 26 },// Albanian/Latin/Kosovo
{ 9, 66, 140, 0, 0, 0, 0, 153, 153, 83, 83, 83, 83, 26, 26 },// Albanian/Latin/Macedonia
{ 11, 33, 77, 0, 0, 0, 0, 153, 153, 83, 83, 83, 83, 26, 26 },// Amharic/Ethiopic/Ethiopia
{ 14, 4, 71, 179, 179, 179, 179, 153, 153, 67, 67, 67, 67, 26, 26 },// Arabic/Arabic/Egypt
{ 14, 4, 4, 179, 179, 179, 179, 153, 153, 67, 67, 67, 67, 26, 26 },// Arabic/Arabic/Algeria
{ 14, 4, 19, 179, 179, 179, 179, 153, 153, 67, 67, 67, 67, 26, 26 },// Arabic/Arabic/Bahrain
{ 14, 4, 48, 179, 179, 179, 179, 153, 153, 67, 67, 67, 67, 26, 26 },// Arabic/Arabic/Chad
{ 14, 4, 55, 179, 179, 179, 179, 153, 153, 67, 67, 67, 67, 26, 26 },// Arabic/Arabic/Comoros
{ 14, 4, 67, 179, 179, 179, 179, 153, 153, 67, 67, 67, 67, 26, 26 },// Arabic/Arabic/Djibouti
{ 14, 4, 74, 179, 179, 179, 179, 153, 153, 67, 67, 67, 67, 26, 26 },// Arabic/Arabic/Eritrea
{ 14, 4, 113, 179, 179, 179, 179, 153, 153, 67, 67, 67, 67, 26, 26 },// Arabic/Arabic/Iraq
{ 14, 4, 116, 179, 179, 179, 179, 153, 153, 67, 67, 67, 67, 26, 26 },// Arabic/Arabic/Israel
{ 14, 4, 122, 179, 179, 179, 179, 153, 153, 67, 67, 67, 67, 26, 26 },// Arabic/Arabic/Jordan
{ 14, 4, 127, 179, 179, 179, 179, 153, 153, 67, 67, 67, 67, 26, 26 },// Arabic/Arabic/Kuwait
{ 14, 4, 132, 179, 179, 179, 179, 153, 153, 67, 67, 67, 67, 26, 26 },// Arabic/Arabic/Lebanon
{ 14, 4, 135, 179, 179, 179, 179, 153, 153, 67, 67, 67, 67, 26, 26 },// Arabic/Arabic/Libya
{ 14, 4, 149, 179, 179, 179, 179, 153, 153, 67, 67, 67, 67, 26, 26 },// Arabic/Arabic/Mauritania
{ 14, 4, 159, 179, 179, 179, 179, 153, 153, 67, 67, 67, 67, 26, 26 },// Arabic/Arabic/Morocco
{ 14, 4, 176, 179, 179, 179, 179, 153, 153, 67, 67, 67, 67, 26, 26 },// Arabic/Arabic/Oman
{ 14, 4, 180, 179, 179, 179, 179, 153, 153, 67, 67, 67, 67, 26, 26 },// Arabic/Arabic/Palestinian Territories
{ 14, 4, 190, 179, 179, 179, 179, 153, 153, 67, 67, 67, 67, 26, 26 },// Arabic/Arabic/Qatar
{ 14, 4, 205, 179, 179, 179, 179, 153, 153, 67, 67, 67, 67, 26, 26 },// Arabic/Arabic/Saudi Arabia
{ 14, 4, 215, 179, 179, 179, 179, 153, 153, 67, 67, 67, 67, 26, 26 },// Arabic/Arabic/Somalia
{ 14, 4, 219, 179, 179, 179, 179, 153, 153, 67, 67, 67, 67, 26, 26 },// Arabic/Arabic/South Sudan
{ 14, 4, 222, 179, 179, 179, 179, 153, 153, 67, 67, 67, 67, 26, 26 },// Arabic/Arabic/Sudan
{ 14, 4, 227, 179, 179, 179, 179, 153, 153, 67, 67, 67, 67, 26, 26 },// Arabic/Arabic/Syria
{ 14, 4, 238, 179, 179, 179, 179, 153, 153, 67, 67, 67, 67, 26, 26 },// Arabic/Arabic/Tunisia
{ 14, 4, 245, 179, 179, 179, 179, 153, 153, 67, 67, 67, 67, 26, 26 },// Arabic/Arabic/United Arab Emirates
{ 14, 4, 257, 179, 179, 179, 179, 153, 153, 67, 67, 67, 67, 26, 26 },// Arabic/Arabic/Western Sahara
{ 14, 4, 258, 179, 179, 179, 179, 153, 153, 67, 67, 67, 67, 26, 26 },// Arabic/Arabic/World
{ 14, 4, 259, 179, 179, 179, 179, 153, 153, 67, 67, 67, 67, 26, 26 },// Arabic/Arabic/Yemen
{ 15, 66, 220, 0, 0, 0, 0, 153, 153, 83, 83, 83, 83, 26, 26 },// Aragonese/Latin/Spain
{ 17, 5, 12, 0, 0, 0, 0, 153, 153, 83, 83, 83, 83, 26, 26 },// Armenian/Armenian/Armenia
{ 18, 9, 110, 0, 0, 0, 0, 153, 153, 83, 83, 83, 83, 26, 26 },// Assamese/Bangla/India
{ 19, 66, 220, 0, 0, 0, 0, 153, 153, 83, 83, 83, 83, 26, 26 },// Asturian/Latin/Spain
{ 20, 66, 230, 0, 0, 0, 0, 153, 153, 83, 83, 83, 83, 26, 26 },// Asu/Latin/Tanzania
{ 21, 66, 169, 0, 0, 0, 0, 153, 153, 83, 83, 83, 83, 26, 26 },// Atsam/Latin/Nigeria
{ 25, 66, 17, 246, 246, 246, 246, 153, 153, 80, 80, 80, 80, 26, 26 },// Azerbaijani/Latin/Azerbaijan
{ 25, 4, 112, 0, 0, 0, 0, 153, 153, 83, 83, 83, 83, 26, 26 },// Azerbaijani/Arabic/Iran
{ 25, 4, 113, 0, 0, 0, 0, 153, 153, 83, 83, 83, 83, 26, 26 },// Azerbaijani/Arabic/Iraq
{ 25, 4, 239, 0, 0, 0, 0, 153, 153, 83, 83, 83, 83, 26, 26 },// Azerbaijani/Arabic/Turkey
{ 25, 27, 17, 0, 0, 0, 0, 153, 153, 83, 83, 83, 83, 26, 26 },// Azerbaijani/Cyrillic/Azerbaijan
{ 26, 66, 40, 0, 0, 0, 0, 153, 153, 83, 83, 83, 83, 26, 26 },// Bafia/Latin/Cameroon
{ 28, 66, 145, 0, 0, 0, 0, 153, 153, 83, 83, 83, 83, 26, 26 },// Bambara/Latin/Mali
{ 28, 90, 145, 0, 0, 0, 0, 153, 153, 83, 83, 83, 83, 26, 26 },// Bambara/Nko/Mali
{ 30, 9, 20, 326, 326, 414, 414, 501, 501, 88, 88, 87, 87, 26, 26 },// Bangla/Bangla/Bangladesh
{ 30, 9, 110, 326, 326, 414, 414, 501, 501, 88, 88, 87, 87, 26, 26 },// Bangla/Bangla/India
{ 31, 66, 40, 0, 0, 0, 0, 153, 153, 83, 83, 83, 83, 26, 26 },// Basaa/Latin/Cameroon
{ 32, 27, 193, 0, 0, 0, 0, 153, 153, 83, 83, 83, 83, 26, 26 },// Bashkir/Cyrillic/Russia
{ 33, 66, 220, 0, 0, 0, 0, 153, 153, 83, 83, 83, 83, 26, 26 },// Basque/Latin/Spain
{ 35, 27, 22, 0, 0, 0, 0, 153, 153, 83, 83, 83, 83, 26, 26 },// Belarusian/Cyrillic/Belarus
{ 36, 66, 260, 0, 0, 0, 0, 153, 153, 83, 83, 83, 83, 26, 26 },// Bemba/Latin/Zambia
{ 37, 66, 230, 0, 0, 0, 0, 153, 153, 83, 83, 83, 83, 26, 26 },// Bena/Latin/Tanzania
{ 38, 29, 110, 0, 0, 0, 0, 153, 153, 83, 83, 83, 83, 26, 26 },// Bhojpuri/Devanagari/India
{ 40, 33, 74, 0, 0, 0, 0, 153, 153, 83, 83, 83, 83, 26, 26 },// Blin/Ethiopic/Eritrea
{ 41, 29, 110, 0, 0, 0, 0, 153, 153, 83, 83, 83, 83, 26, 26 },// Bodo/Devanagari/India
{ 42, 66, 29, 0, 0, 0, 0, 153, 153, 83, 83, 83, 83, 26, 26 },// Bosnian/Latin/Bosnia And Herzegovina
{ 42, 27, 29, 527, 527, 527, 527, 153, 153, 80, 80, 80, 80, 26, 26 },// Bosnian/Cyrillic/Bosnia And Herzegovina
{ 43, 66, 84, 0, 0, 0, 0, 153, 153, 83, 83, 83, 83, 26, 26 },// Breton/Latin/France
{ 45, 27, 36, 0, 0, 0, 0, 153, 153, 83, 83, 83, 83, 26, 26 },// Bulgarian/Cyrillic/Bulgaria
{ 46, 86, 161, 0, 0, 0, 0, 153, 153, 83, 83, 83, 83, 26, 26 },// Burmese/Myanmar/Myanmar
{ 47, 137, 107, 607, 607, 607, 607, 153, 153, 38, 38, 38, 38, 26, 26 },// Cantonese/Traditional Han/Hong Kong
{ 47, 118, 50, 607, 607, 607, 607, 153, 153, 38, 38, 38, 38, 26, 26 },// Cantonese/Simplified Han/China
{ 48, 66, 220, 0, 0, 0, 0, 153, 153, 83, 83, 83, 83, 26, 26 },// Catalan/Latin/Spain
{ 48, 66, 6, 0, 0, 0, 0, 153, 153, 83, 83, 83, 83, 26, 26 },// Catalan/Latin/Andorra
{ 48, 66, 84, 0, 0, 0, 0, 153, 153, 83, 83, 83, 83, 26, 26 },// Catalan/Latin/France
{ 48, 66, 117, 0, 0, 0, 0, 153, 153, 83, 83, 83, 83, 26, 26 },// Catalan/Latin/Italy
{ 49, 66, 185, 0, 0, 0, 0, 153, 153, 83, 83, 83, 83, 26, 26 },// Cebuano/Latin/Philippines
{ 50, 66, 159, 0, 0, 0, 0, 153, 153, 83, 83, 83, 83, 26, 26 },// Central Atlas Tamazight/Latin/Morocco
{ 51, 4, 113, 645, 645, 645, 645, 153, 153,101,101,101,101, 26, 26 },// Central Kurdish/Arabic/Iraq
{ 51, 4, 112, 645, 746, 645, 645, 153, 153,101,100,101,101, 26, 26 },// Central Kurdish/Arabic/Iran
{ 52, 21, 20, 0, 0, 0, 0, 153, 153, 83, 83, 83, 83, 26, 26 },// Chakma/Chakma/Bangladesh
{ 52, 21, 110, 0, 0, 0, 0, 153, 153, 83, 83, 83, 83, 26, 26 },// Chakma/Chakma/India
{ 54, 27, 193, 0, 0, 0, 0, 153, 153, 83, 83, 83, 83, 26, 26 },// Chechen/Cyrillic/Russia
{ 55, 23, 248, 0, 0, 0, 0, 153, 153, 83, 83, 83, 83, 26, 26 },// Cherokee/Cherokee/United States
{ 56, 66, 248, 0, 0, 0, 0, 153, 153, 83, 83, 83, 83, 26, 26 },// Chickasaw/Latin/United States
{ 57, 66, 243, 0, 0, 0, 0, 153, 153, 83, 83, 83, 83, 26, 26 },// Chiga/Latin/Uganda
{ 58, 118, 50, 846, 846, 607, 607, 153, 153, 37, 37, 38, 38, 26, 26 },// Chinese/Simplified Han/China
{ 58, 118, 107, 846, 846, 607, 607, 153, 153, 37, 37, 38, 38, 26, 26 },// Chinese/Simplified Han/Hong Kong
{ 58, 118, 139, 846, 846, 607, 607, 153, 153, 37, 37, 38, 38, 26, 26 },// Chinese/Simplified Han/Macao
{ 58, 118, 210, 846, 846, 607, 607, 153, 153, 37, 37, 38, 38, 26, 26 },// Chinese/Simplified Han/Singapore
{ 58, 137, 107, 607, 607, 607, 607, 153, 153, 38, 38, 38, 38, 26, 26 },// Chinese/Traditional Han/Hong Kong
{ 58, 137, 139, 607, 607, 607, 607, 153, 153, 38, 38, 38, 38, 26, 26 },// Chinese/Traditional Han/Macao
{ 58, 137, 228, 607, 607, 607, 607, 153, 153, 38, 38, 38, 38, 26, 26 },// Chinese/Traditional Han/Taiwan
{ 59, 27, 193, 0, 0, 0, 0, 153, 153, 83, 83, 83, 83, 26, 26 },// Church/Cyrillic/Russia
{ 60, 27, 193, 0, 0, 0, 0, 153, 153, 83, 83, 83, 83, 26, 26 },// Chuvash/Cyrillic/Russia
{ 61, 66, 91, 0, 0, 0, 0, 153, 153, 83, 83, 83, 83, 26, 26 },// Colognian/Latin/Germany
{ 63, 66, 246, 0, 0, 0, 0, 153, 153, 83, 83, 83, 83, 26, 26 },// Cornish/Latin/United Kingdom
{ 64, 66, 84, 0, 0, 0, 0, 153, 153, 83, 83, 83, 83, 26, 26 },// Corsican/Latin/France
{ 66, 66, 60, 0, 0, 0, 0, 883, 883, 83, 83, 83, 83, 38, 38 },// Croatian/Latin/Croatia
{ 66, 66, 29, 0, 0, 0, 0, 883, 883, 83, 83, 83, 83, 38, 38 },// Croatian/Latin/Bosnia And Herzegovina
{ 67, 66, 64, 921, 921, 921, 921, 153, 153, 81, 81, 81, 81, 26, 26 },// Czech/Latin/Czechia
{ 68, 66, 65, 1002, 1002, 1002, 1002, 153, 153, 83, 83, 83, 83, 26, 26 },// Danish/Latin/Denmark
{ 68, 66, 95, 1002, 1002, 1002, 1002, 153, 153, 83, 83, 83, 83, 26, 26 },// Danish/Latin/Greenland
{ 69, 132, 144, 0, 0, 0, 0, 153, 153, 83, 83, 83, 83, 26, 26 },// Divehi/Thaana/Maldives
{ 70, 29, 110, 0, 0, 0, 0, 153, 153, 83, 83, 83, 83, 26, 26 },// Dogri/Devanagari/India
{ 71, 66, 40, 0, 0, 0, 0, 153, 153, 83, 83, 83, 83, 26, 26 },// Duala/Latin/Cameroon
{ 72, 66, 165, 0, 0, 0, 0, 153, 153, 83, 83, 83, 83, 26, 26 },// Dutch/Latin/Netherlands
{ 72, 66, 13, 0, 0, 0, 0, 153, 153, 83, 83, 83, 83, 26, 26 },// Dutch/Latin/Aruba
{ 72, 66, 23, 0, 0, 0, 0, 153, 153, 83, 83, 83, 83, 26, 26 },// Dutch/Latin/Belgium
{ 72, 66, 44, 0, 0, 0, 0, 153, 153, 83, 83, 83, 83, 26, 26 },// Dutch/Latin/Caribbean Netherlands
{ 72, 66, 62, 0, 0, 0, 0, 153, 153, 83, 83, 83, 83, 26, 26 },// Dutch/Latin/Curacao
{ 72, 66, 211, 0, 0, 0, 0, 153, 153, 83, 83, 83, 83, 26, 26 },// Dutch/Latin/Sint Maarten
{ 72, 66, 223, 0, 0, 0, 0, 153, 153, 83, 83, 83, 83, 26, 26 },// Dutch/Latin/Suriname
{ 73, 134, 27, 0, 0, 0, 0, 153, 153, 83, 83, 83, 83, 26, 26 },// Dzongkha/Tibetan/Bhutan
{ 74, 66, 124, 0, 0, 0, 0, 153, 153, 83, 83, 83, 83, 26, 26 },// Embu/Latin/Kenya
{ 75, 66, 248, 0, 0, 0, 0, 153, 153, 83, 83, 83, 83, 26, 26 },// English/Latin/United States
{ 75, 28, 248, 0, 0, 0, 0, 153, 153, 83, 83, 83, 83, 26, 26 },// English/Deseret/United States
{ 75, 66, 5, 0, 0, 0, 0, 153, 153, 83, 83, 83, 83, 26, 26 },// English/Latin/American Samoa
{ 75, 66, 8, 0, 0, 0, 0, 153, 153, 83, 83, 83, 83, 26, 26 },// English/Latin/Anguilla
{ 75, 66, 10, 0, 0, 0, 0, 153, 153, 83, 83, 83, 83, 26, 26 },// English/Latin/Antigua And Barbuda
{ 75, 66, 15, 0, 0, 0, 0, 153, 153, 83, 83, 83, 83, 26, 26 },// English/Latin/Australia
{ 75, 66, 16, 0, 0, 0, 0, 153, 153, 83, 83, 83, 83, 26, 26 },// English/Latin/Austria
{ 75, 66, 18, 0, 0, 0, 0, 153, 153, 83, 83, 83, 83, 26, 26 },// English/Latin/Bahamas
{ 75, 66, 21, 0, 0, 0, 0, 153, 153, 83, 83, 83, 83, 26, 26 },// English/Latin/Barbados
{ 75, 66, 23, 0, 0, 0, 0, 153, 153, 83, 83, 83, 83, 26, 26 },// English/Latin/Belgium
{ 75, 66, 24, 0, 0, 0, 0, 153, 153, 83, 83, 83, 83, 26, 26 },// English/Latin/Belize
{ 75, 66, 26, 0, 0, 0, 0, 153, 153, 83, 83, 83, 83, 26, 26 },// English/Latin/Bermuda
{ 75, 66, 30, 0, 0, 0, 0, 153, 153, 83, 83, 83, 83, 26, 26 },// English/Latin/Botswana
{ 75, 66, 33, 0, 0, 0, 0, 153, 153, 83, 83, 83, 83, 26, 26 },// English/Latin/British Indian Ocean Territory
{ 75, 66, 34, 0, 0, 0, 0, 153, 153, 83, 83, 83, 83, 26, 26 },// English/Latin/British Virgin Islands
{ 75, 66, 38, 0, 0, 0, 0, 153, 153, 83, 83, 83, 83, 26, 26 },// English/Latin/Burundi
{ 75, 66, 40, 0, 0, 0, 0, 153, 153, 83, 83, 83, 83, 26, 26 },// English/Latin/Cameroon
{ 75, 66, 41, 0, 0, 0, 0, 153, 153, 83, 83, 83, 83, 26, 26 },// English/Latin/Canada
{ 75, 66, 45, 0, 0, 0, 0, 153, 153, 83, 83, 83, 83, 26, 26 },// English/Latin/Cayman Islands
{ 75, 66, 51, 0, 0, 0, 0, 153, 153, 83, 83, 83, 83, 26, 26 },// English/Latin/Christmas Island
{ 75, 66, 53, 0, 0, 0, 0, 153, 153, 83, 83, 83, 83, 26, 26 },// English/Latin/Cocos Islands
{ 75, 66, 58, 0, 0, 0, 0, 153, 153, 83, 83, 83, 83, 26, 26 },// English/Latin/Cook Islands
{ 75, 66, 63, 0, 0, 0, 0, 153, 153, 83, 83, 83, 83, 26, 26 },// English/Latin/Cyprus
{ 75, 66, 65, 0, 0, 0, 0, 153, 153, 83, 83, 83, 83, 26, 26 },// English/Latin/Denmark
{ 75, 66, 66, 0, 0, 0, 0, 153, 153, 83, 83, 83, 83, 26, 26 },// English/Latin/Diego Garcia
{ 75, 66, 68, 0, 0, 0, 0, 153, 153, 83, 83, 83, 83, 26, 26 },// English/Latin/Dominica
{ 75, 66, 74, 0, 0, 0, 0, 153, 153, 83, 83, 83, 83, 26, 26 },// English/Latin/Eritrea
{ 75, 66, 76, 0, 0, 0, 0, 153, 153, 83, 83, 83, 83, 26, 26 },// English/Latin/Eswatini
{ 75, 66, 78, 0, 0, 0, 0, 153, 153, 83, 83, 83, 83, 26, 26 },// English/Latin/Europe
{ 75, 66, 80, 0, 0, 0, 0, 153, 153, 83, 83, 83, 83, 26, 26 },// English/Latin/Falkland Islands
{ 75, 66, 82, 0, 0, 0, 0, 153, 153, 83, 83, 83, 83, 26, 26 },// English/Latin/Fiji
{ 75, 66, 83, 0, 0, 0, 0, 153, 153, 83, 83, 83, 83, 26, 26 },// English/Latin/Finland
{ 75, 66, 89, 0, 0, 0, 0, 153, 153, 83, 83, 83, 83, 26, 26 },// English/Latin/Gambia
{ 75, 66, 91, 0, 0, 0, 0, 153, 153, 83, 83, 83, 83, 26, 26 },// English/Latin/Germany
{ 75, 66, 92, 0, 0, 0, 0, 153, 153, 83, 83, 83, 83, 26, 26 },// English/Latin/Ghana
{ 75, 66, 93, 0, 0, 0, 0, 153, 153, 83, 83, 83, 83, 26, 26 },// English/Latin/Gibraltar
{ 75, 66, 96, 0, 0, 0, 0, 153, 153, 83, 83, 83, 83, 26, 26 },// English/Latin/Grenada
{ 75, 66, 98, 0, 0, 0, 0, 153, 153, 83, 83, 83, 83, 26, 26 },// English/Latin/Guam
{ 75, 66, 100, 0, 0, 0, 0, 153, 153, 83, 83, 83, 83, 26, 26 },// English/Latin/Guernsey
{ 75, 66, 103, 0, 0, 0, 0, 153, 153, 83, 83, 83, 83, 26, 26 },// English/Latin/Guyana
{ 75, 66, 107, 0, 0, 0, 0, 153, 153, 83, 83, 83, 83, 26, 26 },// English/Latin/Hong Kong
{ 75, 66, 110, 0, 0, 0, 0, 153, 153, 83, 83, 83, 83, 26, 26 },// English/Latin/India
{ 75, 66, 114, 0, 0, 0, 0, 153, 153, 83, 83, 83, 83, 26, 26 },// English/Latin/Ireland
{ 75, 66, 115, 0, 0, 0, 0, 153, 153, 83, 83, 83, 83, 26, 26 },// English/Latin/Isle Of Man
{ 75, 66, 116, 0, 0, 0, 0, 153, 153, 83, 83, 83, 83, 26, 26 },// English/Latin/Israel
{ 75, 66, 119, 0, 0, 0, 0, 153, 153, 83, 83, 83, 83, 26, 26 },// English/Latin/Jamaica
{ 75, 66, 121, 0, 0, 0, 0, 153, 153, 83, 83, 83, 83, 26, 26 },// English/Latin/Jersey
{ 75, 66, 124, 0, 0, 0, 0, 153, 153, 83, 83, 83, 83, 26, 26 },// English/Latin/Kenya
{ 75, 66, 125, 0, 0, 0, 0, 153, 153, 83, 83, 83, 83, 26, 26 },// English/Latin/Kiribati
{ 75, 66, 133, 0, 0, 0, 0, 153, 153, 83, 83, 83, 83, 26, 26 },// English/Latin/Lesotho
{ 75, 66, 134, 0, 0, 0, 0, 153, 153, 83, 83, 83, 83, 26, 26 },// English/Latin/Liberia
{ 75, 66, 139, 0, 0, 0, 0, 153, 153, 83, 83, 83, 83, 26, 26 },// English/Latin/Macao
{ 75, 66, 141, 0, 0, 0, 0, 153, 153, 83, 83, 83, 83, 26, 26 },// English/Latin/Madagascar
{ 75, 66, 142, 0, 0, 0, 0, 153, 153, 83, 83, 83, 83, 26, 26 },// English/Latin/Malawi
{ 75, 66, 143, 0, 0, 0, 0, 153, 153, 83, 83, 83, 83, 26, 26 },// English/Latin/Malaysia
{ 75, 66, 144, 0, 0, 0, 0, 153, 153, 83, 83, 83, 83, 26, 26 },// English/Latin/Maldives
{ 75, 66, 146, 0, 0, 0, 0, 153, 153, 83, 83, 83, 83, 26, 26 },// English/Latin/Malta
{ 75, 66, 147, 0, 0, 0, 0, 153, 153, 83, 83, 83, 83, 26, 26 },// English/Latin/Marshall Islands
{ 75, 66, 150, 0, 0, 0, 0, 153, 153, 83, 83, 83, 83, 26, 26 },// English/Latin/Mauritius
{ 75, 66, 153, 0, 0, 0, 0, 153, 153, 83, 83, 83, 83, 26, 26 },// English/Latin/Micronesia
{ 75, 66, 158, 0, 0, 0, 0, 153, 153, 83, 83, 83, 83, 26, 26 },// English/Latin/Montserrat
{ 75, 66, 162, 0, 0, 0, 0, 153, 153, 83, 83, 83, 83, 26, 26 },// English/Latin/Namibia
{ 75, 66, 163, 0, 0, 0, 0, 153, 153, 83, 83, 83, 83, 26, 26 },// English/Latin/Nauru
{ 75, 66, 165, 0, 0, 0, 0, 153, 153, 83, 83, 83, 83, 26, 26 },// English/Latin/Netherlands
{ 75, 66, 167, 0, 0, 0, 0, 153, 153, 83, 83, 83, 83, 26, 26 },// English/Latin/New Zealand
{ 75, 66, 169, 0, 0, 0, 0, 153, 153, 83, 83, 83, 83, 26, 26 },// English/Latin/Nigeria
{ 75, 66, 171, 0, 0, 0, 0, 153, 153, 83, 83, 83, 83, 26, 26 },// English/Latin/Niue
{ 75, 66, 172, 0, 0, 0, 0, 153, 153, 83, 83, 83, 83, 26, 26 },// English/Latin/Norfolk Island
{ 75, 66, 173, 0, 0, 0, 0, 153, 153, 83, 83, 83, 83, 26, 26 },// English/Latin/Northern Mariana Islands
{ 75, 66, 178, 0, 0, 0, 0, 153, 153, 83, 83, 83, 83, 26, 26 },// English/Latin/Pakistan
{ 75, 66, 179, 0, 0, 0, 0, 153, 153, 83, 83, 83, 83, 26, 26 },// English/Latin/Palau
{ 75, 66, 182, 0, 0, 0, 0, 153, 153, 83, 83, 83, 83, 26, 26 },// English/Latin/Papua New Guinea
{ 75, 66, 185, 0, 0, 0, 0, 153, 153, 83, 83, 83, 83, 26, 26 },// English/Latin/Philippines
{ 75, 66, 186, 0, 0, 0, 0, 153, 153, 83, 83, 83, 83, 26, 26 },// English/Latin/Pitcairn
{ 75, 66, 189, 0, 0, 0, 0, 153, 153, 83, 83, 83, 83, 26, 26 },// English/Latin/Puerto Rico
{ 75, 66, 194, 0, 0, 0, 0, 153, 153, 83, 83, 83, 83, 26, 26 },// English/Latin/Rwanda
{ 75, 66, 196, 0, 0, 0, 0, 153, 153, 83, 83, 83, 83, 26, 26 },// English/Latin/Saint Helena
{ 75, 66, 197, 0, 0, 0, 0, 153, 153, 83, 83, 83, 83, 26, 26 },// English/Latin/Saint Kitts And Nevis
{ 75, 66, 198, 0, 0, 0, 0, 153, 153, 83, 83, 83, 83, 26, 26 },// English/Latin/Saint Lucia
{ 75, 66, 201, 0, 0, 0, 0, 153, 153, 83, 83, 83, 83, 26, 26 },// English/Latin/Saint Vincent And Grenadines
{ 75, 66, 202, 0, 0, 0, 0, 153, 153, 83, 83, 83, 83, 26, 26 },// English/Latin/Samoa
{ 75, 66, 208, 0, 0, 0, 0, 153, 153, 83, 83, 83, 83, 26, 26 },// English/Latin/Seychelles
{ 75, 66, 209, 0, 0, 0, 0, 153, 153, 83, 83, 83, 83, 26, 26 },// English/Latin/Sierra Leone
{ 75, 66, 210, 0, 0, 0, 0, 153, 153, 83, 83, 83, 83, 26, 26 },// English/Latin/Singapore
{ 75, 66, 211, 0, 0, 0, 0, 153, 153, 83, 83, 83, 83, 26, 26 },// English/Latin/Sint Maarten
{ 75, 66, 213, 0, 0, 0, 0, 153, 153, 83, 83, 83, 83, 26, 26 },// English/Latin/Slovenia
{ 75, 66, 214, 0, 0, 0, 0, 153, 153, 83, 83, 83, 83, 26, 26 },// English/Latin/Solomon Islands
{ 75, 66, 216, 0, 0, 0, 0, 153, 153, 83, 83, 83, 83, 26, 26 },// English/Latin/South Africa
{ 75, 66, 219, 0, 0, 0, 0, 153, 153, 83, 83, 83, 83, 26, 26 },// English/Latin/South Sudan
{ 75, 66, 222, 0, 0, 0, 0, 153, 153, 83, 83, 83, 83, 26, 26 },// English/Latin/Sudan
{ 75, 66, 225, 0, 0, 0, 0, 153, 153, 83, 83, 83, 83, 26, 26 },// English/Latin/Sweden
{ 75, 66, 226, 0, 0, 0, 0, 153, 153, 83, 83, 83, 83, 26, 26 },// English/Latin/Switzerland
{ 75, 66, 230, 0, 0, 0, 0, 153, 153, 83, 83, 83, 83, 26, 26 },// English/Latin/Tanzania
{ 75, 66, 234, 0, 0, 0, 0, 153, 153, 83, 83, 83, 83, 26, 26 },// English/Latin/Tokelau
{ 75, 66, 235, 0, 0, 0, 0, 153, 153, 83, 83, 83, 83, 26, 26 },// English/Latin/Tonga
{ 75, 66, 236, 0, 0, 0, 0, 153, 153, 83, 83, 83, 83, 26, 26 },// English/Latin/Trinidad And Tobago
{ 75, 66, 241, 0, 0, 0, 0, 153, 153, 83, 83, 83, 83, 26, 26 },// English/Latin/Turks And Caicos Islands
{ 75, 66, 242, 0, 0, 0, 0, 153, 153, 83, 83, 83, 83, 26, 26 },// English/Latin/Tuvalu
{ 75, 66, 243, 0, 0, 0, 0, 153, 153, 83, 83, 83, 83, 26, 26 },// English/Latin/Uganda
{ 75, 66, 245, 0, 0, 0, 0, 153, 153, 83, 83, 83, 83, 26, 26 },// English/Latin/United Arab Emirates
{ 75, 66, 246, 0, 0, 0, 0, 153, 153, 83, 83, 83, 83, 26, 26 },// English/Latin/United Kingdom
{ 75, 66, 247, 0, 0, 0, 0, 153, 153, 83, 83, 83, 83, 26, 26 },// English/Latin/United States Outlying Islands
{ 75, 66, 249, 0, 0, 0, 0, 153, 153, 83, 83, 83, 83, 26, 26 },// English/Latin/United States Virgin Islands
{ 75, 66, 252, 0, 0, 0, 0, 153, 153, 83, 83, 83, 83, 26, 26 },// English/Latin/Vanuatu
{ 75, 66, 258, 0, 0, 0, 0, 153, 153, 83, 83, 83, 83, 26, 26 },// English/Latin/World
{ 75, 66, 260, 0, 0, 0, 0, 153, 153, 83, 83, 83, 83, 26, 26 },// English/Latin/Zambia
{ 75, 66, 261, 0, 0, 0, 0, 153, 153, 83, 83, 83, 83, 26, 26 },// English/Latin/Zimbabwe
{ 75, 115, 246, 0, 0, 0, 0, 153, 153, 83, 83, 83, 83, 26, 26 },// English/Shavian/United Kingdom
{ 76, 27, 193, 0, 0, 0, 0, 153, 153, 83, 83, 83, 83, 26, 26 },// Erzya/Cyrillic/Russia
{ 77, 66, 258, 0, 0, 0, 0, 153, 153, 83, 83, 83, 83, 26, 26 },// Esperanto/Latin/World
{ 78, 66, 75, 0, 0, 0, 0, 153, 153, 83, 83, 83, 83, 26, 26 },// Estonian/Latin/Estonia
{ 79, 66, 92, 1085, 1085, 1171, 1171, 153, 153, 86, 86, 47, 47, 26, 26 },// Ewe/Latin/Ghana
{ 79, 66, 233, 1085, 1085, 1171, 1171, 153, 153, 86, 86, 47, 47, 26, 26 },// Ewe/Latin/Togo
{ 80, 66, 40, 0, 0, 0, 0, 153, 153, 83, 83, 83, 83, 26, 26 },// Ewondo/Latin/Cameroon
{ 81, 66, 81, 0, 0, 0, 0, 153, 153, 83, 83, 83, 83, 26, 26 },// Faroese/Latin/Faroe Islands
{ 81, 66, 65, 0, 0, 0, 0, 153, 153, 83, 83, 83, 83, 26, 26 },// Faroese/Latin/Denmark
{ 83, 66, 185, 0, 0, 0, 0, 153, 153, 83, 83, 83, 83, 26, 26 },// Filipino/Latin/Philippines
{ 84, 66, 83, 1218, 1335, 1476, 1335, 153, 153,117,141, 81,141, 26, 26 },// Finnish/Latin/Finland
{ 85, 66, 84, 1557, 1557, 1638, 1638, 153, 153, 81, 81, 57, 57, 26, 26 },// French/Latin/France
{ 85, 66, 4, 1557, 1557, 1638, 1638, 153, 153, 81, 81, 57, 57, 26, 26 },// French/Latin/Algeria
{ 85, 66, 23, 1557, 1557, 1638, 1638, 153, 153, 81, 81, 57, 57, 26, 26 },// French/Latin/Belgium
{ 85, 66, 25, 1557, 1557, 1638, 1638, 153, 153, 81, 81, 57, 57, 26, 26 },// French/Latin/Benin
{ 85, 66, 37, 1557, 1557, 1638, 1638, 153, 153, 81, 81, 57, 57, 26, 26 },// French/Latin/Burkina Faso
{ 85, 66, 38, 1557, 1557, 1638, 1638, 153, 153, 81, 81, 57, 57, 26, 26 },// French/Latin/Burundi
{ 85, 66, 40, 1557, 1557, 1638, 1638, 153, 153, 81, 81, 57, 57, 26, 26 },// French/Latin/Cameroon
{ 85, 66, 41, 1695, 1695, 1776, 1776, 153, 153, 81, 81, 57, 57, 26, 26 },// French/Latin/Canada
{ 85, 66, 46, 1557, 1557, 1638, 1638, 153, 153, 81, 81, 57, 57, 26, 26 },// French/Latin/Central African Republic
{ 85, 66, 48, 1557, 1557, 1638, 1638, 153, 153, 81, 81, 57, 57, 26, 26 },// French/Latin/Chad
{ 85, 66, 55, 1557, 1557, 1638, 1638, 153, 153, 81, 81, 57, 57, 26, 26 },// French/Latin/Comoros
{ 85, 66, 56, 1557, 1557, 1638, 1638, 153, 153, 81, 81, 57, 57, 26, 26 },// French/Latin/Congo Brazzaville
{ 85, 66, 57, 1557, 1557, 1638, 1638, 153, 153, 81, 81, 57, 57, 26, 26 },// French/Latin/Congo Kinshasa
{ 85, 66, 67, 1557, 1557, 1638, 1638, 153, 153, 81, 81, 57, 57, 26, 26 },// French/Latin/Djibouti
{ 85, 66, 73, 1557, 1557, 1638, 1638, 153, 153, 81, 81, 57, 57, 26, 26 },// French/Latin/Equatorial Guinea
{ 85, 66, 85, 1557, 1557, 1638, 1638, 153, 153, 81, 81, 57, 57, 26, 26 },// French/Latin/French Guiana
{ 85, 66, 86, 1557, 1557, 1638, 1638, 153, 153, 81, 81, 57, 57, 26, 26 },// French/Latin/French Polynesia
{ 85, 66, 88, 1557, 1557, 1638, 1638, 153, 153, 81, 81, 57, 57, 26, 26 },// French/Latin/Gabon
{ 85, 66, 97, 1557, 1557, 1638, 1638, 153, 153, 81, 81, 57, 57, 26, 26 },// French/Latin/Guadeloupe
{ 85, 66, 102, 1557, 1557, 1638, 1638, 153, 153, 81, 81, 57, 57, 26, 26 },// French/Latin/Guinea
{ 85, 66, 104, 1557, 1557, 1638, 1638, 153, 153, 81, 81, 57, 57, 26, 26 },// French/Latin/Haiti
{ 85, 66, 118, 1557, 1557, 1638, 1638, 153, 153, 81, 81, 57, 57, 26, 26 },// French/Latin/Ivory Coast
{ 85, 66, 138, 1557, 1557, 1638, 1638, 153, 153, 81, 81, 57, 57, 26, 26 },// French/Latin/Luxembourg
{ 85, 66, 141, 1557, 1557, 1638, 1638, 153, 153, 81, 81, 57, 57, 26, 26 },// French/Latin/Madagascar
{ 85, 66, 145, 1557, 1557, 1638, 1638, 153, 153, 81, 81, 57, 57, 26, 26 },// French/Latin/Mali
{ 85, 66, 148, 1557, 1557, 1638, 1638, 153, 153, 81, 81, 57, 57, 26, 26 },// French/Latin/Martinique
{ 85, 66, 149, 1557, 1557, 1638, 1638, 153, 153, 81, 81, 57, 57, 26, 26 },// French/Latin/Mauritania
{ 85, 66, 150, 1557, 1557, 1638, 1638, 153, 153, 81, 81, 57, 57, 26, 26 },// French/Latin/Mauritius
{ 85, 66, 151, 1557, 1557, 1638, 1638, 153, 153, 81, 81, 57, 57, 26, 26 },// French/Latin/Mayotte
{ 85, 66, 155, 1557, 1557, 1638, 1638, 153, 153, 81, 81, 57, 57, 26, 26 },// French/Latin/Monaco
{ 85, 66, 159, 1557, 1557, 1638, 1638, 153, 153, 81, 81, 57, 57, 26, 26 },// French/Latin/Morocco
{ 85, 66, 166, 1557, 1557, 1638, 1638, 153, 153, 81, 81, 57, 57, 26, 26 },// French/Latin/New Caledonia
{ 85, 66, 170, 1557, 1557, 1638, 1638, 153, 153, 81, 81, 57, 57, 26, 26 },// French/Latin/Niger
{ 85, 66, 191, 1557, 1557, 1638, 1638, 153, 153, 81, 81, 57, 57, 26, 26 },// French/Latin/Reunion
{ 85, 66, 194, 1557, 1557, 1638, 1638, 153, 153, 81, 81, 57, 57, 26, 26 },// French/Latin/Rwanda
{ 85, 66, 195, 1557, 1557, 1638, 1638, 153, 153, 81, 81, 57, 57, 26, 26 },// French/Latin/Saint Barthelemy
{ 85, 66, 199, 1557, 1557, 1638, 1638, 153, 153, 81, 81, 57, 57, 26, 26 },// French/Latin/Saint Martin
{ 85, 66, 200, 1557, 1557, 1638, 1638, 153, 153, 81, 81, 57, 57, 26, 26 },// French/Latin/Saint Pierre And Miquelon
{ 85, 66, 206, 1557, 1557, 1638, 1638, 153, 153, 81, 81, 57, 57, 26, 26 },// French/Latin/Senegal
{ 85, 66, 208, 1557, 1557, 1638, 1638, 153, 153, 81, 81, 57, 57, 26, 26 },// French/Latin/Seychelles
{ 85, 66, 226, 1557, 1557, 1638, 1638, 153, 153, 81, 81, 57, 57, 26, 26 },// French/Latin/Switzerland
{ 85, 66, 227, 1557, 1557, 1638, 1638, 153, 153, 81, 81, 57, 57, 26, 26 },// French/Latin/Syria
{ 85, 66, 233, 1557, 1557, 1638, 1638, 153, 153, 81, 81, 57, 57, 26, 26 },// French/Latin/Togo
{ 85, 66, 238, 1557, 1557, 1638, 1638, 153, 153, 81, 81, 57, 57, 26, 26 },// French/Latin/Tunisia
{ 85, 66, 252, 1557, 1557, 1638, 1638, 153, 153, 81, 81, 57, 57, 26, 26 },// French/Latin/Vanuatu
{ 85, 66, 256, 1557, 1557, 1638, 1638, 153, 153, 81, 81, 57, 57, 26, 26 },// French/Latin/Wallis And Futuna
{ 86, 66, 117, 0, 0, 0, 0, 153, 153, 83, 83, 83, 83, 26, 26 },// Friulian/Latin/Italy
{ 87, 66, 206, 0, 0, 0, 0, 153, 153, 83, 83, 83, 83, 26, 26 },// Fulah/Latin/Senegal
{ 87, 1, 37, 1833, 1833, 1833, 1833, 1984, 1984,151,151,151,151, 41, 41 },// Fulah/Adlam/Burkina Faso
{ 87, 1, 40, 1833, 1833, 1833, 1833, 1984, 1984,151,151,151,151, 41, 41 },// Fulah/Adlam/Cameroon
{ 87, 1, 89, 1833, 1833, 1833, 1833, 1984, 1984,151,151,151,151, 41, 41 },// Fulah/Adlam/Gambia
{ 87, 1, 92, 1833, 1833, 1833, 1833, 1984, 1984,151,151,151,151, 41, 41 },// Fulah/Adlam/Ghana
{ 87, 1, 101, 1833, 1833, 1833, 1833, 1984, 1984,151,151,151,151, 41, 41 },// Fulah/Adlam/Guinea Bissau
{ 87, 1, 102, 1833, 1833, 1833, 1833, 1984, 1984,151,151,151,151, 41, 41 },// Fulah/Adlam/Guinea
{ 87, 1, 134, 1833, 1833, 1833, 1833, 1984, 1984,151,151,151,151, 41, 41 },// Fulah/Adlam/Liberia
{ 87, 1, 149, 1833, 1833, 1833, 1833, 1984, 1984,151,151,151,151, 41, 41 },// Fulah/Adlam/Mauritania
{ 87, 1, 169, 1833, 1833, 1833, 1833, 1984, 1984,151,151,151,151, 41, 41 },// Fulah/Adlam/Nigeria
{ 87, 1, 170, 1833, 1833, 1833, 1833, 1984, 1984,151,151,151,151, 41, 41 },// Fulah/Adlam/Niger
{ 87, 1, 206, 1833, 1833, 1833, 1833, 1984, 1984,151,151,151,151, 41, 41 },// Fulah/Adlam/Senegal
{ 87, 1, 209, 1833, 1833, 1833, 1833, 1984, 1984,151,151,151,151, 41, 41 },// Fulah/Adlam/Sierra Leone
{ 87, 66, 37, 0, 0, 0, 0, 153, 153, 83, 83, 83, 83, 26, 26 },// Fulah/Latin/Burkina Faso
{ 87, 66, 40, 0, 0, 0, 0, 153, 153, 83, 83, 83, 83, 26, 26 },// Fulah/Latin/Cameroon
{ 87, 66, 89, 0, 0, 0, 0, 153, 153, 83, 83, 83, 83, 26, 26 },// Fulah/Latin/Gambia
{ 87, 66, 92, 0, 0, 0, 0, 153, 153, 83, 83, 83, 83, 26, 26 },// Fulah/Latin/Ghana
{ 87, 66, 101, 0, 0, 0, 0, 153, 153, 83, 83, 83, 83, 26, 26 },// Fulah/Latin/Guinea Bissau
{ 87, 66, 102, 0, 0, 0, 0, 153, 153, 83, 83, 83, 83, 26, 26 },// Fulah/Latin/Guinea
{ 87, 66, 134, 0, 0, 0, 0, 153, 153, 83, 83, 83, 83, 26, 26 },// Fulah/Latin/Liberia
{ 87, 66, 149, 0, 0, 0, 0, 153, 153, 83, 83, 83, 83, 26, 26 },// Fulah/Latin/Mauritania
{ 87, 66, 169, 0, 0, 0, 0, 153, 153, 83, 83, 83, 83, 26, 26 },// Fulah/Latin/Nigeria
{ 87, 66, 170, 0, 0, 0, 0, 153, 153, 83, 83, 83, 83, 26, 26 },// Fulah/Latin/Niger
{ 87, 66, 209, 0, 0, 0, 0, 153, 153, 83, 83, 83, 83, 26, 26 },// Fulah/Latin/Sierra Leone
{ 88, 66, 246, 0, 0, 0, 0, 153, 153, 83, 83, 83, 83, 26, 26 },// Gaelic/Latin/United Kingdom
{ 89, 66, 92, 0, 0, 0, 0, 153, 153, 83, 83, 83, 83, 26, 26 },// Ga/Latin/Ghana
{ 90, 66, 220, 0, 0, 0, 0, 153, 153, 83, 83, 83, 83, 26, 26 },// Galician/Latin/Spain
{ 91, 66, 243, 0, 0, 0, 0, 153, 153, 83, 83, 83, 83, 26, 26 },// Ganda/Latin/Uganda
{ 92, 33, 77, 0, 0, 0, 0, 153, 153, 83, 83, 83, 83, 26, 26 },// Geez/Ethiopic/Ethiopia
{ 92, 33, 74, 0, 0, 0, 0, 153, 153, 83, 83, 83, 83, 26, 26 },// Geez/Ethiopic/Eritrea
{ 93, 35, 90, 2025, 2025, 2025, 2025, 153, 153, 91, 91, 91, 91, 26, 26 },// Georgian/Georgian/Georgia
{ 94, 66, 91, 2116, 2116, 2116, 2116, 153, 153, 86, 86, 86, 86, 26, 26 },// German/Latin/Germany
{ 94, 66, 16, 2116, 2116, 2116, 2116, 153, 153, 86, 86, 86, 86, 26, 26 },// German/Latin/Austria
{ 94, 66, 23, 2116, 2116, 2116, 2116, 153, 153, 86, 86, 86, 86, 26, 26 },// German/Latin/Belgium
{ 94, 66, 117, 2116, 2116, 2116, 2116, 153, 153, 86, 86, 86, 86, 26, 26 },// German/Latin/Italy
{ 94, 66, 136, 2116, 2116, 2116, 2116, 153, 153, 86, 86, 86, 86, 26, 26 },// German/Latin/Liechtenstein
{ 94, 66, 138, 2116, 2116, 2116, 2116, 153, 153, 86, 86, 86, 86, 26, 26 },// German/Latin/Luxembourg
{ 94, 66, 226, 2116, 2116, 2116, 2116, 153, 153, 86, 86, 86, 86, 26, 26 },// German/Latin/Switzerland
{ 96, 39, 94, 0, 0, 0, 0, 153, 153, 83, 83, 83, 83, 26, 26 },// Greek/Greek/Greece
{ 96, 39, 63, 0, 0, 0, 0, 153, 153, 83, 83, 83, 83, 26, 26 },// Greek/Greek/Cyprus
{ 97, 66, 183, 0, 0, 0, 0, 153, 153, 83, 83, 83, 83, 26, 26 },// Guarani/Latin/Paraguay
{ 98, 40, 110, 2202, 2202, 2202, 2202, 153, 153, 85, 85, 85, 85, 26, 26 },// Gujarati/Gujarati/India
{ 99, 66, 124, 0, 0, 0, 0, 153, 153, 83, 83, 83, 83, 26, 26 },// Gusii/Latin/Kenya
{ 101, 66, 169, 0, 0, 0, 0, 153, 153, 83, 83, 83, 83, 26, 26 },// Hausa/Latin/Nigeria
{ 101, 4, 169, 0, 0, 0, 0, 153, 153, 83, 83, 83, 83, 26, 26 },// Hausa/Arabic/Nigeria
{ 101, 4, 222, 0, 0, 0, 0, 153, 153, 83, 83, 83, 83, 26, 26 },// Hausa/Arabic/Sudan
{ 101, 66, 92, 0, 0, 0, 0, 153, 153, 83, 83, 83, 83, 26, 26 },// Hausa/Latin/Ghana
{ 101, 66, 170, 0, 0, 0, 0, 153, 153, 83, 83, 83, 83, 26, 26 },// Hausa/Latin/Niger
{ 102, 66, 248, 0, 0, 0, 0, 153, 153, 83, 83, 83, 83, 26, 26 },// Hawaiian/Latin/United States
{ 103, 47, 116, 2287, 2287, 2287, 2287, 153, 153, 68, 68, 68, 68, 26, 26 },// Hebrew/Hebrew/Israel
{ 105, 29, 110, 2355, 2355, 2355, 2355, 153, 153, 81, 81, 81, 81, 26, 26 },// Hindi/Devanagari/India
{ 105, 66, 110, 0, 0, 0, 0, 153, 153, 83, 83, 83, 83, 26, 26 },// Hindi/Latin/India
{ 107, 66, 108, 1002, 1002, 1002, 1002, 153, 153, 83, 83, 83, 83, 26, 26 },// Hungarian/Latin/Hungary
{ 108, 66, 109, 1002, 1002, 1002, 1002, 153, 153, 83, 83, 83, 83, 26, 26 },// Icelandic/Latin/Iceland
{ 109, 66, 258, 0, 0, 0, 0, 153, 153, 83, 83, 83, 83, 26, 26 },// Ido/Latin/World
{ 110, 66, 169, 0, 0, 0, 0, 153, 153, 83, 83, 83, 83, 26, 26 },// Igbo/Latin/Nigeria
{ 111, 66, 83, 0, 0, 0, 0, 153, 153, 83, 83, 83, 83, 26, 26 },// Inari Sami/Latin/Finland
{ 112, 66, 111, 0, 0, 0, 0, 153, 153, 83, 83, 83, 83, 26, 26 },// Indonesian/Latin/Indonesia
{ 114, 66, 258, 0, 0, 0, 0, 153, 153, 83, 83, 83, 83, 26, 26 },// Interlingua/Latin/World
{ 116, 18, 41, 0, 0, 0, 0, 153, 153, 83, 83, 83, 83, 26, 26 },// Inuktitut/Canadian Aboriginal/Canada
{ 116, 66, 41, 0, 0, 0, 0, 153, 153, 83, 83, 83, 83, 26, 26 },// Inuktitut/Latin/Canada
{ 118, 66, 114, 0, 0, 0, 0, 153, 153, 83, 83, 83, 83, 26, 26 },// Irish/Latin/Ireland
{ 118, 66, 246, 0, 0, 0, 0, 153, 153, 83, 83, 83, 83, 26, 26 },// Irish/Latin/United Kingdom
{ 119, 66, 117, 0, 0, 0, 0, 153, 153, 83, 83, 83, 83, 26, 26 },// Italian/Latin/Italy
{ 119, 66, 203, 0, 0, 0, 0, 153, 153, 83, 83, 83, 83, 26, 26 },// Italian/Latin/San Marino
{ 119, 66, 226, 0, 0, 0, 0, 153, 153, 83, 83, 83, 83, 26, 26 },// Italian/Latin/Switzerland
{ 119, 66, 253, 0, 0, 0, 0, 153, 153, 83, 83, 83, 83, 26, 26 },// Italian/Latin/Vatican City
{ 120, 53, 120, 2436, 2436, 2436, 2436, 153, 153, 77, 77, 77, 77, 26, 26 },// Japanese/Japanese/Japan
{ 121, 66, 111, 0, 0, 0, 0, 153, 153, 83, 83, 83, 83, 26, 26 },// Javanese/Latin/Indonesia
{ 122, 66, 169, 0, 0, 0, 0, 153, 153, 83, 83, 83, 83, 26, 26 },// Jju/Latin/Nigeria
{ 123, 66, 206, 0, 0, 0, 0, 153, 153, 83, 83, 83, 83, 26, 26 },// Jola Fonyi/Latin/Senegal
{ 124, 66, 43, 0, 0, 0, 0, 153, 153, 83, 83, 83, 83, 26, 26 },// Kabuverdianu/Latin/Cape Verde
{ 125, 66, 4, 0, 0, 0, 0, 153, 153, 83, 83, 83, 83, 26, 26 },// Kabyle/Latin/Algeria
{ 126, 66, 40, 0, 0, 0, 0, 153, 153, 83, 83, 83, 83, 26, 26 },// Kako/Latin/Cameroon
{ 127, 66, 95, 0, 0, 0, 0, 153, 153, 83, 83, 83, 83, 26, 26 },// Kalaallisut/Latin/Greenland
{ 128, 66, 124, 0, 0, 0, 0, 153, 153, 83, 83, 83, 83, 26, 26 },// Kalenjin/Latin/Kenya
{ 129, 66, 124, 0, 0, 0, 0, 153, 153, 83, 83, 83, 83, 26, 26 },// Kamba/Latin/Kenya
{ 130, 56, 110, 2513, 2513, 2513, 2513, 153, 153, 92, 92, 92, 92, 26, 26 },// Kannada/Kannada/India
{ 132, 4, 110, 0, 0, 0, 0, 153, 153, 83, 83, 83, 83, 26, 26 },// Kashmiri/Arabic/India
{ 132, 29, 110, 0, 0, 0, 0, 153, 153, 83, 83, 83, 83, 26, 26 },// Kashmiri/Devanagari/India
{ 133, 27, 123, 2605, 2605, 2605, 2605, 153, 153, 80, 80, 80, 80, 26, 26 },// Kazakh/Cyrillic/Kazakhstan
{ 134, 66, 40, 0, 0, 0, 0, 153, 153, 83, 83, 83, 83, 26, 26 },// Kenyang/Latin/Cameroon
{ 135, 60, 39, 0, 0, 0, 0, 153, 153, 83, 83, 83, 83, 26, 26 },// Khmer/Khmer/Cambodia
{ 136, 66, 99, 0, 0, 0, 0, 153, 153, 83, 83, 83, 83, 26, 26 },// Kiche/Latin/Guatemala
{ 137, 66, 124, 0, 0, 0, 0, 153, 153, 83, 83, 83, 83, 26, 26 },// Kikuyu/Latin/Kenya
{ 138, 66, 194, 0, 0, 0, 0, 153, 153, 83, 83, 83, 83, 26, 26 },// Kinyarwanda/Latin/Rwanda
{ 141, 29, 110, 0, 0, 0, 0, 153, 153, 83, 83, 83, 83, 26, 26 },// Konkani/Devanagari/India
{ 142, 63, 218, 2685, 2685, 2685, 2685, 153, 153, 54, 54, 54, 54, 26, 26 },// Korean/Korean/South Korea
{ 142, 63, 174, 2685, 2685, 2685, 2685, 153, 153, 54, 54, 54, 54, 26, 26 },// Korean/Korean/North Korea
{ 144, 66, 145, 0, 0, 0, 0, 153, 153, 83, 83, 83, 83, 26, 26 },// Koyraboro Senni/Latin/Mali
{ 145, 66, 145, 0, 0, 0, 0, 153, 153, 83, 83, 83, 83, 26, 26 },// Koyra Chiini/Latin/Mali
{ 146, 66, 134, 0, 0, 0, 0, 153, 153, 83, 83, 83, 83, 26, 26 },// Kpelle/Latin/Liberia
{ 146, 66, 102, 0, 0, 0, 0, 153, 153, 83, 83, 83, 83, 26, 26 },// Kpelle/Latin/Guinea
{ 148, 66, 239, 0, 0, 0, 0, 153, 153, 83, 83, 83, 83, 26, 26 },// Kurdish/Latin/Turkey
{ 149, 66, 40, 0, 0, 0, 0, 153, 153, 83, 83, 83, 83, 26, 26 },// Kwasio/Latin/Cameroon
{ 150, 27, 128, 0, 0, 0, 0, 153, 153, 83, 83, 83, 83, 26, 26 },// Kyrgyz/Cyrillic/Kyrgyzstan
{ 151, 66, 248, 0, 0, 0, 0, 153, 153, 83, 83, 83, 83, 26, 26 },// Lakota/Latin/United States
{ 152, 66, 230, 0, 0, 0, 0, 153, 153, 83, 83, 83, 83, 26, 26 },// Langi/Latin/Tanzania
{ 153, 65, 129, 2739, 2739, 2819, 2898, 153, 153, 80, 80, 79, 79, 26, 26 },// Lao/Lao/Laos
{ 154, 66, 253, 0, 0, 0, 0, 153, 153, 83, 83, 83, 83, 26, 26 },// Latin/Latin/Vatican City
{ 155, 66, 131, 2977, 2977, 2977, 2977, 153, 153, 92, 92, 92, 92, 26, 26 },// Latvian/Latin/Latvia
{ 158, 66, 57, 0, 0, 0, 0, 153, 153, 83, 83, 83, 83, 26, 26 },// Lingala/Latin/Congo Kinshasa
{ 158, 66, 7, 0, 0, 0, 0, 153, 153, 83, 83, 83, 83, 26, 26 },// Lingala/Latin/Angola
{ 158, 66, 46, 0, 0, 0, 0, 153, 153, 83, 83, 83, 83, 26, 26 },// Lingala/Latin/Central African Republic
{ 158, 66, 56, 0, 0, 0, 0, 153, 153, 83, 83, 83, 83, 26, 26 },// Lingala/Latin/Congo Brazzaville
{ 160, 66, 137, 0, 0, 0, 0, 153, 153, 83, 83, 83, 83, 26, 26 },// Lithuanian/Latin/Lithuania
{ 161, 66, 258, 0, 0, 0, 0, 153, 153, 83, 83, 83, 83, 26, 26 },// Lojban/Latin/World
{ 162, 66, 91, 0, 0, 0, 0, 153, 153, 83, 83, 83, 83, 26, 26 },// Lower Sorbian/Latin/Germany
{ 163, 66, 91, 0, 0, 0, 0, 153, 153, 83, 83, 83, 83, 26, 26 },// Low German/Latin/Germany
{ 163, 66, 165, 0, 0, 0, 0, 153, 153, 83, 83, 83, 83, 26, 26 },// Low German/Latin/Netherlands
{ 164, 66, 57, 0, 0, 0, 0, 153, 153, 83, 83, 83, 83, 26, 26 },// Luba Katanga/Latin/Congo Kinshasa
{ 165, 66, 225, 0, 0, 0, 0, 153, 153, 83, 83, 83, 83, 26, 26 },// Lule Sami/Latin/Sweden
{ 165, 66, 175, 0, 0, 0, 0, 153, 153, 83, 83, 83, 83, 26, 26 },// Lule Sami/Latin/Norway
{ 166, 66, 124, 0, 0, 0, 0, 153, 153, 83, 83, 83, 83, 26, 26 },// Luo/Latin/Kenya
{ 167, 66, 138, 0, 0, 0, 0, 153, 153, 83, 83, 83, 83, 26, 26 },// Luxembourgish/Latin/Luxembourg
{ 168, 66, 124, 0, 0, 0, 0, 153, 153, 83, 83, 83, 83, 26, 26 },// Luyia/Latin/Kenya
{ 169, 27, 140, 3069, 3069, 3069, 3069, 153, 153, 79, 79, 79, 79, 26, 26 },// Macedonian/Cyrillic/Macedonia
{ 170, 66, 230, 0, 0, 0, 0, 153, 153, 83, 83, 83, 83, 26, 26 },// Machame/Latin/Tanzania
{ 171, 29, 110, 0, 0, 0, 0, 153, 153, 83, 83, 83, 83, 26, 26 },// Maithili/Devanagari/India
{ 172, 66, 160, 0, 0, 0, 0, 153, 153, 83, 83, 83, 83, 26, 26 },// Makhuwa Meetto/Latin/Mozambique
{ 173, 66, 230, 0, 0, 0, 0, 153, 153, 83, 83, 83, 83, 26, 26 },// Makonde/Latin/Tanzania
{ 174, 66, 141, 0, 0, 0, 0, 153, 153, 83, 83, 83, 83, 26, 26 },// Malagasy/Latin/Madagascar
{ 175, 74, 110, 3148, 3148, 3148, 3148, 3239, 3239, 91, 91, 91, 91, 39, 39 },// Malayalam/Malayalam/India
{ 176, 66, 143, 0, 0, 0, 0, 153, 153, 83, 83, 83, 83, 26, 26 },// Malay/Latin/Malaysia
{ 176, 4, 35, 0, 0, 0, 0, 153, 153, 83, 83, 83, 83, 26, 26 },// Malay/Arabic/Brunei
{ 176, 4, 143, 0, 0, 0, 0, 153, 153, 83, 83, 83, 83, 26, 26 },// Malay/Arabic/Malaysia
{ 176, 66, 35, 0, 0, 0, 0, 153, 153, 83, 83, 83, 83, 26, 26 },// Malay/Latin/Brunei
{ 176, 66, 111, 0, 0, 0, 0, 153, 153, 83, 83, 83, 83, 26, 26 },// Malay/Latin/Indonesia
{ 176, 66, 210, 0, 0, 0, 0, 153, 153, 83, 83, 83, 83, 26, 26 },// Malay/Latin/Singapore
{ 177, 66, 146, 0, 0, 0, 0, 153, 153, 83, 83, 83, 83, 26, 26 },// Maltese/Latin/Malta
{ 179, 9, 110, 0, 0, 0, 0, 153, 153, 83, 83, 83, 83, 26, 26 },// Manipuri/Bangla/India
{ 179, 78, 110, 0, 0, 0, 0, 153, 153, 83, 83, 83, 83, 26, 26 },// Manipuri/Meitei Mayek/India
{ 180, 66, 115, 0, 0, 0, 0, 153, 153, 83, 83, 83, 83, 26, 26 },// Manx/Latin/Isle Of Man
{ 181, 66, 167, 0, 0, 0, 0, 153, 153, 83, 83, 83, 83, 26, 26 },// Maori/Latin/New Zealand
{ 182, 66, 49, 0, 0, 0, 0, 153, 153, 83, 83, 83, 83, 26, 26 },// Mapuche/Latin/Chile
{ 183, 29, 110, 3278, 3278, 3278, 3278, 3358, 3358, 80, 80, 80, 80, 26, 26 },// Marathi/Devanagari/India
{ 185, 66, 124, 0, 0, 0, 0, 153, 153, 83, 83, 83, 83, 26, 26 },// Masai/Latin/Kenya
{ 185, 66, 230, 0, 0, 0, 0, 153, 153, 83, 83, 83, 83, 26, 26 },// Masai/Latin/Tanzania
{ 186, 4, 112, 0, 0, 0, 0, 153, 153, 83, 83, 83, 83, 26, 26 },// Mazanderani/Arabic/Iran
{ 188, 66, 124, 0, 0, 0, 0, 153, 153, 83, 83, 83, 83, 26, 26 },// Meru/Latin/Kenya
{ 189, 66, 40, 0, 0, 0, 0, 153, 153, 83, 83, 83, 83, 26, 26 },// Meta/Latin/Cameroon
{ 190, 66, 41, 0, 0, 0, 0, 153, 153, 83, 83, 83, 83, 26, 26 },// Mohawk/Latin/Canada
{ 191, 27, 156, 0, 0, 0, 0, 153, 153, 83, 83, 83, 83, 26, 26 },// Mongolian/Cyrillic/Mongolia
{ 191, 83, 50, 0, 0, 0, 0, 153, 153, 83, 83, 83, 83, 26, 26 },// Mongolian/Mongolian/China
{ 191, 83, 156, 0, 0, 0, 0, 153, 153, 83, 83, 83, 83, 26, 26 },// Mongolian/Mongolian/Mongolia
{ 192, 66, 150, 0, 0, 0, 0, 153, 153, 83, 83, 83, 83, 26, 26 },// Morisyen/Latin/Mauritius
{ 193, 66, 40, 0, 0, 0, 0, 153, 153, 83, 83, 83, 83, 26, 26 },// Mundang/Latin/Cameroon
{ 194, 66, 248, 0, 0, 0, 0, 153, 153, 83, 83, 83, 83, 26, 26 },// Muscogee/Latin/United States
{ 195, 66, 162, 0, 0, 0, 0, 153, 153, 83, 83, 83, 83, 26, 26 },// Nama/Latin/Namibia
{ 197, 66, 248, 0, 0, 0, 0, 153, 153, 83, 83, 83, 83, 26, 26 },// Navajo/Latin/United States
{ 199, 29, 164, 0, 0, 0, 0, 153, 153, 83, 83, 83, 83, 26, 26 },// Nepali/Devanagari/Nepal
{ 199, 29, 110, 0, 0, 0, 0, 153, 153, 83, 83, 83, 83, 26, 26 },// Nepali/Devanagari/India
{ 201, 66, 40, 0, 0, 0, 0, 153, 153, 83, 83, 83, 83, 26, 26 },// Ngiemboon/Latin/Cameroon
{ 202, 66, 40, 0, 0, 0, 0, 153, 153, 83, 83, 83, 83, 26, 26 },// Ngomba/Latin/Cameroon
{ 203, 66, 169, 0, 0, 0, 0, 153, 153, 83, 83, 83, 83, 26, 26 },// Nigerian Pidgin/Latin/Nigeria
{ 204, 90, 102, 0, 0, 0, 0, 153, 153, 83, 83, 83, 83, 26, 26 },// Nko/Nko/Guinea
{ 205, 4, 112, 0, 0, 0, 0, 153, 153, 83, 83, 83, 83, 26, 26 },// Northern Luri/Arabic/Iran
{ 205, 4, 113, 0, 0, 0, 0, 153, 153, 83, 83, 83, 83, 26, 26 },// Northern Luri/Arabic/Iraq
{ 206, 66, 175, 0, 0, 0, 0, 153, 153, 83, 83, 83, 83, 26, 26 },// Northern Sami/Latin/Norway
{ 206, 66, 83, 0, 0, 0, 0, 153, 153, 83, 83, 83, 83, 26, 26 },// Northern Sami/Latin/Finland
{ 206, 66, 225, 0, 0, 0, 0, 153, 153, 83, 83, 83, 83, 26, 26 },// Northern Sami/Latin/Sweden
{ 207, 66, 216, 0, 0, 0, 0, 153, 153, 83, 83, 83, 83, 26, 26 },// Northern Sotho/Latin/South Africa
{ 208, 66, 261, 0, 0, 0, 0, 153, 153, 83, 83, 83, 83, 26, 26 },// North Ndebele/Latin/Zimbabwe
{ 209, 66, 175, 1002, 1002, 1002, 1002, 153, 153, 83, 83, 83, 83, 26, 26 },// Norwegian Bokmal/Latin/Norway
{ 209, 66, 224, 1002, 1002, 1002, 1002, 153, 153, 83, 83, 83, 83, 26, 26 },// Norwegian Bokmal/Latin/Svalbard And Jan Mayen
{ 210, 66, 175, 1002, 1002, 1002, 1002, 153, 153, 83, 83, 83, 83, 26, 26 },// Norwegian Nynorsk/Latin/Norway
{ 211, 66, 219, 0, 0, 0, 0, 153, 153, 83, 83, 83, 83, 26, 26 },// Nuer/Latin/South Sudan
{ 212, 66, 142, 0, 0, 0, 0, 153, 153, 83, 83, 83, 83, 26, 26 },// Nyanja/Latin/Malawi
{ 213, 66, 243, 0, 0, 0, 0, 153, 153, 83, 83, 83, 83, 26, 26 },// Nyankole/Latin/Uganda
{ 214, 66, 84, 0, 0, 0, 0, 153, 153, 83, 83, 83, 83, 26, 26 },// Occitan/Latin/France
{ 214, 66, 220, 0, 0, 0, 0, 153, 153, 83, 83, 83, 83, 26, 26 },// Occitan/Latin/Spain
{ 215, 91, 110, 0, 0, 0, 0, 153, 153, 83, 83, 83, 83, 26, 26 },// Odia/Odia/India
{ 220, 66, 77, 0, 0, 0, 0, 153, 153, 83, 83, 83, 83, 26, 26 },// Oromo/Latin/Ethiopia
{ 220, 66, 124, 0, 0, 0, 0, 153, 153, 83, 83, 83, 83, 26, 26 },// Oromo/Latin/Kenya
{ 221, 101, 248, 0, 0, 0, 0, 153, 153, 83, 83, 83, 83, 26, 26 },// Osage/Osage/United States
{ 222, 27, 90, 0, 0, 0, 0, 153, 153, 83, 83, 83, 83, 26, 26 },// Ossetic/Cyrillic/Georgia
{ 222, 27, 193, 0, 0, 0, 0, 153, 153, 83, 83, 83, 83, 26, 26 },// Ossetic/Cyrillic/Russia
{ 226, 66, 62, 0, 0, 0, 0, 153, 153, 83, 83, 83, 83, 26, 26 },// Papiamento/Latin/Curacao
{ 226, 66, 13, 0, 0, 0, 0, 153, 153, 83, 83, 83, 83, 26, 26 },// Papiamento/Latin/Aruba
{ 227, 4, 1, 3384, 3384, 3384, 3384, 3446, 3446, 62, 62, 62, 62, 26, 26 },// Pashto/Arabic/Afghanistan
{ 227, 4, 178, 3384, 3384, 3384, 3384, 3446, 3446, 62, 62, 62, 62, 26, 26 },// Pashto/Arabic/Pakistan
{ 228, 4, 112, 3472, 3472, 3472, 3472, 3538, 3538, 66, 66, 66, 66, 23, 23 },// Persian/Arabic/Iran
{ 228, 4, 1, 3472, 3561, 3472, 3472, 3617, 3538, 66, 56, 66, 66, 23, 23 },// Persian/Arabic/Afghanistan
{ 230, 66, 187, 3640, 3640, 3640, 3640, 153, 153, 83, 83, 83, 83, 26, 26 },// Polish/Latin/Poland
{ 231, 66, 32, 0, 0, 0, 0, 153, 153, 83, 83, 83, 83, 26, 26 },// Portuguese/Latin/Brazil
{ 231, 66, 7, 0, 0, 0, 0, 153, 153, 83, 83, 83, 83, 26, 26 },// Portuguese/Latin/Angola
{ 231, 66, 43, 0, 0, 0, 0, 153, 153, 83, 83, 83, 83, 26, 26 },// Portuguese/Latin/Cape Verde
{ 231, 66, 73, 0, 0, 0, 0, 153, 153, 83, 83, 83, 83, 26, 26 },// Portuguese/Latin/Equatorial Guinea
{ 231, 66, 101, 0, 0, 0, 0, 153, 153, 83, 83, 83, 83, 26, 26 },// Portuguese/Latin/Guinea Bissau
{ 231, 66, 138, 0, 0, 0, 0, 153, 153, 83, 83, 83, 83, 26, 26 },// Portuguese/Latin/Luxembourg
{ 231, 66, 139, 0, 0, 0, 0, 153, 153, 83, 83, 83, 83, 26, 26 },// Portuguese/Latin/Macao
{ 231, 66, 160, 0, 0, 0, 0, 153, 153, 83, 83, 83, 83, 26, 26 },// Portuguese/Latin/Mozambique
{ 231, 66, 188, 0, 0, 0, 0, 153, 153, 83, 83, 83, 83, 26, 26 },// Portuguese/Latin/Portugal
{ 231, 66, 204, 0, 0, 0, 0, 153, 153, 83, 83, 83, 83, 26, 26 },// Portuguese/Latin/Sao Tome And Principe
{ 231, 66, 226, 0, 0, 0, 0, 153, 153, 83, 83, 83, 83, 26, 26 },// Portuguese/Latin/Switzerland
{ 231, 66, 232, 0, 0, 0, 0, 153, 153, 83, 83, 83, 83, 26, 26 },// Portuguese/Latin/Timor-Leste
{ 232, 66, 258, 0, 0, 0, 0, 153, 153, 83, 83, 83, 83, 26, 26 },// Prussian/Latin/World
{ 233, 41, 110, 3723, 3723, 3723, 3723, 153, 153, 77, 77, 77, 77, 26, 26 },// Punjabi/Gurmukhi/India
{ 233, 4, 178, 0, 0, 0, 0, 153, 153, 83, 83, 83, 83, 26, 26 },// Punjabi/Arabic/Pakistan
{ 234, 66, 184, 0, 0, 0, 0, 153, 153, 83, 83, 83, 83, 26, 26 },// Quechua/Latin/Peru
{ 234, 66, 28, 0, 0, 0, 0, 153, 153, 83, 83, 83, 83, 26, 26 },// Quechua/Latin/Bolivia
{ 234, 66, 70, 0, 0, 0, 0, 153, 153, 83, 83, 83, 83, 26, 26 },// Quechua/Latin/Ecuador
{ 235, 66, 192, 3800, 3800, 3800, 3800, 153, 153, 85, 85, 85, 85, 26, 26 },// Romanian/Latin/Romania
{ 235, 66, 154, 3800, 3800, 3800, 3800, 153, 153, 85, 85, 85, 85, 26, 26 },// Romanian/Latin/Moldova
{ 236, 66, 226, 0, 0, 0, 0, 153, 153, 83, 83, 83, 83, 26, 26 },// Romansh/Latin/Switzerland
{ 237, 66, 230, 0, 0, 0, 0, 153, 153, 83, 83, 83, 83, 26, 26 },// Rombo/Latin/Tanzania
{ 238, 66, 38, 0, 0, 0, 0, 153, 153, 83, 83, 83, 83, 26, 26 },// Rundi/Latin/Burundi
{ 239, 27, 193, 3885, 3885, 3885, 3885, 153, 153, 80, 80, 80, 80, 26, 26 },// Russian/Cyrillic/Russia
{ 239, 27, 22, 3885, 3885, 3885, 3885, 153, 153, 80, 80, 80, 80, 26, 26 },// Russian/Cyrillic/Belarus
{ 239, 27, 123, 3885, 3885, 3885, 3885, 153, 153, 80, 80, 80, 80, 26, 26 },// Russian/Cyrillic/Kazakhstan
{ 239, 27, 128, 3885, 3885, 3885, 3885, 153, 153, 80, 80, 80, 80, 26, 26 },// Russian/Cyrillic/Kyrgyzstan
{ 239, 27, 154, 3885, 3885, 3885, 3885, 153, 153, 80, 80, 80, 80, 26, 26 },// Russian/Cyrillic/Moldova
{ 239, 27, 244, 3885, 3885, 3885, 3885, 153, 153, 80, 80, 80, 80, 26, 26 },// Russian/Cyrillic/Ukraine
{ 240, 66, 230, 0, 0, 0, 0, 153, 153, 83, 83, 83, 83, 26, 26 },// Rwa/Latin/Tanzania
{ 241, 66, 74, 0, 0, 0, 0, 153, 153, 83, 83, 83, 83, 26, 26 },// Saho/Latin/Eritrea
{ 242, 27, 193, 0, 0, 0, 0, 153, 153, 83, 83, 83, 83, 26, 26 },// Sakha/Cyrillic/Russia
{ 243, 66, 124, 0, 0, 0, 0, 153, 153, 83, 83, 83, 83, 26, 26 },// Samburu/Latin/Kenya
{ 245, 66, 46, 0, 0, 0, 0, 153, 153, 83, 83, 83, 83, 26, 26 },// Sango/Latin/Central African Republic
{ 246, 66, 230, 0, 0, 0, 0, 153, 153, 83, 83, 83, 83, 26, 26 },// Sangu/Latin/Tanzania
{ 247, 29, 110, 0, 0, 0, 0, 153, 153, 83, 83, 83, 83, 26, 26 },// Sanskrit/Devanagari/India
{ 248, 93, 110, 0, 0, 0, 0, 153, 153, 83, 83, 83, 83, 26, 26 },// Santali/Ol Chiki/India
{ 248, 29, 110, 0, 0, 0, 0, 153, 153, 83, 83, 83, 83, 26, 26 },// Santali/Devanagari/India
{ 249, 66, 117, 1002, 1002, 3965, 3965, 153, 153, 83, 83, 57, 57, 26, 26 },// Sardinian/Latin/Italy
{ 251, 66, 160, 0, 0, 0, 0, 153, 153, 83, 83, 83, 83, 26, 26 },// Sena/Latin/Mozambique
{ 252, 27, 207, 527, 527, 527, 527, 153, 153, 80, 80, 80, 80, 26, 26 },// Serbian/Cyrillic/Serbia
{ 252, 27, 29, 527, 527, 527, 527, 153, 153, 80, 80, 80, 80, 26, 26 },// Serbian/Cyrillic/Bosnia And Herzegovina
{ 252, 27, 126, 527, 527, 527, 527, 153, 153, 80, 80, 80, 80, 26, 26 },// Serbian/Cyrillic/Kosovo
{ 252, 27, 157, 527, 527, 527, 527, 153, 153, 80, 80, 80, 80, 26, 26 },// Serbian/Cyrillic/Montenegro
{ 252, 66, 29, 4022, 4022, 4022, 4022, 153, 153, 80, 80, 80, 80, 26, 26 },// Serbian/Latin/Bosnia And Herzegovina
{ 252, 66, 126, 4022, 4022, 4022, 4022, 153, 153, 80, 80, 80, 80, 26, 26 },// Serbian/Latin/Kosovo
{ 252, 66, 157, 4022, 4022, 4022, 4022, 153, 153, 80, 80, 80, 80, 26, 26 },// Serbian/Latin/Montenegro
{ 252, 66, 207, 4022, 4022, 4022, 4022, 153, 153, 80, 80, 80, 80, 26, 26 },// Serbian/Latin/Serbia
{ 253, 66, 230, 0, 0, 0, 0, 153, 153, 83, 83, 83, 83, 26, 26 },// Shambala/Latin/Tanzania
{ 254, 66, 261, 0, 0, 0, 0, 153, 153, 83, 83, 83, 83, 26, 26 },// Shona/Latin/Zimbabwe
{ 255, 141, 50, 0, 0, 0, 0, 153, 153, 83, 83, 83, 83, 26, 26 },// Sichuan Yi/Yi/China
{ 256, 66, 117, 0, 0, 0, 0, 153, 153, 83, 83, 83, 83, 26, 26 },// Sicilian/Latin/Italy
{ 257, 66, 77, 0, 0, 0, 0, 153, 153, 83, 83, 83, 83, 26, 26 },// Sidamo/Latin/Ethiopia
{ 258, 66, 187, 0, 0, 0, 0, 153, 153, 83, 83, 83, 83, 26, 26 },// Silesian/Latin/Poland
{ 259, 4, 178, 0, 0, 0, 0, 153, 153, 83, 83, 83, 83, 26, 26 },// Sindhi/Arabic/Pakistan
{ 259, 29, 110, 0, 0, 0, 0, 153, 153, 83, 83, 83, 83, 26, 26 },// Sindhi/Devanagari/India
{ 260, 119, 221, 0, 0, 0, 0, 153, 153, 83, 83, 83, 83, 26, 26 },// Sinhala/Sinhala/Sri Lanka
{ 261, 66, 83, 0, 0, 0, 0, 153, 153, 83, 83, 83, 83, 26, 26 },// Skolt Sami/Latin/Finland
{ 262, 66, 212, 921, 921, 921, 921, 153, 153, 81, 81, 81, 81, 26, 26 },// Slovak/Latin/Slovakia
{ 263, 66, 213, 0, 0, 0, 0, 153, 153, 83, 83, 83, 83, 26, 26 },// Slovenian/Latin/Slovenia
{ 264, 66, 243, 0, 0, 0, 0, 153, 153, 83, 83, 83, 83, 26, 26 },// Soga/Latin/Uganda
{ 265, 66, 215, 4102, 4102, 4102, 4102, 153, 153, 99, 99, 99, 99, 26, 26 },// Somali/Latin/Somalia
{ 265, 66, 67, 4102, 4102, 4102, 4102, 153, 153, 99, 99, 99, 99, 26, 26 },// Somali/Latin/Djibouti
{ 265, 66, 77, 4102, 4102, 4102, 4102, 153, 153, 99, 99, 99, 99, 26, 26 },// Somali/Latin/Ethiopia
{ 265, 66, 124, 4102, 4102, 4102, 4102, 153, 153, 99, 99, 99, 99, 26, 26 },// Somali/Latin/Kenya
{ 266, 4, 112, 0, 0, 0, 0, 153, 153, 83, 83, 83, 83, 26, 26 },// Southern Kurdish/Arabic/Iran
{ 266, 4, 113, 0, 0, 0, 0, 153, 153, 83, 83, 83, 83, 26, 26 },// Southern Kurdish/Arabic/Iraq
{ 267, 66, 225, 0, 0, 0, 0, 153, 153, 83, 83, 83, 83, 26, 26 },// Southern Sami/Latin/Sweden
{ 267, 66, 175, 0, 0, 0, 0, 153, 153, 83, 83, 83, 83, 26, 26 },// Southern Sami/Latin/Norway
{ 268, 66, 216, 0, 0, 0, 0, 153, 153, 83, 83, 83, 83, 26, 26 },// Southern Sotho/Latin/South Africa
{ 268, 66, 133, 0, 0, 0, 0, 153, 153, 83, 83, 83, 83, 26, 26 },// Southern Sotho/Latin/Lesotho
{ 269, 66, 216, 0, 0, 0, 0, 153, 153, 83, 83, 83, 83, 26, 26 },// South Ndebele/Latin/South Africa
{ 270, 66, 220, 1002, 1002, 1002, 1002, 153, 153, 83, 83, 83, 83, 26, 26 },// Spanish/Latin/Spain
{ 270, 66, 11, 1002, 1002, 1002, 1002, 153, 153, 83, 83, 83, 83, 26, 26 },// Spanish/Latin/Argentina
{ 270, 66, 24, 1002, 1002, 1002, 1002, 153, 153, 83, 83, 83, 83, 26, 26 },// Spanish/Latin/Belize
{ 270, 66, 28, 1002, 1002, 1002, 1002, 153, 153, 83, 83, 83, 83, 26, 26 },// Spanish/Latin/Bolivia
{ 270, 66, 32, 1002, 1002, 1002, 1002, 153, 153, 83, 83, 83, 83, 26, 26 },// Spanish/Latin/Brazil
{ 270, 66, 42, 1002, 1002, 1002, 1002, 153, 153, 83, 83, 83, 83, 26, 26 },// Spanish/Latin/Canary Islands
{ 270, 66, 47, 1002, 1002, 1002, 1002, 153, 153, 83, 83, 83, 83, 26, 26 },// Spanish/Latin/Ceuta And Melilla
{ 270, 66, 49, 1002, 1002, 1002, 1002, 153, 153, 83, 83, 83, 83, 26, 26 },// Spanish/Latin/Chile
{ 270, 66, 54, 1002, 1002, 1002, 1002, 153, 153, 83, 83, 83, 83, 26, 26 },// Spanish/Latin/Colombia
{ 270, 66, 59, 1002, 1002, 1002, 1002, 153, 153, 83, 83, 83, 83, 26, 26 },// Spanish/Latin/Costa Rica
{ 270, 66, 61, 1002, 1002, 1002, 1002, 153, 153, 83, 83, 83, 83, 26, 26 },// Spanish/Latin/Cuba
{ 270, 66, 69, 1002, 1002, 1002, 1002, 153, 153, 83, 83, 83, 83, 26, 26 },// Spanish/Latin/Dominican Republic
{ 270, 66, 70, 1002, 1002, 1002, 1002, 153, 153, 83, 83, 83, 83, 26, 26 },// Spanish/Latin/Ecuador
{ 270, 66, 72, 1002, 1002, 1002, 1002, 153, 153, 83, 83, 83, 83, 26, 26 },// Spanish/Latin/El Salvador
{ 270, 66, 73, 1002, 1002, 1002, 1002, 153, 153, 83, 83, 83, 83, 26, 26 },// Spanish/Latin/Equatorial Guinea
{ 270, 66, 99, 1002, 1002, 1002, 1002, 153, 153, 83, 83, 83, 83, 26, 26 },// Spanish/Latin/Guatemala
{ 270, 66, 106, 1002, 1002, 1002, 1002, 153, 153, 83, 83, 83, 83, 26, 26 },// Spanish/Latin/Honduras
{ 270, 66, 130, 1002, 1002, 1002, 1002, 153, 153, 83, 83, 83, 83, 26, 26 },// Spanish/Latin/Latin America
{ 270, 66, 152, 1002, 1002, 1002, 1002, 153, 153, 83, 83, 83, 83, 26, 26 },// Spanish/Latin/Mexico
{ 270, 66, 168, 1002, 1002, 1002, 1002, 153, 153, 83, 83, 83, 83, 26, 26 },// Spanish/Latin/Nicaragua
{ 270, 66, 181, 1002, 1002, 1002, 1002, 153, 153, 83, 83, 83, 83, 26, 26 },// Spanish/Latin/Panama
{ 270, 66, 183, 1002, 1002, 1002, 1002, 153, 153, 83, 83, 83, 83, 26, 26 },// Spanish/Latin/Paraguay
{ 270, 66, 184, 1002, 1002, 1002, 1002, 153, 153, 83, 83, 83, 83, 26, 26 },// Spanish/Latin/Peru
{ 270, 66, 185, 1002, 1002, 1002, 1002, 153, 153, 83, 83, 83, 83, 26, 26 },// Spanish/Latin/Philippines
{ 270, 66, 189, 1002, 1002, 1002, 1002, 153, 153, 83, 83, 83, 83, 26, 26 },// Spanish/Latin/Puerto Rico
{ 270, 66, 248, 1002, 1002, 1002, 1002, 153, 153, 83, 83, 83, 83, 26, 26 },// Spanish/Latin/United States
{ 270, 66, 250, 1002, 1002, 1002, 1002, 153, 153, 83, 83, 83, 83, 26, 26 },// Spanish/Latin/Uruguay
{ 270, 66, 254, 1002, 1002, 1002, 1002, 153, 153, 83, 83, 83, 83, 26, 26 },// Spanish/Latin/Venezuela
{ 271, 135, 159, 0, 0, 0, 0, 153, 153, 83, 83, 83, 83, 26, 26 },// Standard Moroccan Tamazight/Tifinagh/Morocco
{ 272, 66, 111, 0, 0, 0, 0, 153, 153, 83, 83, 83, 83, 26, 26 },// Sundanese/Latin/Indonesia
{ 273, 66, 230, 0, 0, 0, 0, 153, 153, 83, 83, 83, 83, 26, 26 },// Swahili/Latin/Tanzania
{ 273, 66, 57, 0, 0, 0, 0, 153, 153, 83, 83, 83, 83, 26, 26 },// Swahili/Latin/Congo Kinshasa
{ 273, 66, 124, 0, 0, 0, 0, 153, 153, 83, 83, 83, 83, 26, 26 },// Swahili/Latin/Kenya
{ 273, 66, 243, 0, 0, 0, 0, 153, 153, 83, 83, 83, 83, 26, 26 },// Swahili/Latin/Uganda
{ 274, 66, 216, 0, 0, 0, 0, 153, 153, 83, 83, 83, 83, 26, 26 },// Swati/Latin/South Africa
{ 274, 66, 76, 0, 0, 0, 0, 153, 153, 83, 83, 83, 83, 26, 26 },// Swati/Latin/Eswatini
{ 275, 66, 225, 4201, 4284, 4201, 4284, 153, 153, 83, 83, 83, 83, 26, 26 },// Swedish/Latin/Sweden
{ 275, 66, 2, 4201, 4284, 4201, 4284, 153, 153, 83, 83, 83, 83, 26, 26 },// Swedish/Latin/Aland Islands
{ 275, 66, 83, 4201, 4284, 4201, 4284, 153, 153, 83, 83, 83, 83, 26, 26 },// Swedish/Latin/Finland
{ 276, 66, 226, 0, 0, 0, 0, 153, 153, 83, 83, 83, 83, 26, 26 },// Swiss German/Latin/Switzerland
{ 276, 66, 84, 0, 0, 0, 0, 153, 153, 83, 83, 83, 83, 26, 26 },// Swiss German/Latin/France
{ 276, 66, 136, 0, 0, 0, 0, 153, 153, 83, 83, 83, 83, 26, 26 },// Swiss German/Latin/Liechtenstein
{ 277, 123, 113, 0, 0, 0, 0, 153, 153, 83, 83, 83, 83, 26, 26 },// Syriac/Syriac/Iraq
{ 277, 123, 227, 0, 0, 0, 0, 153, 153, 83, 83, 83, 83, 26, 26 },// Syriac/Syriac/Syria
{ 278, 135, 159, 0, 0, 0, 0, 153, 153, 83, 83, 83, 83, 26, 26 },// Tachelhit/Tifinagh/Morocco
{ 278, 66, 159, 0, 0, 0, 0, 153, 153, 83, 83, 83, 83, 26, 26 },// Tachelhit/Latin/Morocco
{ 280, 127, 255, 0, 0, 0, 0, 153, 153, 83, 83, 83, 83, 26, 26 },// Tai Dam/Tai Viet/Vietnam
{ 281, 66, 124, 0, 0, 0, 0, 153, 153, 83, 83, 83, 83, 26, 26 },// Taita/Latin/Kenya
{ 282, 27, 229, 4367, 4367, 4367, 4367, 153, 153, 80, 80, 80, 80, 26, 26 },// Tajik/Cyrillic/Tajikistan
{ 283, 129, 110, 4447, 4447, 4540, 4540, 153, 153, 93, 93, 63, 63, 26, 26 },// Tamil/Tamil/India
{ 283, 129, 143, 4447, 4447, 4540, 4540, 153, 153, 93, 93, 63, 63, 26, 26 },// Tamil/Tamil/Malaysia
{ 283, 129, 210, 4447, 4447, 4540, 4540, 153, 153, 93, 93, 63, 63, 26, 26 },// Tamil/Tamil/Singapore
{ 283, 129, 221, 4447, 4447, 4540, 4540, 153, 153, 93, 93, 63, 63, 26, 26 },// Tamil/Tamil/Sri Lanka
{ 284, 66, 228, 0, 0, 0, 0, 153, 153, 83, 83, 83, 83, 26, 26 },// Taroko/Latin/Taiwan
{ 285, 66, 170, 0, 0, 0, 0, 153, 153, 83, 83, 83, 83, 26, 26 },// Tasawaq/Latin/Niger
{ 286, 27, 193, 0, 0, 0, 0, 153, 153, 83, 83, 83, 83, 26, 26 },// Tatar/Cyrillic/Russia
{ 287, 131, 110, 4603, 4603, 4603, 4603, 153, 153, 88, 88, 88, 88, 26, 26 },// Telugu/Telugu/India
{ 288, 66, 243, 0, 0, 0, 0, 153, 153, 83, 83, 83, 83, 26, 26 },// Teso/Latin/Uganda
{ 288, 66, 124, 0, 0, 0, 0, 153, 153, 83, 83, 83, 83, 26, 26 },// Teso/Latin/Kenya
{ 289, 133, 231, 4691, 4691, 4691, 4691, 153, 153, 98, 98, 98, 98, 26, 26 },// Thai/Thai/Thailand
{ 290, 134, 50, 0, 0, 0, 0, 153, 153, 83, 83, 83, 83, 26, 26 },// Tibetan/Tibetan/China
{ 290, 134, 110, 0, 0, 0, 0, 153, 153, 83, 83, 83, 83, 26, 26 },// Tibetan/Tibetan/India
{ 291, 33, 74, 0, 0, 0, 0, 153, 153, 83, 83, 83, 83, 26, 26 },// Tigre/Ethiopic/Eritrea
{ 292, 33, 77, 0, 0, 0, 0, 153, 153, 83, 83, 83, 83, 26, 26 },// Tigrinya/Ethiopic/Ethiopia
{ 292, 33, 74, 0, 0, 0, 0, 153, 153, 83, 83, 83, 83, 26, 26 },// Tigrinya/Ethiopic/Eritrea
{ 294, 66, 182, 0, 0, 0, 0, 153, 153, 83, 83, 83, 83, 26, 26 },// Tok Pisin/Latin/Papua New Guinea
{ 295, 66, 235, 0, 0, 0, 0, 153, 153, 83, 83, 83, 83, 26, 26 },// Tongan/Latin/Tonga
{ 296, 66, 216, 0, 0, 0, 0, 153, 153, 83, 83, 83, 83, 26, 26 },// Tsonga/Latin/South Africa
{ 297, 66, 216, 0, 0, 0, 0, 153, 153, 83, 83, 83, 83, 26, 26 },// Tswana/Latin/South Africa
{ 297, 66, 30, 0, 0, 0, 0, 153, 153, 83, 83, 83, 83, 26, 26 },// Tswana/Latin/Botswana
{ 298, 66, 239, 4789, 4789, 4789, 4789, 153, 153, 80, 80, 80, 80, 26, 26 },// Turkish/Latin/Turkey
{ 298, 66, 63, 4789, 4789, 4789, 4789, 153, 153, 80, 80, 80, 80, 26, 26 },// Turkish/Latin/Cyprus
{ 299, 66, 240, 0, 0, 0, 0, 153, 153, 83, 83, 83, 83, 26, 26 },// Turkmen/Latin/Turkmenistan
{ 301, 66, 169, 0, 0, 0, 0, 153, 153, 83, 83, 83, 83, 26, 26 },// Tyap/Latin/Nigeria
{ 303, 27, 244, 4869, 4869, 4949, 4998, 153, 153, 80, 80, 49, 57, 26, 26 },// Ukrainian/Cyrillic/Ukraine
{ 304, 66, 91, 0, 0, 0, 0, 153, 153, 83, 83, 83, 83, 26, 26 },// Upper Sorbian/Latin/Germany
{ 305, 4, 178, 5055, 5055, 5055, 5055, 153, 153, 66, 66, 66, 66, 26, 26 },// Urdu/Arabic/Pakistan
{ 305, 4, 110, 5055, 5055, 5055, 5055, 153, 153, 66, 66, 66, 66, 26, 26 },// Urdu/Arabic/India
{ 306, 4, 50, 0, 0, 0, 0, 153, 153, 83, 83, 83, 83, 26, 26 },// Uyghur/Arabic/China
{ 307, 66, 251, 5121, 5204, 5286, 5204, 153, 153, 83, 82, 83, 82, 26, 26 },// Uzbek/Latin/Uzbekistan
{ 307, 4, 1, 0, 0, 0, 0, 153, 153, 83, 83, 83, 83, 26, 26 },// Uzbek/Arabic/Afghanistan
{ 307, 27, 251, 0, 0, 0, 0, 153, 153, 83, 83, 83, 83, 26, 26 },// Uzbek/Cyrillic/Uzbekistan
{ 308, 139, 134, 0, 0, 0, 0, 153, 153, 83, 83, 83, 83, 26, 26 },// Vai/Vai/Liberia
{ 308, 66, 134, 0, 0, 0, 0, 153, 153, 83, 83, 83, 83, 26, 26 },// Vai/Latin/Liberia
{ 309, 66, 216, 0, 0, 0, 0, 153, 153, 83, 83, 83, 83, 26, 26 },// Venda/Latin/South Africa
{ 310, 66, 255, 0, 0, 0, 0, 153, 153, 83, 83, 83, 83, 26, 26 },// Vietnamese/Latin/Vietnam
{ 311, 66, 258, 0, 0, 0, 0, 153, 153, 83, 83, 83, 83, 26, 26 },// Volapuk/Latin/World
{ 312, 66, 230, 0, 0, 0, 0, 153, 153, 83, 83, 83, 83, 26, 26 },// Vunjo/Latin/Tanzania
{ 313, 66, 23, 0, 0, 0, 0, 153, 153, 83, 83, 83, 83, 26, 26 },// Walloon/Latin/Belgium
{ 314, 66, 226, 0, 0, 0, 0, 153, 153, 83, 83, 83, 83, 26, 26 },// Walser/Latin/Switzerland
{ 315, 66, 15, 0, 0, 0, 0, 153, 153, 83, 83, 83, 83, 26, 26 },// Warlpiri/Latin/Australia
{ 316, 66, 246, 0, 0, 0, 0, 153, 153, 83, 83, 83, 83, 26, 26 },// Welsh/Latin/United Kingdom
{ 317, 4, 178, 0, 0, 0, 0, 153, 153, 83, 83, 83, 83, 26, 26 },// Western Balochi/Arabic/Pakistan
{ 317, 4, 1, 0, 0, 0, 0, 153, 153, 83, 83, 83, 83, 26, 26 },// Western Balochi/Arabic/Afghanistan
{ 317, 4, 112, 0, 0, 0, 0, 153, 153, 83, 83, 83, 83, 26, 26 },// Western Balochi/Arabic/Iran
{ 317, 4, 176, 0, 0, 0, 0, 153, 153, 83, 83, 83, 83, 26, 26 },// Western Balochi/Arabic/Oman
{ 317, 4, 245, 0, 0, 0, 0, 153, 153, 83, 83, 83, 83, 26, 26 },// Western Balochi/Arabic/United Arab Emirates
{ 318, 66, 165, 0, 0, 0, 0, 153, 153, 83, 83, 83, 83, 26, 26 },// Western Frisian/Latin/Netherlands
{ 319, 33, 77, 0, 0, 0, 0, 153, 153, 83, 83, 83, 83, 26, 26 },// Wolaytta/Ethiopic/Ethiopia
{ 320, 66, 206, 0, 0, 0, 0, 153, 153, 83, 83, 83, 83, 26, 26 },// Wolof/Latin/Senegal
{ 321, 66, 216, 0, 0, 0, 0, 153, 153, 83, 83, 83, 83, 26, 26 },// Xhosa/Latin/South Africa
{ 322, 66, 40, 0, 0, 0, 0, 153, 153, 83, 83, 83, 83, 26, 26 },// Yangben/Latin/Cameroon
{ 323, 47, 258, 0, 0, 0, 0, 153, 153, 83, 83, 83, 83, 26, 26 },// Yiddish/Hebrew/World
{ 324, 66, 169, 0, 0, 0, 0, 153, 153, 83, 83, 83, 83, 26, 26 },// Yoruba/Latin/Nigeria
{ 324, 66, 25, 0, 0, 0, 0, 153, 153, 83, 83, 83, 83, 26, 26 },// Yoruba/Latin/Benin
{ 325, 66, 170, 0, 0, 0, 0, 153, 153, 83, 83, 83, 83, 26, 26 },// Zarma/Latin/Niger
{ 327, 66, 216, 0, 0, 0, 0, 153, 153, 83, 83, 83, 83, 26, 26 },// Zulu/Latin/South Africa
{ 328, 66, 32, 0, 0, 0, 0, 153, 153, 83, 83, 83, 83, 26, 26 },// Kaingang/Latin/Brazil
{ 329, 66, 32, 0, 0, 0, 0, 153, 153, 83, 83, 83, 83, 26, 26 },// Nheengatu/Latin/Brazil
{ 329, 66, 54, 0, 0, 0, 0, 153, 153, 83, 83, 83, 83, 26, 26 },// Nheengatu/Latin/Colombia
{ 329, 66, 254, 0, 0, 0, 0, 153, 153, 83, 83, 83, 83, 26, 26 },// Nheengatu/Latin/Venezuela
{ 330, 29, 110, 0, 0, 0, 0, 153, 153, 83, 83, 83, 83, 26, 26 },// Haryanvi/Devanagari/India
{ 331, 66, 91, 0, 0, 0, 0, 153, 153, 83, 83, 83, 83, 26, 26 },// Northern Frisian/Latin/Germany
{ 332, 29, 110, 0, 0, 0, 0, 153, 153, 83, 83, 83, 83, 26, 26 },// Rajasthani/Devanagari/India
{ 333, 27, 193, 0, 0, 0, 0, 153, 153, 83, 83, 83, 83, 26, 26 },// Moksha/Cyrillic/Russia
{ 334, 66, 258, 0, 0, 0, 0, 153, 153, 83, 83, 83, 83, 26, 26 },// Toki Pona/Latin/World
{ 335, 66, 214, 0, 0, 0, 0, 153, 153, 83, 83, 83, 83, 26, 26 },// Pijin/Latin/Solomon Islands
{ 336, 66, 169, 0, 0, 0, 0, 153, 153, 83, 83, 83, 83, 26, 26 },// Obolo/Latin/Nigeria
{ 337, 4, 178, 0, 0, 0, 0, 153, 153, 83, 83, 83, 83, 26, 26 },// Baluchi/Arabic/Pakistan
{ 337, 66, 178, 0, 0, 0, 0, 153, 153, 83, 83, 83, 83, 26, 26 },// Baluchi/Latin/Pakistan
{ 338, 66, 117, 0, 0, 0, 0, 153, 153, 83, 83, 83, 83, 26, 26 },// Ligurian/Latin/Italy
{ 339, 142, 161, 0, 0, 0, 0, 153, 153, 83, 83, 83, 83, 26, 26 },// Rohingya/Hanifi/Myanmar
{ 339, 142, 20, 0, 0, 0, 0, 153, 153, 83, 83, 83, 83, 26, 26 },// Rohingya/Hanifi/Bangladesh
{ 340, 4, 178, 0, 0, 0, 0, 153, 153, 83, 83, 83, 83, 26, 26 },// Torwali/Arabic/Pakistan
{ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 },// trailing zeros
};
static constexpr char16_t months_data[] = {
0x46, 0x61, 0x72, 0x76, 0x61, 0x72, 0x64, 0x69, 0x6e, 0x3b, 0x4f, 0x72, 0x64, 0x69, 0x62, 0x65, 0x68, 0x65, 0x73, 0x68,
0x74, 0x3b, 0x4b, 0x68, 0x6f, 0x72, 0x64, 0x61, 0x64, 0x3b, 0x54, 0x69, 0x72, 0x3b, 0x4d, 0x6f, 0x72, 0x64, 0x61, 0x64,
0x3b, 0x53, 0x68, 0x61, 0x68, 0x72, 0x69, 0x76, 0x61, 0x72, 0x3b, 0x4d, 0x65, 0x68, 0x72, 0x3b, 0x41, 0x62, 0x61, 0x6e,
0x3b, 0x41, 0x7a, 0x61, 0x72, 0x3b, 0x44, 0x65, 0x79, 0x3b, 0x42, 0x61, 0x68, 0x6d, 0x61, 0x6e, 0x3b, 0x45, 0x73, 0x66,
0x61, 0x6e, 0x64, 0x46, 0x61, 0x72, 0x3b, 0x4f, 0x72, 0x64, 0x3b, 0x4b, 0x68, 0x6f, 0x3b, 0x54, 0x69, 0x72, 0x3b, 0x4d,
0x6f, 0x72, 0x3b, 0x53, 0x68, 0x61, 0x3b, 0x4d, 0x65, 0x68, 0x3b, 0x41, 0x62, 0x61, 0x3b, 0x41, 0x7a, 0x61, 0x3b, 0x44,
0x65, 0x79, 0x3b, 0x42, 0x61, 0x68, 0x3b, 0x45, 0x73, 0x66, 0x46, 0x3b, 0x4f, 0x3b, 0x4b, 0x3b, 0x54, 0x3b, 0x4d, 0x3b,
0x53, 0x3b, 0x4d, 0x3b, 0x41, 0x3b, 0x41, 0x3b, 0x44, 0x3b, 0x42, 0x3b, 0x45, 0x31, 0x3b, 0x32, 0x3b, 0x33, 0x3b, 0x34,
0x3b, 0x35, 0x3b, 0x36, 0x3b, 0x37, 0x3b, 0x38, 0x3b, 0x39, 0x3b, 0x31, 0x30, 0x3b, 0x31, 0x31, 0x3b, 0x31, 0x32, 0x641,
0x631, 0x641, 0x631, 0x62f, 0x646, 0x3b, 0x623, 0x630, 0x631, 0x628, 0x64a, 0x647, 0x634, 0x62a, 0x3b, 0x62e, 0x631, 0x62f, 0x627, 0x62f,
0x3b, 0x62a, 0x627, 0x631, 0x3b, 0x645, 0x631, 0x62f, 0x627, 0x62f, 0x3b, 0x634, 0x647, 0x631, 0x641, 0x627, 0x631, 0x3b, 0x645, 0x647,
0x631, 0x3b, 0x622, 0x64a, 0x627, 0x646, 0x3b, 0x622, 0x630, 0x631, 0x3b, 0x62f, 0x64a, 0x3b, 0x628, 0x647, 0x645, 0x646, 0x3b, 0x627,
0x633, 0x641, 0x646, 0x62f, 0x627, 0x631, 0x66, 0x259, 0x72, 0x76, 0x259, 0x72, 0x64, 0x69, 0x6e, 0x3b, 0x6f, 0x72, 0x64, 0x69,
0x62, 0x65, 0x68, 0x65, 0x15f, 0x74, 0x3b, 0x78, 0x6f, 0x72, 0x64, 0x259, 0x64, 0x3b, 0x74, 0x69, 0x72, 0x3b, 0x6d, 0x6f,
0x72, 0x64, 0x259, 0x64, 0x3b, 0x15f, 0x259, 0x68, 0x72, 0x69, 0x76, 0x61, 0x72, 0x3b, 0x6d, 0x65, 0x68, 0x72, 0x3b, 0x61,
0x62, 0x259, 0x6e, 0x3b, 0x61, 0x7a, 0x259, 0x72, 0x3b, 0x64, 0x65, 0x79, 0x3b, 0x62, 0x259, 0x68, 0x6d, 0x259, 0x6e, 0x3b,
0x69, 0x73, 0x66, 0x259, 0x6e, 0x64, 0x9ab, 0x9cd, 0x9af, 0x9be, 0x9ad, 0x9be, 0x9b0, 0x9cd, 0x9a1, 0x9bf, 0x9a8, 0x3b, 0x985, 0x9b0,
0x9a1, 0x9bf, 0x9ac, 0x9c7, 0x9b9, 0x9c7, 0x9b6, 0x9cd, 0x9a4, 0x3b, 0x996, 0x9cb, 0x9b0, 0x9cd, 0x9a6, 0x9cd, 0x9a6, 0x3b, 0x9a4, 0x9c0,
0x9b0, 0x3b, 0x9ae, 0x9b0, 0x9cd, 0x9af, 0x9be, 0x9a6, 0x3b, 0x9b6, 0x9be, 0x9b9, 0x9b0, 0x9bf, 0x9ac, 0x9be, 0x9b0, 0x3b, 0x9ae, 0x9c7,
0x9b9, 0x9c7, 0x9b0, 0x3b, 0x986, 0x9ac, 0x9be, 0x9a8, 0x3b, 0x9ac, 0x9be, 0x99c, 0x9be, 0x9b0, 0x3b, 0x9a6, 0x9c7, 0x3b, 0x9ac, 0x9be,
0x9b9, 0x9ae, 0x9be, 0x9a8, 0x3b, 0x98f, 0x9b8, 0x9ab, 0x9cd, 0x9af, 0x9be, 0x9a8, 0x9cd, 0x9a1, 0x9ab, 0x9cd, 0x9af, 0x9be, 0x9ad, 0x9be,
0x9b0, 0x9cd, 0x9a1, 0x9bf, 0x9a8, 0x3b, 0x985, 0x9b0, 0x9a1, 0x9bf, 0x9ac, 0x9c7, 0x9b9, 0x9c7, 0x9b6, 0x9cd, 0x9a4, 0x3b, 0x996, 0x9cb,
0x9b0, 0x9cd, 0x9a6, 0x9cd, 0x9a6, 0x3b, 0x9a4, 0x9c0, 0x9b0, 0x3b, 0x9ae, 0x9b0, 0x9cd, 0x9af, 0x9be, 0x9a6, 0x3b, 0x9b6, 0x9be, 0x9b9,
0x9b0, 0x9bf, 0x9ac, 0x9be, 0x9b0, 0x3b, 0x9ae, 0x9c7, 0x9b9, 0x9c7, 0x9b0, 0x3b, 0x986, 0x9ac, 0x9be, 0x9a8, 0x3b, 0x986, 0x99c, 0x9be,
0x9b0, 0x3b, 0x9a6, 0x9c7, 0x3b, 0x9ac, 0x9be, 0x9b9, 0x9ae, 0x9be, 0x9a8, 0x3b, 0x98f, 0x9b8, 0x9ab, 0x9cd, 0x9af, 0x9be, 0x9a8, 0x9cd,
0x9a1, 0x9e7, 0x3b, 0x9e8, 0x3b, 0x9e9, 0x3b, 0x9ea, 0x3b, 0x9eb, 0x3b, 0x9ec, 0x3b, 0x9ed, 0x3b, 0x9ee, 0x3b, 0x9ef, 0x3b, 0x9e7,
0x9e6, 0x3b, 0x9e7, 0x9e7, 0x3b, 0x9e7, 0x9e8, 0x424, 0x430, 0x440, 0x430, 0x432, 0x430, 0x434, 0x438, 0x43d, 0x3b, 0x41e, 0x440, 0x434,
0x438, 0x431, 0x435, 0x445, 0x435, 0x448, 0x442, 0x3b, 0x41a, 0x43e, 0x440, 0x434, 0x430, 0x434, 0x3b, 0x422, 0x438, 0x440, 0x3b, 0x41c,
0x43e, 0x440, 0x434, 0x430, 0x434, 0x3b, 0x428, 0x430, 0x445, 0x440, 0x438, 0x432, 0x430, 0x440, 0x3b, 0x41c, 0x435, 0x445, 0x440, 0x3b,
0x410, 0x431, 0x430, 0x43d, 0x3b, 0x410, 0x437, 0x430, 0x440, 0x3b, 0x414, 0x435, 0x458, 0x3b, 0x411, 0x430, 0x445, 0x43c, 0x430, 0x43d,
0x3b, 0x415, 0x441, 0x444, 0x430, 0x43d, 0x434, 0x31, 0x6708, 0x3b, 0x32, 0x6708, 0x3b, 0x33, 0x6708, 0x3b, 0x34, 0x6708, 0x3b, 0x35,
0x6708, 0x3b, 0x36, 0x6708, 0x3b, 0x37, 0x6708, 0x3b, 0x38, 0x6708, 0x3b, 0x39, 0x6708, 0x3b, 0x31, 0x30, 0x6708, 0x3b, 0x31, 0x31,
0x6708, 0x3b, 0x31, 0x32, 0x6708, 0x62e, 0x627, 0x6a9, 0x6d5, 0x644, 0x6ce, 0x648, 0x6d5, 0x3b, 0x628, 0x627, 0x646, 0x6d5, 0x645, 0x6d5,
0x695, 0x3b, 0x62c, 0x6c6, 0x632, 0x6d5, 0x631, 0x62f, 0x627, 0x646, 0x3b, 0x67e, 0x648, 0x648, 0x634, 0x67e, 0x6d5, 0x695, 0x3b, 0x6af,
0x6d5, 0x644, 0x627, 0x648, 0x6ce, 0x698, 0x3b, 0x62e, 0x6d5, 0x631, 0x645, 0x627, 0x646, 0x627, 0x646, 0x3b, 0x695, 0x6d5, 0x632, 0x628,
0x6d5, 0x631, 0x3b, 0x62e, 0x6d5, 0x632, 0x6d5, 0x6b5, 0x648, 0x6d5, 0x631, 0x3b, 0x633, 0x6d5, 0x631, 0x645, 0x627, 0x648, 0x6d5, 0x632,
0x3b, 0x628, 0x6d5, 0x641, 0x631, 0x627, 0x646, 0x628, 0x627, 0x631, 0x3b, 0x695, 0x6ce, 0x628, 0x6d5, 0x646, 0x62f, 0x627, 0x646, 0x3b,
0x631, 0x6d5, 0x634, 0x6d5, 0x645, 0x6ce, 0x62e, 0x627, 0x6a9, 0x6d5, 0x644, 0x6ce, 0x648, 0x6d5, 0x3b, 0x6af, 0x648, 0x6b5, 0x627, 0x646,
0x3b, 0x62c, 0x6c6, 0x632, 0x6d5, 0x631, 0x62f, 0x627, 0x646, 0x3b, 0x67e, 0x648, 0x648, 0x634, 0x67e, 0x6d5, 0x695, 0x3b, 0x6af, 0x6d5,
0x644, 0x627, 0x648, 0x6ce, 0x698, 0x3b, 0x62e, 0x6d5, 0x631, 0x645, 0x627, 0x646, 0x627, 0x646, 0x3b, 0x695, 0x6d5, 0x632, 0x628, 0x6d5,
0x631, 0x3b, 0x6af, 0x6d5, 0x6b5, 0x627, 0x695, 0x6ce, 0x632, 0x627, 0x646, 0x3b, 0x633, 0x6d5, 0x631, 0x645, 0x627, 0x648, 0x6d5, 0x632,
0x3b, 0x628, 0x6d5, 0x641, 0x631, 0x627, 0x646, 0x628, 0x627, 0x631, 0x3b, 0x695, 0x6ce, 0x628, 0x6d5, 0x646, 0x62f, 0x627, 0x646, 0x3b,
0x695, 0x6d5, 0x634, 0x6d5, 0x645, 0x6d5, 0x4e00, 0x6708, 0x3b, 0x4e8c, 0x6708, 0x3b, 0x4e09, 0x6708, 0x3b, 0x56db, 0x6708, 0x3b, 0x4e94, 0x6708,
0x3b, 0x516d, 0x6708, 0x3b, 0x4e03, 0x6708, 0x3b, 0x516b, 0x6708, 0x3b, 0x4e5d, 0x6708, 0x3b, 0x5341, 0x6708, 0x3b, 0x5341, 0x4e00, 0x6708, 0x3b,
0x5341, 0x4e8c, 0x6708, 0x31, 0x2e, 0x3b, 0x32, 0x2e, 0x3b, 0x33, 0x2e, 0x3b, 0x34, 0x2e, 0x3b, 0x35, 0x2e, 0x3b, 0x36, 0x2e,
0x3b, 0x37, 0x2e, 0x3b, 0x38, 0x2e, 0x3b, 0x39, 0x2e, 0x3b, 0x31, 0x30, 0x2e, 0x3b, 0x31, 0x31, 0x2e, 0x3b, 0x31, 0x32,
0x2e, 0x66, 0x61, 0x72, 0x76, 0x61, 0x72, 0x64, 0x69, 0x6e, 0x3b, 0x6f, 0x72, 0x64, 0x69, 0x62, 0x65, 0x68, 0x65, 0x161,
0x74, 0x3b, 0x63, 0x68, 0x6f, 0x72, 0x64, 0xe1, 0x64, 0x3b, 0x74, 0xed, 0x72, 0x3b, 0x6d, 0x6f, 0x72, 0x64, 0xe1, 0x64,
0x3b, 0x161, 0x61, 0x68, 0x72, 0xed, 0x76, 0x61, 0x72, 0x3b, 0x6d, 0x65, 0x68, 0x72, 0x3b, 0xe1, 0x62, 0xe1, 0x6e, 0x3b,
0xe1, 0x7a, 0x61, 0x72, 0x3b, 0x64, 0x65, 0x69, 0x3b, 0x62, 0x61, 0x68, 0x6d, 0x61, 0x6e, 0x3b, 0x65, 0x73, 0x66, 0x61,
0x6e, 0x64, 0x66, 0x61, 0x72, 0x76, 0x61, 0x72, 0x64, 0x69, 0x6e, 0x3b, 0x6f, 0x72, 0x64, 0x69, 0x62, 0x65, 0x68, 0x65,
0x73, 0x68, 0x74, 0x3b, 0x6b, 0x68, 0x6f, 0x72, 0x64, 0x61, 0x64, 0x3b, 0x74, 0x69, 0x72, 0x3b, 0x6d, 0x6f, 0x72, 0x64,
0x61, 0x64, 0x3b, 0x73, 0x68, 0x61, 0x68, 0x72, 0x69, 0x76, 0x61, 0x72, 0x3b, 0x6d, 0x65, 0x68, 0x72, 0x3b, 0x61, 0x62,
0x61, 0x6e, 0x3b, 0x61, 0x7a, 0x61, 0x72, 0x3b, 0x64, 0x65, 0x79, 0x3b, 0x62, 0x61, 0x68, 0x6d, 0x61, 0x6e, 0x3b, 0x65,
0x73, 0x66, 0x61, 0x6e, 0x64, 0x64, 0x7a, 0x6f, 0x76, 0x65, 0x3b, 0x64, 0x7a, 0x6f, 0x64, 0x7a, 0x65, 0x3b, 0x74, 0x65,
0x64, 0x6f, 0x78, 0x65, 0x3b, 0x61, 0x66, 0x254, 0x66, 0x69, 0x1ebd, 0x3b, 0x64, 0x61, 0x6d, 0x25b, 0x3b, 0x6d, 0x61, 0x73,
0x61, 0x3b, 0x73, 0x69, 0x61, 0x6d, 0x6c, 0x254, 0x6d, 0x3b, 0x64, 0x65, 0x61, 0x73, 0x69, 0x61, 0x6d, 0x69, 0x6d, 0x65,
0x3b, 0x61, 0x6e, 0x79, 0x254, 0x6e, 0x79, 0x254, 0x3b, 0x6b, 0x65, 0x6c, 0x65, 0x3b, 0x61, 0x64, 0x65, 0x25b, 0x6d, 0x65,
0x6b, 0x70, 0x254, 0x78, 0x65, 0x3b, 0x64, 0x7a, 0x6f, 0x6d, 0x65, 0x64, 0x7a, 0x76, 0x3b, 0x64, 0x7a, 0x64, 0x3b, 0x74,
0x65, 0x64, 0x3b, 0x61, 0x66, 0x254, 0x3b, 0x64, 0x61, 0x6d, 0x3b, 0x6d, 0x61, 0x73, 0x3b, 0x73, 0x69, 0x61, 0x3b, 0x64,
0x65, 0x61, 0x3b, 0x61, 0x6e, 0x79, 0x3b, 0x6b, 0x65, 0x6c, 0x3b, 0x61, 0x64, 0x65, 0x3b, 0x64, 0x7a, 0x6d, 0x66, 0x61,
0x72, 0x76, 0x61, 0x72, 0x64, 0x69, 0x6e, 0x6b, 0x75, 0x75, 0x3b, 0x6f, 0x72, 0x64, 0x69, 0x62, 0x65, 0x68, 0x65, 0x161,
0x74, 0x6b, 0x75, 0x75, 0x3b, 0x6b, 0x68, 0x6f, 0x72, 0x64, 0x61, 0x64, 0x6b, 0x75, 0x75, 0x3b, 0x74, 0x69, 0x72, 0x6b,
0x75, 0x75, 0x3b, 0x6d, 0x6f, 0x72, 0x64, 0x61, 0x64, 0x6b, 0x75, 0x75, 0x3b, 0x161, 0x61, 0x68, 0x72, 0x69, 0x76, 0x61,
0x72, 0x6b, 0x75, 0x75, 0x3b, 0x6d, 0x65, 0x68, 0x72, 0x6b, 0x75, 0x75, 0x3b, 0x61, 0x62, 0x61, 0x6e, 0x6b, 0x75, 0x75,
0x3b, 0x61, 0x7a, 0x61, 0x72, 0x6b, 0x75, 0x75, 0x3b, 0x64, 0x65, 0x79, 0x6b, 0x75, 0x75, 0x3b, 0x62, 0x61, 0x68, 0x6d,
0x61, 0x6e, 0x6b, 0x75, 0x75, 0x3b, 0x65, 0x73, 0x66, 0x61, 0x6e, 0x64, 0x6b, 0x75, 0x75, 0x66, 0x61, 0x72, 0x76, 0x61,
0x72, 0x64, 0x69, 0x6e, 0x6b, 0x75, 0x75, 0x74, 0x61, 0x3b, 0x6f, 0x72, 0x64, 0x69, 0x62, 0x65, 0x68, 0x65, 0x161, 0x74,
0x6b, 0x75, 0x75, 0x74, 0x61, 0x3b, 0x6b, 0x68, 0x6f, 0x72, 0x64, 0x61, 0x64, 0x6b, 0x75, 0x75, 0x74, 0x61, 0x3b, 0x74,
0x69, 0x72, 0x6b, 0x75, 0x75, 0x74, 0x61, 0x3b, 0x6d, 0x6f, 0x72, 0x64, 0x61, 0x64, 0x6b, 0x75, 0x75, 0x74, 0x61, 0x3b,
0x161, 0x61, 0x68, 0x72, 0x69, 0x76, 0x61, 0x72, 0x6b, 0x75, 0x75, 0x74, 0x61, 0x3b, 0x6d, 0x65, 0x68, 0x72, 0x6b, 0x75,
0x75, 0x74, 0x61, 0x3b, 0x61, 0x62, 0x61, 0x6e, 0x6b, 0x75, 0x75, 0x74, 0x61, 0x3b, 0x61, 0x7a, 0x61, 0x72, 0x6b, 0x75,
0x75, 0x74, 0x61, 0x3b, 0x64, 0x65, 0x79, 0x6b, 0x75, 0x75, 0x74, 0x61, 0x3b, 0x62, 0x61, 0x68, 0x6d, 0x61, 0x6e, 0x6b,
0x75, 0x75, 0x74, 0x61, 0x3b, 0x65, 0x73, 0x66, 0x61, 0x6e, 0x64, 0x6b, 0x75, 0x75, 0x74, 0x61, 0x66, 0x61, 0x72, 0x76,
0x61, 0x72, 0x64, 0x69, 0x6e, 0x3b, 0x6f, 0x72, 0x64, 0x69, 0x62, 0x65, 0x68, 0x65, 0x161, 0x74, 0x3b, 0x6b, 0x68, 0x6f,
0x72, 0x64, 0x61, 0x64, 0x3b, 0x74, 0x69, 0x72, 0x3b, 0x6d, 0x6f, 0x72, 0x64, 0x61, 0x64, 0x3b, 0x161, 0x61, 0x68, 0x72,
0x69, 0x76, 0x61, 0x72, 0x3b, 0x6d, 0x65, 0x68, 0x72, 0x3b, 0x61, 0x62, 0x61, 0x6e, 0x3b, 0x61, 0x7a, 0x61, 0x72, 0x3b,
0x64, 0x65, 0x79, 0x3b, 0x62, 0x61, 0x68, 0x6d, 0x61, 0x6e, 0x3b, 0x65, 0x73, 0x66, 0x61, 0x6e, 0x64, 0x66, 0x61, 0x72,
0x76, 0x61, 0x72, 0x64, 0x69, 0x6e, 0x3b, 0x6f, 0x72, 0x64, 0x69, 0x62, 0x65, 0x68, 0x65, 0x161, 0x74, 0x3b, 0x6b, 0x68,
0x6f, 0x72, 0x64, 0xe2, 0x64, 0x3b, 0x74, 0x69, 0x72, 0x3b, 0x6d, 0x6f, 0x72, 0x64, 0xe2, 0x64, 0x3b, 0x161, 0x61, 0x68,
0x72, 0x69, 0x76, 0x61, 0x72, 0x3b, 0x6d, 0x65, 0x68, 0x72, 0x3b, 0xe2, 0x62, 0xe2, 0x6e, 0x3b, 0xe2, 0x7a, 0x61, 0x72,
0x3b, 0x64, 0x65, 0x79, 0x3b, 0x62, 0x61, 0x68, 0x6d, 0x61, 0x6e, 0x3b, 0x65, 0x73, 0x66, 0x61, 0x6e, 0x64, 0x66, 0x61,
0x72, 0x2e, 0x3b, 0x6f, 0x72, 0x64, 0x2e, 0x3b, 0x6b, 0x68, 0x6f, 0x2e, 0x3b, 0x74, 0x69, 0x72, 0x3b, 0x6d, 0x6f, 0x72,
0x2e, 0x3b, 0x161, 0x61, 0x68, 0x2e, 0x3b, 0x6d, 0x65, 0x68, 0x72, 0x3b, 0xe2, 0x62, 0xe2, 0x6e, 0x3b, 0xe2, 0x7a, 0x61,
0x72, 0x3b, 0x64, 0x65, 0x79, 0x3b, 0x62, 0x61, 0x68, 0x2e, 0x3b, 0x65, 0x73, 0x66, 0x2e, 0x46, 0x61, 0x72, 0x76, 0x61,
0x72, 0x64, 0x69, 0x6e, 0x3b, 0x4f, 0x72, 0x64, 0x69, 0x62, 0x65, 0x68, 0x65, 0x161, 0x74, 0x3b, 0x4b, 0x68, 0x6f, 0x72,
0x64, 0xe2, 0x64, 0x3b, 0x54, 0x69, 0x72, 0x3b, 0x4d, 0x6f, 0x72, 0x64, 0xe2, 0x64, 0x3b, 0x160, 0x61, 0x68, 0x72, 0x69,
0x76, 0x61, 0x72, 0x3b, 0x4d, 0x65, 0x68, 0x72, 0x3b, 0xc2, 0x62, 0xe2, 0x6e, 0x3b, 0xc2, 0x7a, 0x61, 0x72, 0x3b, 0x44,
0x65, 0x79, 0x3b, 0x42, 0x61, 0x68, 0x6d, 0x61, 0x6e, 0x3b, 0x45, 0x73, 0x66, 0x61, 0x6e, 0x64, 0x46, 0x61, 0x72, 0x2e,
0x3b, 0x4f, 0x72, 0x64, 0x2e, 0x3b, 0x4b, 0x68, 0x6f, 0x2e, 0x3b, 0x54, 0x69, 0x72, 0x3b, 0x4d, 0x6f, 0x72, 0x2e, 0x3b,
0x160, 0x61, 0x68, 0x2e, 0x3b, 0x4d, 0x65, 0x68, 0x72, 0x3b, 0xc2, 0x62, 0xe2, 0x2e, 0x3b, 0xc2, 0x7a, 0x61, 0x72, 0x3b,
0x44, 0x65, 0x79, 0x3b, 0x42, 0x61, 0x68, 0x2e, 0x3b, 0x45, 0x73, 0x66, 0x2e, 0xd83a, 0xdd0a, 0xd83a, 0xdd22, 0xd83a, 0xdd2a, 0xd83a,
0xdd3e, 0xd83a, 0xdd22, 0xd83a, 0xdd2a, 0xd83a, 0xdd23, 0xd83a, 0xdd2d, 0xd83a, 0xdd32, 0x3b, 0xd83a, 0xdd0c, 0xd83a, 0xdd2a, 0xd83a, 0xdd23, 0xd83a, 0xdd2d,
0xd83a, 0xdd26, 0xd83a, 0xdd2b, 0xd83a, 0xdd38, 0xd83a, 0xdd2b, 0xd83a, 0xdd43, 0xd83a, 0xdd3c, 0x3b, 0xd83a, 0xdd1d, 0xd83a, 0xdd2e, 0xd83a, 0xdd2a, 0xd83a,
0xdd23, 0xd83a, 0xdd22, 0xd83a, 0xdd23, 0x3b, 0xd83a, 0xdd1a, 0xd83a, 0xdd2d, 0xd83a, 0xdd2a, 0x3b, 0xd83a, 0xdd03, 0xd83a, 0xdd2e, 0xd83a, 0xdd2a, 0xd83a,
0xdd23, 0xd83a, 0xdd22, 0xd83a, 0xdd23, 0x3b, 0xd83a, 0xdd21, 0xd83a, 0xdd22, 0xd83a, 0xdd38, 0xd83a, 0xdd2a, 0xd83a, 0xdd2d, 0xd83a, 0xdd3e, 0xd83a, 0xdd22,
0xd83a, 0xdd2a, 0x3b, 0xd83a, 0xdd03, 0xd83a, 0xdd2b, 0xd83a, 0xdd38, 0xd83a, 0xdd2b, 0xd83a, 0xdd2a, 0x3b, 0xd83a, 0xdd00, 0xd83a, 0xdd26, 0xd83a, 0xdd22,
0xd83a, 0xdd32, 0x3b, 0xd83a, 0xdd00, 0xd83a, 0xdd41, 0xd83a, 0xdd22, 0xd83a, 0xdd2a, 0x3b, 0xd83a, 0xdd01, 0xd83a, 0xdd2b, 0xd83a, 0xdd34, 0x3b, 0xd83a,
0xdd04, 0xd83a, 0xdd22, 0xd83a, 0xdd38, 0xd83a, 0xdd25, 0xd83a, 0xdd22, 0xd83a, 0xdd32, 0x3b, 0xd83a, 0xdd09, 0xd83a, 0xdd27, 0xd83a, 0xdd2c, 0xd83a, 0xdd22,
0xd83a, 0xdd32, 0xd83a, 0xdd23, 0xd83a, 0xdd51, 0x3b, 0xd83a, 0xdd52, 0x3b, 0xd83a, 0xdd53, 0x3b, 0xd83a, 0xdd54, 0x3b, 0xd83a, 0xdd55, 0x3b, 0xd83a,
0xdd56, 0x3b, 0xd83a, 0xdd57, 0x3b, 0xd83a, 0xdd58, 0x3b, 0xd83a, 0xdd59, 0x3b, 0xd83a, 0xdd51, 0xd83a, 0xdd50, 0x3b, 0xd83a, 0xdd51, 0xd83a, 0xdd51,
0x3b, 0xd83a, 0xdd51, 0xd83a, 0xdd52, 0x10e4, 0x10d0, 0x10e0, 0x10d5, 0x10d0, 0x10e0, 0x10d3, 0x10d8, 0x10dc, 0x10d8, 0x3b, 0x10dd, 0x10e0, 0x10d3, 0x10d8,
0x10d1, 0x10d4, 0x10f0, 0x10d4, 0x10e8, 0x10d7, 0x10d8, 0x3b, 0x10ee, 0x10dd, 0x10e0, 0x10d3, 0x10d0, 0x10d3, 0x10d8, 0x3b, 0x10d7, 0x10d8, 0x10e0, 0x10d8,
0x3b, 0x10db, 0x10dd, 0x10e0, 0x10d3, 0x10d0, 0x10d3, 0x10d8, 0x3b, 0x10e8, 0x10d0, 0x10f0, 0x10e0, 0x10d8, 0x10d5, 0x10d0, 0x10e0, 0x10d8, 0x3b, 0x10db,
0x10d4, 0x10f0, 0x10e0, 0x10d8, 0x3b, 0x10d0, 0x10d1, 0x10d0, 0x10dc, 0x10d8, 0x3b, 0x10d0, 0x10d6, 0x10d0, 0x10e0, 0x10d8, 0x3b, 0x10d3, 0x10d4, 0x10d8,
0x3b, 0x10d1, 0x10d0, 0x10f0, 0x10db, 0x10d0, 0x10dc, 0x10d8, 0x3b, 0x10d4, 0x10e1, 0x10e4, 0x10d0, 0x10dc, 0x10d3, 0x10d8, 0x46, 0x61, 0x72, 0x77,
0x61, 0x72, 0x64, 0x69, 0x6e, 0x3b, 0x4f, 0x72, 0x64, 0x69, 0x62, 0x65, 0x68, 0x65, 0x73, 0x63, 0x68, 0x74, 0x3b, 0x43,
0x68, 0x6f, 0x72, 0x64, 0x101, 0x64, 0x3b, 0x54, 0x69, 0x72, 0x3b, 0x4d, 0x6f, 0x72, 0x64, 0x101, 0x64, 0x3b, 0x53, 0x63,
0x68, 0x61, 0x68, 0x72, 0x69, 0x77, 0x61, 0x72, 0x3b, 0x4d, 0x65, 0x68, 0x72, 0x3b, 0x100, 0x62, 0x101, 0x6e, 0x3b, 0x100,
0x73, 0x61, 0x72, 0x3b, 0x44, 0xe9, 0x69, 0x3b, 0x42, 0x61, 0x68, 0x6d, 0x61, 0x6e, 0x3b, 0x45, 0x73, 0x73, 0x66, 0x61,
0x6e, 0x64, 0xaab, 0xabe, 0xab0, 0xacd, 0xab5, 0xabe, 0xab0, 0xacd, 0xaa6, 0xabf, 0xaa8, 0x3b, 0xa93, 0xab0, 0xaa1, 0xac0, 0xaac, 0xac7,
0xab9, 0xac7, 0xab6, 0xacd, 0xa9f, 0x3b, 0xa96, 0xacb, 0xab0, 0xaa6, 0xabe, 0xaa6, 0x3b, 0xaa4, 0xabf, 0xab0, 0x3b, 0xaae, 0xacb, 0xab0,
0xacd, 0xaa6, 0xabe, 0xaa6, 0x3b, 0xab6, 0xabe, 0xab9, 0xab0, 0xabf, 0xab5, 0xab0, 0x3b, 0xaae, 0xac7, 0xab9, 0xab0, 0x3b, 0xa85, 0xaac,
0xabe, 0xaa8, 0x3b, 0xa85, 0xa9d, 0xabe, 0xab0, 0x3b, 0xaa1, 0xac7, 0xaaf, 0x3b, 0xaac, 0xabe, 0xab9, 0xaae, 0xac7, 0xaa8, 0x3b, 0xa8f,
0xab8, 0xacd, 0xaab, 0xabe, 0xaa8, 0xacd, 0xaa1, 0x5e4, 0x5e8, 0x5d5, 0x5e8, 0x5d3, 0x5d9, 0x5df, 0x3b, 0x5d0, 0x5e8, 0x5d3, 0x5d9, 0x5d1,
0x5d4, 0x5e9, 0x5ea, 0x3b, 0x5d7, 0x5f3, 0x5e8, 0x5d3, 0x5d0, 0x5d3, 0x3b, 0x5ea, 0x5d9, 0x5e8, 0x3b, 0x5de, 0x5e8, 0x5d3, 0x5d0, 0x5d3,
0x3b, 0x5e9, 0x5d4, 0x5e8, 0x5d9, 0x5d5, 0x5e8, 0x3b, 0x5de, 0x5d4, 0x5e8, 0x3b, 0x5d0, 0x5d1, 0x5d0, 0x5df, 0x3b, 0x5d0, 0x5d3, 0x5f3,
0x5e8, 0x3b, 0x5d3, 0x5d9, 0x3b, 0x5d1, 0x5d4, 0x5de, 0x5df, 0x3b, 0x5d0, 0x5e1, 0x5e4, 0x5e0, 0x5d3, 0x92b, 0x930, 0x94d, 0x935, 0x93e,
0x926, 0x93f, 0x928, 0x3b, 0x913, 0x930, 0x94d, 0x926, 0x93f, 0x935, 0x947, 0x939, 0x947, 0x938, 0x94d, 0x91f, 0x3b, 0x916, 0x94b, 0x930,
0x930, 0x94d, 0x926, 0x93e, 0x926, 0x3b, 0x91f, 0x93f, 0x930, 0x3b, 0x92e, 0x94b, 0x930, 0x926, 0x93e, 0x926, 0x3b, 0x936, 0x93e, 0x939,
0x930, 0x940, 0x935, 0x930, 0x94d, 0x3b, 0x92e, 0x947, 0x939, 0x930, 0x3b, 0x905, 0x935, 0x928, 0x3b, 0x905, 0x91c, 0x93c, 0x930, 0x3b,
0x921, 0x947, 0x3b, 0x92c, 0x939, 0x92e, 0x928, 0x3b, 0x908, 0x938, 0x94d, 0x92b, 0x928, 0x94d, 0x926, 0x94d, 0x30d5, 0x30a1, 0x30eb, 0x30f4,
0x30a1, 0x30eb, 0x30c7, 0x30a3, 0x30fc, 0x30f3, 0x3b, 0x30aa, 0x30eb, 0x30c7, 0x30a3, 0x30fc, 0x30d9, 0x30d8, 0x30b7, 0x30e5, 0x30c8, 0x3b, 0x30db, 0x30eb,
0x30c0, 0x30fc, 0x30c9, 0x3b, 0x30c6, 0x30a3, 0x30fc, 0x30eb, 0x3b, 0x30e2, 0x30eb, 0x30c0, 0x30fc, 0x30c9, 0x3b, 0x30b7, 0x30e3, 0x30cf, 0x30ea, 0x30fc,
0x30f4, 0x30a1, 0x30eb, 0x3b, 0x30e1, 0x30d5, 0x30eb, 0x3b, 0x30a2, 0x30fc, 0x30d0, 0x30fc, 0x30f3, 0x3b, 0x30a2, 0x30fc, 0x30b6, 0x30eb, 0x3b, 0x30c7,
0x30a4, 0x3b, 0x30d0, 0x30d5, 0x30de, 0x30f3, 0x3b, 0x30a8, 0x30b9, 0x30d5, 0x30a1, 0x30f3, 0x30c9, 0xcab, 0xcb0, 0xccd, 0xcb5, 0xcb0, 0xccd, 0xca6,
0xcbf, 0xca8, 0xccd, 0x3b, 0xc93, 0xcb0, 0xccd, 0xca6, 0xcbf, 0xcac, 0xcc6, 0xcb9, 0xcc6, 0xcb6, 0xccd, 0xc9f, 0xccd, 0x3b, 0xc96, 0xccb,
0xcb0, 0xccd, 0xca1, 0xcbe, 0xca6, 0xccd, 0x3b, 0xc9f, 0xcbf, 0xcb0, 0xccd, 0x3b, 0xcae, 0xcca, 0xcb0, 0xccd, 0xca6, 0xcbe, 0xca6, 0xccd,
0x3b, 0xcb6, 0xcb9, 0xcb0, 0xcbf, 0xcb5, 0xcbe, 0xcb0, 0xccd, 0x3b, 0xcae, 0xcc6, 0xcb9, 0xccd, 0xcb0, 0xccd, 0x3b, 0xc85, 0xcac, 0xca8,
0xccd, 0x3b, 0xc85, 0xc9d, 0xcb0, 0xccd, 0x3b, 0xca1, 0xcc7, 0x3b, 0xcac, 0xcb9, 0xccd, 0xcae, 0xca8, 0xccd, 0x3b, 0xc8e, 0xcb8, 0xccd,
0xcab, 0xcbe, 0xc82, 0xca1, 0xccd, 0x424, 0x430, 0x440, 0x432, 0x430, 0x440, 0x434, 0x438, 0x43d, 0x3b, 0x41e, 0x440, 0x434, 0x438, 0x431,
0x435, 0x445, 0x435, 0x448, 0x442, 0x3b, 0x425, 0x43e, 0x440, 0x434, 0x430, 0x434, 0x3b, 0x422, 0x438, 0x440, 0x3b, 0x41c, 0x43e, 0x440,
0x434, 0x430, 0x434, 0x3b, 0x428, 0x430, 0x445, 0x440, 0x438, 0x432, 0x430, 0x440, 0x3b, 0x41c, 0x435, 0x445, 0x440, 0x3b, 0x410, 0x431,
0x430, 0x43d, 0x3b, 0x410, 0x437, 0x430, 0x440, 0x3b, 0x414, 0x435, 0x439, 0x3b, 0x411, 0x430, 0x445, 0x43c, 0x430, 0x43d, 0x3b, 0x42d,
0x441, 0x444, 0x430, 0x43d, 0x434, 0xd654, 0xb974, 0xbc14, 0xb518, 0x3b, 0xc624, 0xb974, 0xb514, 0xbca0, 0xd5e4, 0xc26c, 0xd2b8, 0x3b, 0xd638, 0xb974,
0xb2e4, 0xb4dc, 0x3b, 0xd2f0, 0xb974, 0x3b, 0xbaa8, 0xb974, 0xb2e4, 0xb4dc, 0x3b, 0xc0e4, 0xd750, 0xb9ac, 0xbc14, 0xb974, 0x3b, 0xba54, 0xd750, 0xb974,
0x3b, 0xc544, 0xbc18, 0x3b, 0xc544, 0xc790, 0xb974, 0x3b, 0xb2e4, 0xc774, 0x3b, 0xbc14, 0xd750, 0xb9cc, 0x3b, 0xc5d0, 0xc2a4, 0xd310, 0xb4dc, 0xe9f,
0xea3, 0xeb2, 0xea7, 0xeb2, 0xe94, 0xeb4, 0xe99, 0x3b, 0xead, 0xecd, 0xea3, 0xe94, 0xeb5, 0xe9a, 0xeb5, 0xec0, 0xeab, 0xea3, 0xe94, 0x3b,
0xe84, 0xecd, 0xea3, 0xec0, 0xe94, 0xe94, 0x3b, 0xec1, 0xe95, 0xea3, 0x3b, 0xea1, 0xecd, 0xea3, 0xec0, 0xe94, 0xe94, 0x3b, 0xe8a, 0xeb2,
0xea3, 0xeab, 0xeb4, 0xea7, 0xeb2, 0x3b, 0xec0, 0xea1, 0xeb5, 0x3b, 0xead, 0xeb2, 0xe9a, 0xeb2, 0xe99, 0x3b, 0xead, 0xeb2, 0xe8a, 0xeb2,
0xea3, 0x3b, 0xe94, 0xeb5, 0xea3, 0x3b, 0xe9a, 0xea3, 0xeb2, 0xec1, 0xea1, 0xe99, 0x3b, 0xec0, 0xead, 0xeaa, 0xe9f, 0xeb2, 0xe99, 0xe9f,
0xea3, 0xeb2, 0xea7, 0xeb2, 0xe94, 0xeb4, 0xe99, 0x3b, 0xead, 0xecd, 0xea3, 0xe94, 0xeb5, 0xe9a, 0xeb5, 0xec0, 0xeab, 0xeae, 0xe94, 0x3b,
0xe84, 0xecd, 0xea3, 0xec0, 0xe94, 0xe94, 0x3b, 0xec1, 0xe95, 0xea3, 0x3b, 0xea1, 0xecd, 0xea3, 0xec0, 0xe94, 0xe94, 0x3b, 0xe8a, 0xeb2,
0xea3, 0xea5, 0xeb4, 0xea7, 0xeb2, 0x3b, 0xec0, 0xea1, 0xeb5, 0x3b, 0xead, 0xeb2, 0xe9a, 0xeb2, 0xe99, 0x3b, 0xead, 0xeb2, 0xe8a, 0xeb2,
0x3b, 0xe94, 0xeb5, 0xea3, 0x3b, 0xe9a, 0xea3, 0xeb2, 0xea1, 0xeb2, 0xe99, 0x3b, 0xec0, 0xead, 0xeaa, 0xe9f, 0xeb2, 0xe99, 0xe9f, 0xeb2,
0xea3, 0xea7, 0xeb2, 0xe94, 0xeb4, 0xe99, 0x3b, 0xead, 0xecd, 0xea3, 0xe94, 0xeb5, 0xe9a, 0xeb5, 0xec0, 0xeab, 0xea3, 0xe94, 0x3b, 0xe84,
0xecd, 0xea3, 0xec0, 0xe94, 0xe94, 0x3b, 0xec1, 0xe95, 0xea3, 0x3b, 0xea1, 0xecd, 0xea3, 0xec0, 0xe94, 0xe94, 0x3b, 0xe8a, 0xeb2, 0xea3,
0xeab, 0xeb4, 0xea7, 0xeb2, 0x3b, 0xec0, 0xea1, 0xeb5, 0x3b, 0xead, 0xeb2, 0xe9a, 0xeb2, 0xe99, 0x3b, 0xead, 0xeb2, 0xe8a, 0xeb2, 0x3b,
0xe94, 0xeb5, 0xea3, 0x3b, 0xe9a, 0xea3, 0xeb2, 0xea1, 0xeb2, 0xe99, 0x3b, 0xec0, 0xead, 0xeaa, 0xe9f, 0xeb2, 0xe99, 0x66, 0x61, 0x72,
0x76, 0x61, 0x72, 0x64, 0x12b, 0x6e, 0x73, 0x3b, 0x6f, 0x72, 0x64, 0x69, 0x62, 0x65, 0x68, 0x65, 0x161, 0x74, 0x73, 0x3b,
0x68, 0x6f, 0x72, 0x64, 0x101, 0x64, 0x73, 0x3b, 0x74, 0x12b, 0x72, 0x73, 0x3b, 0x6d, 0x6f, 0x72, 0x64, 0x101, 0x64, 0x73,
0x3b, 0x161, 0x61, 0x68, 0x72, 0x69, 0x76, 0x113, 0x72, 0x73, 0x3b, 0x6d, 0x65, 0x68, 0x72, 0x73, 0x3b, 0x61, 0x62, 0x61,
0x6e, 0x73, 0x3b, 0x61, 0x7a, 0x65, 0x72, 0x73, 0x3b, 0x64, 0x65, 0x6a, 0x73, 0x3b, 0x62, 0x61, 0x68, 0x6d, 0x61, 0x6e,
0x73, 0x3b, 0x65, 0x73, 0x66, 0x61, 0x6e, 0x64, 0x73, 0x444, 0x430, 0x440, 0x432, 0x430, 0x440, 0x434, 0x438, 0x43d, 0x3b, 0x43e,
0x440, 0x434, 0x438, 0x431, 0x435, 0x445, 0x435, 0x448, 0x442, 0x3b, 0x43a, 0x43e, 0x440, 0x434, 0x430, 0x434, 0x3b, 0x442, 0x438, 0x440,
0x3b, 0x43c, 0x43e, 0x440, 0x434, 0x430, 0x434, 0x3b, 0x448, 0x430, 0x445, 0x440, 0x438, 0x432, 0x430, 0x440, 0x3b, 0x43c, 0x435, 0x440,
0x3b, 0x430, 0x431, 0x430, 0x43d, 0x3b, 0x430, 0x437, 0x430, 0x440, 0x3b, 0x434, 0x435, 0x458, 0x3b, 0x431, 0x430, 0x445, 0x43c, 0x430,
0x43d, 0x3b, 0x435, 0x441, 0x444, 0x430, 0x43d, 0x434, 0xd2b, 0xd7c, 0xd35, 0xd3e, 0xd7c, 0xd26, 0xd3f, 0xd7b, 0x3b, 0xd13, 0xd7c, 0xd21,
0xd3f, 0xd2c, 0xd46, 0xd39, 0xd46, 0xd37, 0xd4d, 0x200c, 0xd31, 0xd4d, 0xd31, 0xd4d, 0x3b, 0xd16, 0xd4b, 0xd7c, 0xd26, 0xd3e, 0xd26, 0xd4d,
0x3b, 0xd1f, 0xd3f, 0xd7c, 0x3b, 0xd2e, 0xd4b, 0xd7c, 0xd26, 0xd3e, 0xd26, 0xd4d, 0x3b, 0xd37, 0xd39, 0xd4d, 0x200c, 0xd30, 0xd3f, 0xd35,
0xd3e, 0xd7c, 0x3b, 0xd2e, 0xd46, 0xd39, 0xd7c, 0x3b, 0xd05, 0xd2c, 0xd3e, 0xd7b, 0x3b, 0xd05, 0xd38, 0xd7c, 0x3b, 0xd21, 0xd46, 0xd2f,
0xd4d, 0x3b, 0xd2c, 0xd39, 0xd4d, 0x200c, 0xd2e, 0xd3e, 0xd7b, 0x3b, 0xd0e, 0xd38, 0xd4d, 0x200c, 0xd2b, 0xd3e, 0xd7b, 0xd21, 0xd4d, 0xd2b,
0x2e, 0x3b, 0xd13, 0x2e, 0x3b, 0xd16, 0xd4b, 0x3b, 0xd1f, 0xd3f, 0x2e, 0x3b, 0xd2e, 0xd4b, 0x2e, 0x3b, 0xd37, 0x2e, 0x3b, 0xd2e,
0xd46, 0x2e, 0x3b, 0xd05, 0x2e, 0x3b, 0xd05, 0x2e, 0x3b, 0xd21, 0xd46, 0x2e, 0x3b, 0xd2c, 0x2e, 0x3b, 0xd0e, 0x2e, 0x92b, 0x930,
0x935, 0x930, 0x926, 0x93f, 0x928, 0x3b, 0x913, 0x930, 0x94d, 0x926, 0x93f, 0x92c, 0x947, 0x939, 0x947, 0x936, 0x94d, 0x924, 0x3b, 0x916,
0x94b, 0x930, 0x926, 0x93e, 0x926, 0x3b, 0x924, 0x93f, 0x930, 0x3b, 0x92e, 0x94b, 0x930, 0x926, 0x93e, 0x926, 0x3b, 0x936, 0x93e, 0x939,
0x930, 0x940, 0x935, 0x93e, 0x930, 0x3b, 0x92e, 0x947, 0x939, 0x947, 0x930, 0x3b, 0x905, 0x92c, 0x93e, 0x928, 0x3b, 0x905, 0x91d, 0x93e,
0x930, 0x3b, 0x926, 0x947, 0x3b, 0x92c, 0x93e, 0x939, 0x92e, 0x93e, 0x928, 0x3b, 0x90f, 0x938, 0x92b, 0x93e, 0x902, 0x926, 0x967, 0x3b,
0x968, 0x3b, 0x969, 0x3b, 0x96a, 0x3b, 0x96b, 0x3b, 0x96c, 0x3b, 0x96d, 0x3b, 0x96e, 0x3b, 0x96f, 0x3b, 0x967, 0x966, 0x3b, 0x967,
0x967, 0x3b, 0x967, 0x968, 0x648, 0x631, 0x6cc, 0x3b, 0x63a, 0x648, 0x6cc, 0x6cc, 0x3b, 0x63a, 0x628, 0x631, 0x6af, 0x648, 0x644, 0x6cc,
0x3b, 0x686, 0x646, 0x6af, 0x627, 0x69a, 0x3b, 0x632, 0x645, 0x631, 0x6cc, 0x3b, 0x648, 0x696, 0x6cc, 0x3b, 0x62a, 0x644, 0x647, 0x3b,
0x644, 0x693, 0x645, 0x3b, 0x644, 0x6cc, 0x646, 0x62f, 0x6cd, 0x3b, 0x645, 0x631, 0x63a, 0x648, 0x645, 0x6cc, 0x3b, 0x633, 0x644, 0x648,
0x627, 0x63a, 0x647, 0x3b, 0x6a9, 0x628, 0x6f1, 0x3b, 0x6f2, 0x3b, 0x6f3, 0x3b, 0x6f4, 0x3b, 0x6f5, 0x3b, 0x6f6, 0x3b, 0x6f7, 0x3b,
0x6f8, 0x3b, 0x6f9, 0x3b, 0x6f1, 0x6f0, 0x3b, 0x6f1, 0x6f1, 0x3b, 0x6f1, 0x6f2, 0x641, 0x631, 0x648, 0x631, 0x62f, 0x6cc, 0x646, 0x3b,
0x627, 0x631, 0x62f, 0x6cc, 0x628, 0x647, 0x634, 0x62a, 0x3b, 0x62e, 0x631, 0x62f, 0x627, 0x62f, 0x3b, 0x62a, 0x6cc, 0x631, 0x3b, 0x645,
0x631, 0x62f, 0x627, 0x62f, 0x3b, 0x634, 0x647, 0x631, 0x6cc, 0x648, 0x631, 0x3b, 0x645, 0x647, 0x631, 0x3b, 0x622, 0x628, 0x627, 0x646,
0x3b, 0x622, 0x630, 0x631, 0x3b, 0x62f, 0x6cc, 0x3b, 0x628, 0x647, 0x645, 0x646, 0x3b, 0x627, 0x633, 0x641, 0x646, 0x62f, 0x641, 0x3b,
0x627, 0x3b, 0x62e, 0x3b, 0x62a, 0x3b, 0x645, 0x3b, 0x634, 0x3b, 0x645, 0x3b, 0x622, 0x3b, 0x622, 0x3b, 0x62f, 0x3b, 0x628, 0x3b,
0x627, 0x62d, 0x645, 0x644, 0x3b, 0x62b, 0x648, 0x631, 0x3b, 0x62c, 0x648, 0x632, 0x627, 0x3b, 0x633, 0x631, 0x637, 0x627, 0x646, 0x3b,
0x627, 0x633, 0x62f, 0x3b, 0x633, 0x646, 0x628, 0x644, 0x647, 0x654, 0x3b, 0x645, 0x6cc, 0x632, 0x627, 0x646, 0x3b, 0x639, 0x642, 0x631,
0x628, 0x3b, 0x642, 0x648, 0x633, 0x3b, 0x62c, 0x62f, 0x6cc, 0x3b, 0x62f, 0x644, 0x648, 0x3b, 0x62d, 0x648, 0x62a, 0x62d, 0x3b, 0x62b,
0x3b, 0x62c, 0x3b, 0x633, 0x3b, 0x627, 0x3b, 0x633, 0x3b, 0x645, 0x3b, 0x639, 0x3b, 0x642, 0x3b, 0x62c, 0x3b, 0x62f, 0x3b, 0x62d,
0x46, 0x61, 0x72, 0x77, 0x61, 0x72, 0x64, 0x69, 0x6e, 0x3b, 0x4f, 0x72, 0x64, 0x69, 0x62, 0x65, 0x68, 0x65, 0x73, 0x7a,
0x74, 0x3b, 0x43, 0x68, 0x6f, 0x72, 0x64, 0x101, 0x64, 0x3b, 0x54, 0x69, 0x72, 0x3b, 0x4d, 0x6f, 0x72, 0x64, 0x101, 0x64,
0x3b, 0x53, 0x7a, 0x61, 0x68, 0x72, 0x69, 0x77, 0x61, 0x72, 0x3b, 0x4d, 0x65, 0x68, 0x72, 0x3b, 0x100, 0x62, 0x101, 0x6e,
0x3b, 0x100, 0x73, 0x61, 0x72, 0x3b, 0x44, 0xe9, 0x69, 0x3b, 0x42, 0x61, 0x68, 0x6d, 0x61, 0x6e, 0x3b, 0x45, 0x73, 0x66,
0x61, 0x6e, 0x64, 0xa2b, 0xa3e, 0xa30, 0xa35, 0xa30, 0xa21, 0xa40, 0xa28, 0x3b, 0xa14, 0xa30, 0xa21, 0xa3e, 0xa08, 0xa2c, 0xa39, 0xa48,
0xa38, 0xa3c, 0xa1f, 0x3b, 0xa16, 0xa4b, 0xa21, 0xa30, 0xa21, 0x3b, 0xa1f, 0xa3f, 0xa30, 0x3b, 0xa2e, 0xa4b, 0xa30, 0xa21, 0xa3e, 0xa26,
0x3b, 0xa38, 0xa3c, 0xa30, 0xa3e, 0xa07, 0xa35, 0xa30, 0x3b, 0xa2e, 0xa47, 0xa39, 0xa30, 0x3b, 0xa05, 0xa2c, 0xa3e, 0xa28, 0x3b, 0xa05,
0xa1c, 0xa3c, 0xa3e, 0xa30, 0x3b, 0xa21, 0xa47, 0xa05, 0x3b, 0xa2c, 0xa3e, 0xa39, 0xa2e, 0xa28, 0x3b, 0xa10, 0xa38, 0xa2b, 0xa70, 0xa21,
0x46, 0x61, 0x72, 0x76, 0x61, 0x72, 0x64, 0x69, 0x6e, 0x3b, 0x4f, 0x72, 0x64, 0x69, 0x62, 0x65, 0x68, 0x65, 0x73, 0x68,
0x74, 0x3b, 0x4b, 0x68, 0x6f, 0x72, 0x64, 0x61, 0x64, 0x3b, 0x54, 0x69, 0x72, 0x3b, 0x41, 0x2d, 0x4d, 0x6f, 0x72, 0x64,
0x61, 0x64, 0x3b, 0x53, 0x68, 0x61, 0x68, 0x72, 0x69, 0x76, 0x61, 0x72, 0x3b, 0x4d, 0x65, 0x68, 0x72, 0x3b, 0x41, 0x62,
0x61, 0x6e, 0x3b, 0x41, 0x7a, 0x61, 0x72, 0x3b, 0x44, 0x65, 0x79, 0x3b, 0x42, 0x61, 0x68, 0x6d, 0x61, 0x6e, 0x3b, 0x45,
0x73, 0x66, 0x61, 0x6e, 0x64, 0x444, 0x430, 0x440, 0x432, 0x430, 0x440, 0x434, 0x438, 0x43d, 0x3b, 0x43e, 0x440, 0x434, 0x438, 0x431,
0x435, 0x445, 0x435, 0x448, 0x442, 0x3b, 0x445, 0x43e, 0x440, 0x434, 0x430, 0x434, 0x3b, 0x442, 0x438, 0x440, 0x3b, 0x43c, 0x43e, 0x440,
0x434, 0x430, 0x434, 0x3b, 0x448, 0x430, 0x445, 0x440, 0x438, 0x432, 0x435, 0x440, 0x3b, 0x43c, 0x435, 0x445, 0x440, 0x3b, 0x430, 0x431,
0x430, 0x43d, 0x3b, 0x430, 0x437, 0x435, 0x440, 0x3b, 0x434, 0x435, 0x439, 0x3b, 0x431, 0x430, 0x445, 0x43c, 0x430, 0x43d, 0x3b, 0x44d,
0x441, 0x444, 0x430, 0x43d, 0x434, 0x66, 0x61, 0x72, 0x2e, 0x3b, 0x6f, 0x72, 0x64, 0x2e, 0x3b, 0x6b, 0x68, 0x6f, 0x2e, 0x3b,
0x74, 0x69, 0x72, 0x3b, 0x6d, 0x6f, 0x72, 0x2e, 0x3b, 0x73, 0x68, 0x61, 0x2e, 0x3b, 0x6d, 0x65, 0x68, 0x72, 0x3b, 0x61,
0x62, 0x61, 0x6e, 0x3b, 0x61, 0x7a, 0x61, 0x72, 0x3b, 0x64, 0x65, 0x79, 0x3b, 0x62, 0x61, 0x68, 0x2e, 0x3b, 0x65, 0x73,
0x66, 0x2e, 0x46, 0x61, 0x72, 0x61, 0x76, 0x61, 0x64, 0x69, 0x6e, 0x3b, 0x4f, 0x72, 0x64, 0x69, 0x62, 0x65, 0x68, 0x65,
0x161, 0x74, 0x3b, 0x4b, 0x6f, 0x72, 0x64, 0x61, 0x64, 0x3b, 0x54, 0x69, 0x72, 0x3b, 0x4d, 0x6f, 0x72, 0x64, 0x61, 0x64,
0x3b, 0x160, 0x61, 0x68, 0x72, 0x69, 0x76, 0x61, 0x72, 0x3b, 0x4d, 0x65, 0x68, 0x72, 0x3b, 0x41, 0x62, 0x61, 0x6e, 0x3b,
0x41, 0x7a, 0x61, 0x72, 0x3b, 0x44, 0x65, 0x6a, 0x3b, 0x42, 0x61, 0x68, 0x6d, 0x61, 0x6e, 0x3b, 0x45, 0x73, 0x66, 0x61,
0x6e, 0x64, 0x4a, 0x61, 0x6e, 0x61, 0x61, 0x79, 0x6f, 0x3b, 0x46, 0x65, 0x65, 0x62, 0x72, 0x61, 0x61, 0x79, 0x6f, 0x3b,
0x4d, 0x61, 0x61, 0x72, 0x73, 0x6f, 0x3b, 0x41, 0x62, 0x72, 0x69, 0x6c, 0x3b, 0x4d, 0x61, 0x61, 0x79, 0x6f, 0x3b, 0x4a,
0x75, 0x75, 0x6e, 0x3b, 0x4c, 0x75, 0x75, 0x6c, 0x69, 0x79, 0x6f, 0x3b, 0x41, 0x67, 0x6f, 0x6f, 0x73, 0x74, 0x6f, 0x3b,
0x53, 0x61, 0x62, 0x74, 0x65, 0x65, 0x6d, 0x62, 0x61, 0x72, 0x3b, 0x4f, 0x6b, 0x74, 0x6f, 0x6f, 0x62, 0x61, 0x72, 0x3b,
0x4e, 0x6f, 0x6f, 0x66, 0x65, 0x65, 0x6d, 0x62, 0x61, 0x72, 0x3b, 0x44, 0x69, 0x69, 0x73, 0x65, 0x65, 0x6d, 0x62, 0x61,
0x72, 0x46, 0x61, 0x72, 0x76, 0x61, 0x72, 0x64, 0x69, 0x6e, 0x3b, 0x4f, 0x72, 0x64, 0x69, 0x62, 0x65, 0x68, 0x65, 0x73,
0x68, 0x74, 0x3b, 0x4b, 0x68, 0x6f, 0x72, 0x64, 0x101, 0x64, 0x3b, 0x54, 0x69, 0x72, 0x3b, 0x4d, 0x6f, 0x72, 0x64, 0x101,
0x64, 0x3b, 0x53, 0x68, 0x61, 0x68, 0x72, 0x69, 0x76, 0x61, 0x72, 0x3b, 0x4d, 0x65, 0x68, 0x72, 0x3b, 0x100, 0x62, 0x101,
0x6e, 0x3b, 0x100, 0x7a, 0x61, 0x72, 0x3b, 0x44, 0x65, 0x79, 0x3b, 0x42, 0x61, 0x68, 0x6d, 0x61, 0x6e, 0x3b, 0x45, 0x73,
0x66, 0x61, 0x6e, 0x64, 0x66, 0x61, 0x72, 0x76, 0x61, 0x72, 0x64, 0x69, 0x6e, 0x3b, 0x6f, 0x72, 0x64, 0x69, 0x62, 0x65,
0x68, 0x65, 0x73, 0x68, 0x74, 0x3b, 0x6b, 0x68, 0x6f, 0x72, 0x64, 0x101, 0x64, 0x3b, 0x74, 0x69, 0x72, 0x3b, 0x6d, 0x6f,
0x72, 0x64, 0x101, 0x64, 0x3b, 0x73, 0x68, 0x61, 0x68, 0x72, 0x69, 0x76, 0x61, 0x72, 0x3b, 0x6d, 0x65, 0x68, 0x72, 0x3b,
0x101, 0x62, 0x101, 0x6e, 0x3b, 0x101, 0x7a, 0x61, 0x72, 0x3b, 0x64, 0x65, 0x79, 0x3b, 0x62, 0x61, 0x68, 0x6d, 0x61, 0x6e,
0x3b, 0x65, 0x73, 0x66, 0x61, 0x6e, 0x64, 0x444, 0x430, 0x440, 0x432, 0x430, 0x440, 0x434, 0x438, 0x43d, 0x3b, 0x443, 0x440, 0x434,
0x438, 0x431, 0x438, 0x4b3, 0x438, 0x448, 0x442, 0x3b, 0x445, 0x443, 0x440, 0x434, 0x43e, 0x434, 0x3b, 0x442, 0x438, 0x440, 0x3b, 0x43c,
0x443, 0x440, 0x434, 0x43e, 0x434, 0x3b, 0x448, 0x430, 0x4b3, 0x440, 0x438, 0x432, 0x430, 0x440, 0x3b, 0x43c, 0x435, 0x4b3, 0x440, 0x3b,
0x43e, 0x431, 0x43e, 0x43d, 0x3b, 0x43e, 0x437, 0x430, 0x440, 0x3b, 0x434, 0x435, 0x439, 0x3b, 0x431, 0x430, 0x4b3, 0x43c, 0x430, 0x43d,
0x3b, 0x438, 0x441, 0x444, 0x430, 0x43d, 0x434, 0xb83, 0xbaa, 0xbb0, 0xbcd, 0xbb5, 0xbbe, 0xba4, 0xbbf, 0xba9, 0xbcd, 0x3b, 0xb86, 0xbb0,
0xbcd, 0xb9f, 0xbbf, 0xbaa, 0xbc6, 0xbb9, 0xbc6, 0xbb7, 0xbcd, 0xba4, 0xbcd, 0x3b, 0xb95, 0xbca, 0xbb0, 0xbcd, 0xba4, 0xbbe, 0xba4, 0xbcd,
0x3b, 0xba4, 0xbbf, 0xbb0, 0xbcd, 0x3b, 0xbae, 0xbca, 0xbb0, 0xbcd, 0xba4, 0xbbe, 0xba4, 0xbcd, 0x3b, 0xbb7, 0xbbe, 0xbb0, 0xbbf, 0xbb5,
0xbbe, 0xbb0, 0xbcd, 0x3b, 0xbae, 0xbc6, 0xbb9, 0xbcd, 0xbb0, 0xbcd, 0x3b, 0xb85, 0xbaa, 0xbbe, 0xba9, 0xbcd, 0x3b, 0xb85, 0xb9a, 0xbbe,
0xbb0, 0xbcd, 0x3b, 0xba4, 0xbc7, 0x3b, 0xbaa, 0xbb9, 0xbcd, 0xbae, 0xbbe, 0xba9, 0xbcd, 0x3b, 0xb8e, 0xb83, 0xbaa, 0xbbe, 0xba9, 0xbcd,
0xb83, 0xbaa, 0xbb0, 0xbcd, 0x2e, 0x3b, 0xb86, 0xbb0, 0xbcd, 0xb9f, 0xbbf, 0x2e, 0x3b, 0xb95, 0xbca, 0xbb0, 0xbcd, 0x2e, 0x3b, 0xba4,
0xbbf, 0xbb0, 0xbcd, 0x3b, 0xbae, 0xbca, 0xbb0, 0xbcd, 0x2e, 0x3b, 0xbb7, 0xbbe, 0xbb0, 0xbbf, 0x2e, 0x3b, 0xbae, 0xbc6, 0xbb9, 0xbcd,
0x2e, 0x3b, 0xb85, 0xbaa, 0xbbe, 0x2e, 0x3b, 0xb85, 0xb9a, 0xbbe, 0x2e, 0x3b, 0xba4, 0xbc7, 0x3b, 0xbaa, 0xbb9, 0xbcd, 0x2e, 0x3b,
0xb8e, 0xb83, 0x2e, 0xc2b, 0xc3e, 0xc35, 0xc30, 0xc4d, 0xc21, 0xc3f, 0xc28, 0xc4d, 0x3b, 0xc0a, 0xc21, 0xc3e, 0xc2c, 0xc39, 0xc37, 0xc4d,
0xc1f, 0xc4d, 0x3b, 0xc16, 0xc4b, 0xc30, 0xc4d, 0xc21, 0xc3e, 0xc21, 0xc4d, 0x3b, 0xc1f, 0xc3f, 0xc30, 0xc4d, 0x3b, 0xc2e, 0xc46, 0xc30,
0xc4d, 0xc21, 0xc3e, 0xc21, 0xc4d, 0x3b, 0xc36, 0xc36, 0xc3f, 0xc35, 0xc30, 0xc4d, 0x3b, 0xc2e, 0xc46, 0xc39, 0xc30, 0xc4d, 0x3b, 0xc05,
0xc2c, 0xc28, 0xc4d, 0x3b, 0xc05, 0xc1c, 0xc30, 0xc4d, 0x3b, 0xc21, 0xc47, 0x3b, 0xc2c, 0xc3e, 0xc39, 0xc4d, 0x200c, 0xc2e, 0xc3e, 0xc28,
0xc4d, 0x3b, 0xc0e, 0xc38, 0xc4d, 0x200c, 0xc2b, 0xc3e, 0xc02, 0xc21, 0xc4d, 0xe1f, 0xe32, 0xe23, 0xe4c, 0xe27, 0xe32, 0xe23, 0xe4c, 0xe14,
0xe34, 0xe19, 0x3b, 0xe2d, 0xe2d, 0xe23, 0xe4c, 0xe14, 0xe34, 0xe40, 0xe1a, 0xe40, 0xe2e, 0xe0a, 0xe15, 0xe4c, 0x3b, 0xe04, 0xe2d, 0xe23,
0xe4c, 0xe41, 0xe14, 0xe14, 0x3b, 0xe40, 0xe15, 0xe2d, 0xe23, 0xe4c, 0x3b, 0xe21, 0xe2d, 0xe23, 0xe4c, 0xe41, 0xe14, 0xe14, 0x3b, 0xe0a,
0xe32, 0xe2b, 0xe23, 0xe34, 0xe27, 0xe32, 0xe23, 0xe4c, 0x3b, 0xe40, 0xe21, 0xe2e, 0xe23, 0xe4c, 0x3b, 0xe2d, 0xe30, 0xe1a, 0xe32, 0xe19,
0x3b, 0xe2d, 0xe30, 0xe0b, 0xe32, 0xe23, 0xe4c, 0x3b, 0xe40, 0xe14, 0xe22, 0xe4c, 0x3b, 0xe1a, 0xe32, 0xe2e, 0xe4c, 0xe21, 0xe32, 0xe19,
0x3b, 0xe40, 0xe2d, 0xe2a, 0xe1f, 0xe32, 0xe19, 0xe14, 0xe4c, 0x46, 0x65, 0x72, 0x76, 0x65, 0x72, 0x64, 0x69, 0x6e, 0x3b, 0x4f,
0x72, 0x64, 0x69, 0x62, 0x65, 0x68, 0x65, 0x15f, 0x74, 0x3b, 0x48, 0x6f, 0x72, 0x64, 0x61, 0x64, 0x3b, 0x54, 0x69, 0x72,
0x3b, 0x4d, 0x6f, 0x72, 0x64, 0x61, 0x64, 0x3b, 0x15e, 0x65, 0x68, 0x72, 0x69, 0x76, 0x65, 0x72, 0x3b, 0x4d, 0x65, 0x68,
0x72, 0x3b, 0x41, 0x62, 0x61, 0x6e, 0x3b, 0x41, 0x7a, 0x65, 0x72, 0x3b, 0x44, 0x65, 0x79, 0x3b, 0x42, 0x65, 0x68, 0x6d,
0x65, 0x6e, 0x3b, 0x45, 0x73, 0x66, 0x65, 0x6e, 0x64, 0x444, 0x430, 0x440, 0x432, 0x430, 0x440, 0x434, 0x456, 0x43d, 0x3b, 0x43e,
0x440, 0x434, 0x456, 0x431, 0x435, 0x445, 0x435, 0x448, 0x442, 0x3b, 0x445, 0x43e, 0x440, 0x434, 0x430, 0x434, 0x3b, 0x442, 0x456, 0x440,
0x3b, 0x43c, 0x43e, 0x440, 0x434, 0x430, 0x434, 0x3b, 0x448, 0x430, 0x445, 0x440, 0x456, 0x432, 0x435, 0x440, 0x3b, 0x43c, 0x435, 0x445,
0x440, 0x3b, 0x430, 0x431, 0x430, 0x43d, 0x3b, 0x430, 0x437, 0x435, 0x440, 0x3b, 0x434, 0x435, 0x439, 0x3b, 0x431, 0x430, 0x445, 0x43c,
0x430, 0x43d, 0x3b, 0x435, 0x441, 0x444, 0x430, 0x43d, 0x434, 0x444, 0x430, 0x440, 0x3b, 0x43e, 0x440, 0x434, 0x3b, 0x445, 0x43e, 0x440,
0x3b, 0x442, 0x456, 0x440, 0x3b, 0x43c, 0x43e, 0x440, 0x3b, 0x448, 0x430, 0x445, 0x3b, 0x43c, 0x435, 0x445, 0x3b, 0x430, 0x431, 0x430,
0x43d, 0x3b, 0x430, 0x437, 0x435, 0x440, 0x3b, 0x434, 0x435, 0x439, 0x3b, 0x431, 0x430, 0x445, 0x3b, 0x435, 0x441, 0x444, 0x444, 0x430,
0x440, 0x2e, 0x3b, 0x43e, 0x440, 0x434, 0x2e, 0x3b, 0x445, 0x43e, 0x440, 0x2e, 0x3b, 0x442, 0x456, 0x440, 0x3b, 0x43c, 0x43e, 0x440,
0x2e, 0x3b, 0x448, 0x430, 0x445, 0x2e, 0x3b, 0x43c, 0x435, 0x445, 0x2e, 0x3b, 0x430, 0x431, 0x430, 0x43d, 0x3b, 0x430, 0x437, 0x435,
0x440, 0x3b, 0x434, 0x435, 0x439, 0x3b, 0x431, 0x430, 0x445, 0x2e, 0x3b, 0x435, 0x441, 0x444, 0x2e, 0x641, 0x631, 0x648, 0x631, 0x62f,
0x646, 0x3b, 0x622, 0x631, 0x688, 0x628, 0x627, 0x626, 0x634, 0x3b, 0x62e, 0x62f, 0x627, 0x62f, 0x627, 0x62f, 0x3b, 0x62a, 0x6cc, 0x631,
0x3b, 0x645, 0x631, 0x62f, 0x627, 0x62f, 0x3b, 0x634, 0x6c1, 0x631, 0x6cc, 0x648, 0x627, 0x631, 0x3b, 0x645, 0x6c1, 0x631, 0x3b, 0x627,
0x628, 0x627, 0x646, 0x3b, 0x622, 0x632, 0x631, 0x3b, 0x688, 0x6d2, 0x3b, 0x628, 0x6c1, 0x645, 0x646, 0x3b, 0x627, 0x633, 0x641, 0x646,
0x62f, 0x66, 0x61, 0x72, 0x76, 0x61, 0x72, 0x64, 0x69, 0x6e, 0x3b, 0x6f, 0x2bb, 0x72, 0x64, 0x69, 0x62, 0x65, 0x68, 0x69,
0x73, 0x68, 0x74, 0x3b, 0x78, 0x75, 0x72, 0x64, 0x6f, 0x64, 0x3b, 0x74, 0x75, 0x72, 0x3b, 0x6d, 0x75, 0x72, 0x64, 0x6f,
0x64, 0x3b, 0x73, 0x68, 0x61, 0x68, 0x72, 0x69, 0x76, 0x61, 0x72, 0x3b, 0x6d, 0x65, 0x68, 0x72, 0x3b, 0x6f, 0x62, 0x6f,
0x6e, 0x3b, 0x6f, 0x7a, 0x61, 0x72, 0x3b, 0x64, 0x65, 0x79, 0x3b, 0x62, 0x61, 0x68, 0x6d, 0x61, 0x6e, 0x3b, 0x69, 0x73,
0x66, 0x61, 0x6e, 0x64, 0x66, 0x61, 0x72, 0x76, 0x61, 0x72, 0x64, 0x69, 0x6e, 0x3b, 0x6f, 0x2bb, 0x72, 0x64, 0x69, 0x62,
0x65, 0x68, 0x69, 0x73, 0x68, 0x74, 0x3b, 0x78, 0x75, 0x72, 0x64, 0x6f, 0x64, 0x3b, 0x74, 0x69, 0x72, 0x3b, 0x6d, 0x75,
0x72, 0x64, 0x6f, 0x64, 0x3b, 0x73, 0x68, 0x61, 0x68, 0x72, 0x69, 0x76, 0x61, 0x72, 0x3b, 0x6d, 0x65, 0x68, 0x72, 0x3b,
0x6f, 0x62, 0x6f, 0x6e, 0x3b, 0x6f, 0x7a, 0x61, 0x72, 0x3b, 0x64, 0x65, 0x79, 0x3b, 0x62, 0x61, 0x68, 0x6d, 0x61, 0x6e,
0x3b, 0x69, 0x73, 0x66, 0x61, 0x6e, 0x66, 0x61, 0x72, 0x76, 0x61, 0x72, 0x64, 0x69, 0x6e, 0x3b, 0x6f, 0x2bb, 0x72, 0x64,
0x69, 0x62, 0x65, 0x68, 0x69, 0x73, 0x68, 0x74, 0x3b, 0x78, 0x75, 0x72, 0x64, 0x6f, 0x64, 0x3b, 0x74, 0x69, 0x72, 0x3b,
0x6d, 0x75, 0x72, 0x64, 0x6f, 0x64, 0x3b, 0x73, 0x68, 0x61, 0x68, 0x72, 0x69, 0x76, 0x61, 0x72, 0x3b, 0x6d, 0x65, 0x68,
0x72, 0x3b, 0x6f, 0x62, 0x6f, 0x6e, 0x3b, 0x6f, 0x7a, 0x61, 0x72, 0x3b, 0x64, 0x65, 0x79, 0x3b, 0x62, 0x61, 0x68, 0x6d,
0x61, 0x6e, 0x3b, 0x69, 0x73, 0x66, 0x61, 0x6e, 0x64
};
// GENERATED PART ENDS HERE
} // namespace QtPrivate::Jalali
QT_END_NAMESPACE
#endif

View File

@@ -0,0 +1,49 @@
// Copyright (C) 2020 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 QJALALI_CALENDAR_P_H
#define QJALALI_CALENDAR_P_H
//
// W A R N I N G
// -------------
//
// This file is not part of the Qt API. It exists for the convenience
// of calendar implementations. This header file may change from version to
// version without notice, or even be removed.
//
// We mean it.
//
#include "qcalendarbackend_p.h"
QT_REQUIRE_CONFIG(jalalicalendar);
QT_BEGIN_NAMESPACE
class Q_CORE_EXPORT QJalaliCalendar : public QCalendarBackend
{
public:
// Calendar properties:
QString name() const override;
static QStringList nameList();
// Date queries:
int daysInMonth(int month, int year = QCalendar::Unspecified) const override;
bool isLeapYear(int year) const override;
// Properties of the calendar
bool isLunar() const override;
bool isLuniSolar() const override;
bool isSolar() const override;
// Julian Day conversions:
bool dateToJulianDay(int year, int month, int day, qint64 *jd) const override;
QCalendar::YearMonthDay julianDayToDate(qint64 jd) const override;
protected:
// locale support:
const QCalendarLocale *localeMonthIndexData() const override;
const char16_t *localeMonthData() const override;
};
QT_END_NAMESPACE
#endif // QJALALI_CALENDAR_P_H

View File

@@ -0,0 +1,219 @@
// Copyright (C) 2016 The Qt Company Ltd.
// Copyright (C) 2016 Intel Corporation.
// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only
#ifndef QJSON_P_H
#define QJSON_P_H
//
// W A R N I N G
// -------------
//
// This file is not part of the Qt API. It exists purely as an
// implementation detail. This header file may change from version to
// version without notice, or even be removed.
//
// We mean it.
//
#include <qjsonvalue.h>
#include <qcborvalue.h>
#include <private/qcborvalue_p.h>
#if QT_VERSION < QT_VERSION_CHECK(7, 0, 0) && !defined(QT_BOOTSTRAPPED)
# include <qjsonarray.h>
# include <qjsonobject.h>
#endif
QT_BEGIN_NAMESPACE
namespace QJsonPrivate {
template<typename Element, typename ElementsIterator>
struct ObjectIterator
{
using pointer = Element *;
struct value_type;
struct reference {
reference(Element &ref) : m_key(&ref) {}
reference() = delete;
~reference() = default;
reference(const reference &other) = default;
reference(reference &&other) = default;
reference &operator=(const value_type &value);
reference &operator=(const reference &other)
{
if (m_key != other.m_key) {
key() = other.key();
value() = other.value();
}
return *this;
}
reference &operator=(reference &&other)
{
key() = other.key();
value() = other.value();
return *this;
}
Element &key() { return *m_key; }
Element &value() { return *(m_key + 1); }
const Element &key() const { return *m_key; }
const Element &value() const { return *(m_key + 1); }
private:
Element *m_key;
};
struct value_type {
value_type(reference ref) : m_key(ref.key()), m_value(ref.value()) {}
Element key() const { return m_key; }
Element value() const { return m_value; }
private:
Element m_key;
Element m_value;
};
using difference_type = typename QList<Element>::difference_type;
using iterator_category = std::random_access_iterator_tag;
ObjectIterator() = default;
ObjectIterator(ElementsIterator it) : it(it) {}
ElementsIterator elementsIterator() { return it; }
ObjectIterator operator++(int) { ObjectIterator ret(it); it += 2; return ret; }
ObjectIterator &operator++() { it += 2; return *this; }
ObjectIterator &operator+=(difference_type n) { it += 2 * n; return *this; }
ObjectIterator operator--(int) { ObjectIterator ret(it); it -= 2; return ret; }
ObjectIterator &operator--() { it -= 2; return *this; }
ObjectIterator &operator-=(difference_type n) { it -= 2 * n; return *this; }
reference operator*() const { return *it; }
reference operator[](qsizetype n) const { return it[n * 2]; }
bool operator<(ObjectIterator other) const { return it < other.it; }
bool operator>(ObjectIterator other) const { return it > other.it; }
bool operator<=(ObjectIterator other) const { return it <= other.it; }
bool operator>=(ObjectIterator other) const { return it >= other.it; }
ElementsIterator it;
};
template<typename Element, typename ElementsIterator>
inline ObjectIterator<Element, ElementsIterator> operator+(
ObjectIterator<Element, ElementsIterator> a,
typename ObjectIterator<Element, ElementsIterator>::difference_type n)
{
return {a.elementsIterator() + 2 * n};
}
template<typename Element, typename ElementsIterator>
inline ObjectIterator<Element, ElementsIterator> operator+(
qsizetype n, ObjectIterator<Element, ElementsIterator> a)
{
return {a.elementsIterator() + 2 * n};
}
template<typename Element, typename ElementsIterator>
inline ObjectIterator<Element, ElementsIterator> operator-(
ObjectIterator<Element, ElementsIterator> a,
typename ObjectIterator<Element, ElementsIterator>::difference_type n)
{
return {a.elementsIterator() - 2 * n};
}
template<typename Element, typename ElementsIterator>
inline qsizetype operator-(
ObjectIterator<Element, ElementsIterator> a,
ObjectIterator<Element, ElementsIterator> b)
{
return (a.elementsIterator() - b.elementsIterator()) / 2;
}
template<typename Element, typename ElementsIterator>
inline bool operator!=(
ObjectIterator<Element, ElementsIterator> a,
ObjectIterator<Element, ElementsIterator> b)
{
return a.elementsIterator() != b.elementsIterator();
}
template<typename Element, typename ElementsIterator>
inline bool operator==(
ObjectIterator<Element, ElementsIterator> a,
ObjectIterator<Element, ElementsIterator> b)
{
return a.elementsIterator() == b.elementsIterator();
}
using KeyIterator = ObjectIterator<QtCbor::Element, QList<QtCbor::Element>::iterator>;
using ConstKeyIterator = ObjectIterator<const QtCbor::Element, QList<QtCbor::Element>::const_iterator>;
template<>
inline KeyIterator::reference &KeyIterator::reference::operator=(const KeyIterator::value_type &value)
{
*m_key = value.key();
*(m_key + 1) = value.value();
return *this;
}
inline void swap(KeyIterator::reference a, KeyIterator::reference b)
{
KeyIterator::value_type t = a;
a = b;
b = t;
}
class Value
{
public:
static qint64 valueHelper(const QCborValue &v) { return v.n; }
static QCborContainerPrivate *container(const QCborValue &v) { return v.container; }
static const QCborContainerPrivate *container(QJsonValueConstRef r) noexcept
{
#if QT_VERSION < QT_VERSION_CHECK(7, 0, 0) && !defined(QT_BOOTSTRAPPED)
return (r.is_object ? r.o->o : r.a->a).data();
#else
return r.d;
#endif
}
static QCborContainerPrivate *container(QJsonValueRef r) noexcept
{
return const_cast<QCborContainerPrivate *>(container(QJsonValueConstRef(r)));
}
static qsizetype indexHelper(QJsonValueConstRef r) noexcept
{
qsizetype index = r.index;
if (r.is_object)
index = index * 2 + 1;
return index;
}
static const QtCbor::Element &elementHelper(QJsonValueConstRef r) noexcept
{
return container(r)->elements.at(indexHelper(r));
}
static QJsonValue fromTrustedCbor(const QCborValue &v)
{
QJsonValue result;
result.value = v;
return result;
}
};
class Variant
{
public:
static QJsonObject toJsonObject(const QVariantMap &map);
static QJsonArray toJsonArray(const QVariantList &list);
};
} // namespace QJsonPrivate
QT_END_NAMESPACE
#endif // QJSON_P_H

View File

@@ -0,0 +1,57 @@
// 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 QJSONPARSER_P_H
#define QJSONPARSER_P_H
//
// W A R N I N G
// -------------
//
// This file is not part of the Qt API. It exists purely as an
// implementation detail. This header file may change from version to
// version without notice, or even be removed.
//
// We mean it.
//
#include <QtCore/private/qglobal_p.h>
#include <QtCore/private/qcborvalue_p.h>
#include <QtCore/qjsondocument.h>
QT_BEGIN_NAMESPACE
namespace QJsonPrivate {
class Parser
{
public:
Parser(const char *json, int length);
QCborValue parse(QJsonParseError *error);
private:
inline void eatBOM();
inline bool eatSpace();
inline char nextToken();
bool parseObject();
bool parseArray();
bool parseMember();
bool parseString();
bool parseValue();
bool parseNumber();
const char *head;
const char *json;
const char *end;
int nestingLevel;
QJsonParseError::ParseError lastError;
QExplicitlySharedDataPointer<QCborContainerPrivate> container;
};
}
QT_END_NAMESPACE
#endif

View File

@@ -0,0 +1,37 @@
// 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 QJSONWRITER_P_H
#define QJSONWRITER_P_H
//
// W A R N I N G
// -------------
//
// This file is not part of the Qt API. It exists purely as an
// implementation detail. This header file may change from version to
// version without notice, or even be removed.
//
// We mean it.
//
#include <QtCore/private/qglobal_p.h>
#include <qjsonvalue.h>
QT_BEGIN_NAMESPACE
namespace QJsonPrivate
{
class Writer
{
public:
static void objectToJson(const QCborContainerPrivate *o, QByteArray &json, int indent, bool compact = false);
static void arrayToJson(const QCborContainerPrivate *a, QByteArray &json, int indent, bool compact = false);
};
}
QT_END_NAMESPACE
#endif

View File

@@ -0,0 +1,37 @@
// Copyright (C) 2020 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 QJULIAN_CALENDAR_P_H
#define QJULIAN_CALENDAR_P_H
//
// W A R N I N G
// -------------
//
// This file is not part of the Qt API. It exists for the convenience
// of calendar implementations. This header file may change from version to
// version without notice, or even be removed.
//
// We mean it.
//
#include "qromancalendar_p.h"
QT_BEGIN_NAMESPACE
class Q_CORE_EXPORT QJulianCalendar : public QRomanCalendar
{
public:
// Calendar properties:
QString name() const override;
static QStringList nameList();
// Date queries:
bool isLeapYear(int year) const override;
// Julian Day conversions:
bool dateToJulianDay(int year, int month, int day, qint64 *jd) const override;
QCalendar::YearMonthDay julianDayToDate(qint64 jd) const override;
};
QT_END_NAMESPACE
#endif // QJULIAN_CALENDAR_P_H

View File

@@ -0,0 +1,119 @@
// Copyright (C) 2020 The Qt Company Ltd.
// Copyright (C) 2021 Intel Corporation.
// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only
#ifndef QLIBRARY_P_H
#define QLIBRARY_P_H
//
// W A R N I N G
// -------------
//
// This file is not part of the Qt API. It exists for the convenience
// of the QLibrary class. This header file may change from
// version to version without notice, or even be removed.
//
// We mean it.
//
#include "QtCore/qlibrary.h"
#include "QtCore/private/qfactoryloader_p.h"
#include "QtCore/qloggingcategory.h"
#include "QtCore/qmutex.h"
#include "QtCore/qplugin.h"
#include "QtCore/qpointer.h"
#include "QtCore/qstringlist.h"
#ifdef Q_OS_WIN
# include "QtCore/qt_windows.h"
#endif
#include <memory>
QT_REQUIRE_CONFIG(library);
QT_BEGIN_NAMESPACE
Q_DECLARE_LOGGING_CATEGORY(qt_lcDebugPlugins)
struct QLibraryScanResult
{
qsizetype pos;
qsizetype length;
#if defined(Q_OF_MACH_O)
bool isEncrypted = false;
#endif
};
class QLibraryStore;
class QLibraryPrivate
{
public:
#ifdef Q_OS_WIN
using Handle = HINSTANCE;
#else
using Handle = void *;
#endif
enum UnloadFlag { UnloadSys, NoUnloadSys };
struct Deleter {
// QLibraryPrivate::release() is not, yet, and cannot easily be made, noexcept:
void operator()(QLibraryPrivate *p) const { p->release(); }
};
using UniquePtr = std::unique_ptr<QLibraryPrivate, Deleter>;
const QString fileName;
const QString fullVersion;
bool load();
QtPluginInstanceFunction loadPlugin(); // loads and resolves instance
bool unload(UnloadFlag flag = UnloadSys);
void release();
QFunctionPointer resolve(const char *);
QLibrary::LoadHints loadHints() const
{ return QLibrary::LoadHints(loadHintsInt.loadRelaxed()); }
void setLoadHints(QLibrary::LoadHints lh);
QObject *pluginInstance();
static QLibraryPrivate *findOrCreate(const QString &fileName, const QString &version = QString(),
QLibrary::LoadHints loadHints = { });
static QStringList suffixes_sys(const QString &fullVersion);
static QStringList prefixes_sys();
QAtomicPointer<std::remove_pointer<QtPluginInstanceFunction>::type> instanceFactory;
QAtomicPointer<std::remove_pointer<Handle>::type> pHnd;
// the mutex protects the fields below
QMutex mutex;
QPointer<QObject> inst; // used by QFactoryLoader
QPluginParsedMetaData metaData;
QString errorString;
QString qualifiedFileName;
void updatePluginState();
bool isPlugin();
private:
explicit QLibraryPrivate(const QString &canonicalFileName, const QString &version, QLibrary::LoadHints loadHints);
~QLibraryPrivate();
void mergeLoadHints(QLibrary::LoadHints loadHints);
bool load_sys();
bool unload_sys();
QFunctionPointer resolve_sys(const char *);
QAtomicInt loadHintsInt;
/// counts how many QLibrary or QPluginLoader are attached to us, plus 1 if it's loaded
QAtomicInt libraryRefCount;
/// counts how many times load() or loadPlugin() were called
QAtomicInt libraryUnloadCount;
enum { IsAPlugin, IsNotAPlugin, MightBeAPlugin } pluginState;
friend class QLibraryStore;
};
QT_END_NAMESPACE
#endif // QLIBRARY_P_H

View File

@@ -0,0 +1,57 @@
// Copyright (C) 2021 The Qt Company Ltd.
// Copyright (C) 2016 Intel Corporation.
// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only
#ifndef QLIBRARYINFO_P_H
#define QLIBRARYINFO_P_H
//
// W A R N I N G
// -------------
//
// This file is not part of the Qt API. It exists for the convenience
// of a number of Qt sources files. This header file may change from
// version to version without notice, or even be removed.
//
// We mean it.
//
#include "QtCore/qlibraryinfo.h"
#include "QtCore/private/qglobal_p.h"
#if QT_CONFIG(settings)
# include "QtCore/qsettings.h"
#endif
#include "QtCore/qstring.h"
QT_BEGIN_NAMESPACE
class Q_CORE_EXPORT QLibraryInfoPrivate final
{
public:
#if QT_CONFIG(settings)
static QSettings *configuration();
static void reload();
static const QString *qtconfManualPath;
#endif
struct LocationInfo
{
QString key;
QString defaultValue;
QString fallbackKey;
};
static LocationInfo locationInfo(QLibraryInfo::LibraryPath loc);
enum UsageMode {
RegularUsage,
UsedFromQtBinDir
};
static QString path(QLibraryInfo::LibraryPath p, UsageMode usageMode = RegularUsage);
};
QT_END_NAMESPACE
#endif // QLIBRARYINFO_P_H

File diff suppressed because it is too large Load Diff

View File

@@ -0,0 +1,506 @@
// Copyright (C) 2021 The Qt Company Ltd.
// Copyright (C) 2016 Intel Corporation.
// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only
#ifndef QLOCALE_P_H
#define QLOCALE_P_H
//
// W A R N I N G
// -------------
//
// This file is not part of the Qt API. It exists for the convenience
// of internal files. This header file may change from version to version
// without notice, or even be removed.
//
// We mean it.
//
#include "qlocale.h"
#include <QtCore/private/qglobal_p.h>
#include <QtCore/qcalendar.h>
#include <QtCore/qlist.h>
#include <QtCore/qnumeric.h>
#include <QtCore/qstring.h>
#include <QtCore/qvariant.h>
#include <QtCore/qvarlengtharray.h>
#include <limits>
#include <cmath>
QT_BEGIN_NAMESPACE
struct QLocaleData;
// Subclassed by Android platform plugin:
class Q_CORE_EXPORT QSystemLocale
{
QSystemLocale *next = nullptr; // Maintains a stack.
public:
QSystemLocale();
virtual ~QSystemLocale();
struct CurrencyToStringArgument
{
CurrencyToStringArgument() { }
CurrencyToStringArgument(const QVariant &v, const QString &s)
: value(v), symbol(s) { }
QVariant value;
QString symbol;
};
enum QueryType {
LanguageId, // uint
TerritoryId, // uint
DecimalPoint, // QString
GroupSeparator, // QString (empty QString means: don't group digits)
ZeroDigit, // QString
NegativeSign, // QString
DateFormatLong, // QString
DateFormatShort, // QString
TimeFormatLong, // QString
TimeFormatShort, // QString
DayNameLong, // QString, in: int
DayNameShort, // QString, in: int
DayNameNarrow, // QString, in: int
MonthNameLong, // QString, in: int
MonthNameShort, // QString, in: int
MonthNameNarrow, // QString, in: int
DateToStringLong, // QString, in: QDate
DateToStringShort, // QString in: QDate
TimeToStringLong, // QString in: QTime
TimeToStringShort, // QString in: QTime
DateTimeFormatLong, // QString
DateTimeFormatShort, // QString
DateTimeToStringLong, // QString in: QDateTime
DateTimeToStringShort, // QString in: QDateTime
MeasurementSystem, // uint
PositiveSign, // QString
AMText, // QString
PMText, // QString
FirstDayOfWeek, // Qt::DayOfWeek
Weekdays, // QList<Qt::DayOfWeek>
CurrencySymbol, // QString in: CurrencyToStringArgument
CurrencyToString, // QString in: qlonglong, qulonglong or double
Collation, // QString
UILanguages, // QStringList
StringToStandardQuotation, // QString in: QStringView to quote
StringToAlternateQuotation, // QString in: QStringView to quote
ScriptId, // uint
ListToSeparatedString, // QString
LocaleChanged, // system locale changed
NativeLanguageName, // QString
NativeTerritoryName, // QString
StandaloneMonthNameLong, // QString, in: int
StandaloneMonthNameShort, // QString, in: int
StandaloneMonthNameNarrow, // QString, in: int
StandaloneDayNameLong, // QString, in: int
StandaloneDayNameShort, // QString, in: int
StandaloneDayNameNarrow // QString, in: int
};
virtual QVariant query(QueryType type, QVariant in = QVariant()) const;
virtual QLocale fallbackLocale() const;
inline qsizetype fallbackLocaleIndex() const;
};
Q_DECLARE_TYPEINFO(QSystemLocale::QueryType, Q_PRIMITIVE_TYPE);
Q_DECLARE_TYPEINFO(QSystemLocale::CurrencyToStringArgument, Q_RELOCATABLE_TYPE);
#if QT_CONFIG(icu)
namespace QIcu {
QString toUpper(const QByteArray &localeId, const QString &str, bool *ok);
QString toLower(const QByteArray &localeId, const QString &str, bool *ok);
}
#endif
struct QLocaleId
{
[[nodiscard]] Q_AUTOTEST_EXPORT static QLocaleId fromName(QStringView name);
[[nodiscard]] inline bool operator==(QLocaleId other) const
{ return language_id == other.language_id && script_id == other.script_id && territory_id == other.territory_id; }
[[nodiscard]] inline bool operator!=(QLocaleId other) const
{ return !operator==(other); }
[[nodiscard]] inline bool isValid() const
{
return language_id <= QLocale::LastLanguage && script_id <= QLocale::LastScript
&& territory_id <= QLocale::LastTerritory;
}
[[nodiscard]] inline bool matchesAll() const
{
return !language_id && !script_id && !territory_id;
}
// Use as: filter.accept...(candidate)
[[nodiscard]] inline bool acceptLanguage(quint16 lang) const
{
// Always reject AnyLanguage (only used for last entry in locale_data array).
// So, when searching for AnyLanguage, accept everything *but* AnyLanguage.
return language_id ? lang == language_id : lang;
}
[[nodiscard]] inline bool acceptScriptTerritory(QLocaleId other) const
{
return (!territory_id || other.territory_id == territory_id)
&& (!script_id || other.script_id == script_id);
}
[[nodiscard]] QLocaleId withLikelySubtagsAdded() const;
[[nodiscard]] QLocaleId withLikelySubtagsRemoved() const;
[[nodiscard]] QByteArray name(char separator = '-') const;
ushort language_id = 0, script_id = 0, territory_id = 0;
};
Q_DECLARE_TYPEINFO(QLocaleId, Q_PRIMITIVE_TYPE);
struct QLocaleData
{
public:
// Having an index for each locale enables us to have diverse sources of
// data, e.g. calendar locales, as well as the main CLDR-derived data.
[[nodiscard]] static qsizetype findLocaleIndex(QLocaleId localeId);
[[nodiscard]] static const QLocaleData *c();
enum DoubleForm {
DFExponent = 0,
DFDecimal,
DFSignificantDigits,
_DFMax = DFSignificantDigits
};
enum Flags {
NoFlags = 0,
AddTrailingZeroes = 0x01,
ZeroPadded = 0x02,
LeftAdjusted = 0x04,
BlankBeforePositive = 0x08,
AlwaysShowSign = 0x10,
GroupDigits = 0x20,
CapitalEorX = 0x40,
ShowBase = 0x80,
UppercaseBase = 0x100,
ZeroPadExponent = 0x200,
ForcePoint = 0x400
};
enum NumberMode { IntegerMode, DoubleStandardMode, DoubleScientificMode };
typedef QVarLengthArray<char, 256> CharBuff;
private:
enum PrecisionMode {
PMDecimalDigits = 0x01,
PMSignificantDigits = 0x02,
PMChopTrailingZeros = 0x03
};
[[nodiscard]] QString decimalForm(QString &&digits, int decpt, int precision,
PrecisionMode pm, bool mustMarkDecimal,
bool groupDigits) const;
[[nodiscard]] QString exponentForm(QString &&digits, int decpt, int precision,
PrecisionMode pm, bool mustMarkDecimal,
int minExponentDigits) const;
[[nodiscard]] QString signPrefix(bool negative, unsigned flags) const;
[[nodiscard]] QString applyIntegerFormatting(QString &&numStr, bool negative, int precision,
int base, int width, unsigned flags) const;
public:
[[nodiscard]] QString doubleToString(double d,
int precision = -1,
DoubleForm form = DFSignificantDigits,
int width = -1,
unsigned flags = NoFlags) const;
[[nodiscard]] QString longLongToString(qint64 l, int precision = -1,
int base = 10,
int width = -1,
unsigned flags = NoFlags) const;
[[nodiscard]] QString unsLongLongToString(quint64 l, int precision = -1,
int base = 10,
int width = -1,
unsigned flags = NoFlags) const;
// this function is meant to be called with the result of stringToDouble or bytearrayToDouble
[[nodiscard]] static float convertDoubleToFloat(double d, bool *ok)
{
if (qIsInf(d))
return float(d);
if (std::fabs(d) > (std::numeric_limits<float>::max)()) {
if (ok)
*ok = false;
const float huge = std::numeric_limits<float>::infinity();
return d < 0 ? -huge : huge;
}
if (d != 0 && float(d) == 0) {
// Values that underflow double already failed. Match them:
if (ok)
*ok = false;
return 0;
}
return float(d);
}
[[nodiscard]] double stringToDouble(QStringView str, bool *ok,
QLocale::NumberOptions options) const;
[[nodiscard]] qint64 stringToLongLong(QStringView str, int base, bool *ok,
QLocale::NumberOptions options) const;
[[nodiscard]] quint64 stringToUnsLongLong(QStringView str, int base, bool *ok,
QLocale::NumberOptions options) const;
// this function is used in QIntValidator (QtGui)
[[nodiscard]] Q_CORE_EXPORT static qint64 bytearrayToLongLong(QByteArrayView num, int base,
bool *ok);
[[nodiscard]] static quint64 bytearrayToUnsLongLong(QByteArrayView num, int base, bool *ok);
[[nodiscard]] bool numberToCLocale(QStringView s, QLocale::NumberOptions number_options,
CharBuff *result) const;
[[nodiscard]] inline char numericToCLocale(QStringView in) const;
// this function is used in QIntValidator (QtGui)
[[nodiscard]] Q_CORE_EXPORT bool validateChars(
QStringView str, NumberMode numMode, QByteArray *buff, int decDigits = -1,
QLocale::NumberOptions number_options = QLocale::DefaultNumberOptions) const;
// Access to assorted data members:
[[nodiscard]] QLocaleId id() const
{ return QLocaleId { m_language_id, m_script_id, m_territory_id }; }
[[nodiscard]] QString decimalPoint() const;
[[nodiscard]] QString groupSeparator() const;
[[nodiscard]] QString listSeparator() const;
[[nodiscard]] QString percentSign() const;
[[nodiscard]] QString zeroDigit() const;
[[nodiscard]] char32_t zeroUcs() const;
[[nodiscard]] QString positiveSign() const;
[[nodiscard]] QString negativeSign() const;
[[nodiscard]] QString exponentSeparator() const;
struct DataRange
{
quint16 offset;
quint16 size;
[[nodiscard]] QString getData(const char16_t *table) const
{
return size > 0
? QString::fromRawData(reinterpret_cast<const QChar *>(table + offset), size)
: QString();
}
[[nodiscard]] QStringView viewData(const char16_t *table) const
{
return { reinterpret_cast<const QChar *>(table + offset), size };
}
[[nodiscard]] QString getListEntry(const char16_t *table, qsizetype index) const
{
return listEntry(table, index).getData(table);
}
[[nodiscard]] QStringView viewListEntry(const char16_t *table, qsizetype index) const
{
return listEntry(table, index).viewData(table);
}
[[nodiscard]] char32_t ucsFirst(const char16_t *table) const
{
if (size && !QChar::isSurrogate(table[offset]))
return table[offset];
if (size > 1 && QChar::isHighSurrogate(table[offset]))
return QChar::surrogateToUcs4(table[offset], table[offset + 1]);
return 0;
}
private:
[[nodiscard]] DataRange listEntry(const char16_t *table, qsizetype index) const
{
const char16_t separator = ';';
quint16 i = 0;
while (index > 0 && i < size) {
if (table[offset + i] == separator)
index--;
i++;
}
quint16 end = i;
while (end < size && table[offset + end] != separator)
end++;
return { quint16(offset + i), quint16(end - i) };
}
};
#define ForEachQLocaleRange(X) \
X(startListPattern) X(midListPattern) X(endListPattern) X(pairListPattern) X(listDelimit) \
X(decimalSeparator) X(groupDelim) X(percent) X(zero) X(minus) X(plus) X(exponential) \
X(quoteStart) X(quoteEnd) X(quoteStartAlternate) X(quoteEndAlternate) \
X(longDateFormat) X(shortDateFormat) X(longTimeFormat) X(shortTimeFormat) \
X(longDayNamesStandalone) X(longDayNames) \
X(shortDayNamesStandalone) X(shortDayNames) \
X(narrowDayNamesStandalone) X(narrowDayNames) \
X(anteMeridiem) X(postMeridiem) \
X(byteCount) X(byteAmountSI) X(byteAmountIEC) \
X(currencySymbol) X(currencyDisplayName) \
X(currencyFormat) X(currencyFormatNegative) \
X(endonymLanguage) X(endonymTerritory)
#define rangeGetter(name) \
[[nodiscard]] DataRange name() const { return { m_ ## name ## _idx, m_ ## name ## _size }; }
ForEachQLocaleRange(rangeGetter)
#undef rangeGetter
public:
quint16 m_language_id, m_script_id, m_territory_id;
// Offsets, then sizes, for each range:
#define rangeIndex(name) quint16 m_ ## name ## _idx;
ForEachQLocaleRange(rangeIndex)
#undef rangeIndex
#define Size(name) quint8 m_ ## name ## _size;
ForEachQLocaleRange(Size)
#undef Size
#undef ForEachQLocaleRange
// Strays:
char m_currency_iso_code[3];
quint8 m_currency_digits : 2;
quint8 m_currency_rounding : 3; // (not yet used !)
quint8 m_first_day_of_week : 3;
quint8 m_weekend_start : 3;
quint8 m_weekend_end : 3;
quint8 m_grouping_top : 2; // Don't group until more significant group has this many digits.
quint8 m_grouping_higher : 3; // Number of digits between grouping separators
quint8 m_grouping_least : 3; // Number of digits after last grouping separator (before decimal).
};
class QLocalePrivate
{
public:
constexpr QLocalePrivate(const QLocaleData *data, qsizetype index,
QLocale::NumberOptions numberOptions = QLocale::DefaultNumberOptions,
int refs = 0)
: m_data(data), ref Q_BASIC_ATOMIC_INITIALIZER(refs),
m_index(index), m_numberOptions(numberOptions) {}
[[nodiscard]] quint16 languageId() const { return m_data->m_language_id; }
[[nodiscard]] quint16 territoryId() const { return m_data->m_territory_id; }
[[nodiscard]] QByteArray bcp47Name(char separator = '-') const;
[[nodiscard]] inline QLatin1StringView
languageCode(QLocale::LanguageCodeTypes codeTypes = QLocale::AnyLanguageCode) const
{
return languageToCode(QLocale::Language(m_data->m_language_id), codeTypes);
}
[[nodiscard]] inline QLatin1StringView scriptCode() const
{ return scriptToCode(QLocale::Script(m_data->m_script_id)); }
[[nodiscard]] inline QLatin1StringView territoryCode() const
{ return territoryToCode(QLocale::Territory(m_data->m_territory_id)); }
[[nodiscard]] static const QLocalePrivate *get(const QLocale &l) { return l.d; }
[[nodiscard]] static QLatin1StringView
languageToCode(QLocale::Language language,
QLocale::LanguageCodeTypes codeTypes = QLocale::AnyLanguageCode);
[[nodiscard]] static QLatin1StringView scriptToCode(QLocale::Script script);
[[nodiscard]] static QLatin1StringView territoryToCode(QLocale::Territory territory);
[[nodiscard]] static QLocale::Language
codeToLanguage(QStringView code,
QLocale::LanguageCodeTypes codeTypes = QLocale::AnyLanguageCode) noexcept;
[[nodiscard]] static QLocale::Script codeToScript(QStringView code) noexcept;
[[nodiscard]] static QLocale::Territory codeToTerritory(QStringView code) noexcept;
[[nodiscard]] QLocale::MeasurementSystem measurementSystem() const;
// System locale has an m_data all its own; all others have m_data = locale_data + m_index
const QLocaleData *const m_data;
QBasicAtomicInt ref;
const qsizetype m_index;
QLocale::NumberOptions m_numberOptions;
static QBasicAtomicInt s_generation;
};
#ifndef QT_NO_SYSTEMLOCALE
qsizetype QSystemLocale::fallbackLocaleIndex() const { return fallbackLocale().d->m_index; }
#endif
template <>
inline QLocalePrivate *QSharedDataPointer<QLocalePrivate>::clone()
{
// cannot use QLocalePrivate's copy constructor
// since it is deleted in C++11
return new QLocalePrivate(d->m_data, d->m_index, d->m_numberOptions);
}
inline char QLocaleData::numericToCLocale(QStringView in) const
{
Q_ASSERT(in.size() == 1 || (in.size() == 2 && in.at(0).isHighSurrogate()));
if (in == positiveSign() || in == u"+")
return '+';
if (in == negativeSign() || in == u"-" || in == u"\x2212")
return '-';
if (in == decimalPoint())
return '.';
if (const QString exp = exponentSeparator();
in.compare(exp, Qt::CaseInsensitive) == 0
|| (m_script_id == QLocale::CyrillicScript
// Ukrainian officially uses the Cyrillic E, other Cyrillic-script
// languages use Latin E, but these are indistinguishable.
&& in.compare(exp == u'\u0415' ? u'E' : u'\u0415', Qt::CaseInsensitive) == 0)) {
return 'e';
}
const QString group = groupSeparator();
if (in == group)
return ',';
// In several languages group() is a non-breaking space (U+00A0) or its thin
// version (U+202f), which look like spaces. People (and thus some of our
// tests) use a regular space instead and complain if it doesn't work.
// Should this be extended generally to any case where group is a space ?
if ((group == u"\xa0" || group == u"\x202f") && in == u" ")
return ',';
const char32_t inUcs4 = in.size() == 2
? QChar::surrogateToUcs4(in.at(0), in.at(1)) : in.at(0).unicode();
const char32_t zeroUcs4 = zeroUcs();
// Must match qlocale_tools.h's unicodeForDigit()
if (zeroUcs4 == u'\u3007') {
// QTBUG-85409: Suzhou's digits aren't contiguous !
if (inUcs4 == zeroUcs4)
return '0';
if (inUcs4 > u'\u3020' && inUcs4 <= u'\u3029')
return inUcs4 - u'\u3020';
} else if (zeroUcs4 <= inUcs4 && inUcs4 < zeroUcs4 + 10) {
return '0' + inUcs4 - zeroUcs4;
}
if ('0' <= inUcs4 && inUcs4 <= '9')
return inUcs4;
return 0;
}
// Also used to merely skip over an escape in a format string, advancint idx to
// point after it (so not [[nodiscard]]):
QString qt_readEscapedFormatString(QStringView format, qsizetype *idx);
[[nodiscard]] bool qt_splitLocaleName(QStringView name, QStringView *lang = nullptr,
QStringView *script = nullptr, QStringView *cntry = nullptr);
[[nodiscard]] qsizetype qt_repeatCount(QStringView s);
enum { AsciiSpaceMask = (1u << (' ' - 1)) |
(1u << ('\t' - 1)) | // 9: HT - horizontal tab
(1u << ('\n' - 1)) | // 10: LF - line feed
(1u << ('\v' - 1)) | // 11: VT - vertical tab
(1u << ('\f' - 1)) | // 12: FF - form feed
(1u << ('\r' - 1)) }; // 13: CR - carriage return
[[nodiscard]] constexpr inline bool ascii_isspace(uchar c)
{
return c >= 1u && c <= 32u && (AsciiSpaceMask >> uint(c - 1)) & 1u;
}
QT_END_NAMESPACE
// ### move to qnamespace.h
QT_DECL_METATYPE_EXTERN_TAGGED(QList<Qt::DayOfWeek>, QList_Qt__DayOfWeek, Q_CORE_EXPORT)
#ifndef QT_NO_SYSTEMLOCALE
QT_DECL_METATYPE_EXTERN_TAGGED(QSystemLocale::CurrencyToStringArgument,
QSystemLocale__CurrencyToStringArgument, Q_CORE_EXPORT)
#endif
#endif // QLOCALE_P_H

View File

@@ -0,0 +1,98 @@
// Copyright (C) 2021 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 QLOCALE_TOOLS_P_H
#define QLOCALE_TOOLS_P_H
//
// W A R N I N G
// -------------
//
// This file is not part of the Qt API. It exists for the convenience
// of internal files. This header file may change from version to version
// without notice, or even be removed.
//
// We mean it.
//
#include "qlocale_p.h"
#include "qstring.h"
QT_BEGIN_NAMESPACE
enum StrayCharacterMode {
TrailingJunkProhibited,
TrailingJunkAllowed,
WhitespacesAllowed
};
template <typename T> struct QSimpleParsedNumber
{
T result;
// When used < 0, -used is how much was used, but it was an error.
qsizetype used;
bool ok() const { return used > 0; }
};
// API note: this function can't process a number with more than 2.1 billion digits
[[nodiscard]] QSimpleParsedNumber<double>
qt_asciiToDouble(const char *num, qsizetype numLen,
StrayCharacterMode strayCharMode = TrailingJunkProhibited);
void qt_doubleToAscii(double d, QLocaleData::DoubleForm form, int precision,
char *buf, qsizetype bufSize,
bool &sign, int &length, int &decpt);
[[nodiscard]] QString qulltoBasicLatin(qulonglong l, int base, bool negative);
[[nodiscard]] QString qulltoa(qulonglong l, int base, const QStringView zero);
[[nodiscard]] Q_CORE_EXPORT QString qdtoa(qreal d, int *decpt, int *sign);
[[nodiscard]] QString qdtoBasicLatin(double d, QLocaleData::DoubleForm form,
int precision, bool uppercase);
[[nodiscard]] QByteArray qdtoAscii(double d, QLocaleData::DoubleForm form,
int precision, bool uppercase);
[[nodiscard]] constexpr inline bool isZero(double d)
{
return d == 0; // Amusingly, compilers do not grumble.
}
// Enough space for the digits before the decimal separator:
[[nodiscard]] inline int wholePartSpace(double d)
{
Q_ASSERT(d >= 0); // caller should call qAbs() if needed
// Optimize for numbers between -512k and 512k - otherwise, use the
// maximum number of digits in the whole number part of a double:
return d > (1 << 19) ? std::numeric_limits<double>::max_exponent10 + 1 : 6;
}
// Returns code-point of same kind (UCS2 or UCS4) as zero; digit is 0 through 9
template <typename UcsInt>
[[nodiscard]] inline UcsInt unicodeForDigit(uint digit, UcsInt zero)
{
// Must match QLocaleData::numericToCLocale()'s digit-digestion.
Q_ASSERT(digit < 10);
if (!digit)
return zero;
// See QTBUG-85409: Suzhou's digits are U+3007, U+3021, ..., U+3029
if (zero == u'\u3007')
return u'\u3020' + digit;
// In util/locale_database/ldml.py, LocaleScanner.numericData() asserts no
// other number system in CLDR has discontinuous digits.
return zero + digit;
}
[[nodiscard]] Q_CORE_EXPORT double qstrntod(const char *s00, qsizetype len,
char const **se, bool *ok);
[[nodiscard]] inline double qstrtod(const char *s00, char const **se, bool *ok)
{
qsizetype len = qsizetype(strlen(s00));
return qstrntod(s00, len, se, ok);
}
[[nodiscard]] QSimpleParsedNumber<qlonglong> qstrntoll(const char *nptr, qsizetype size, int base);
[[nodiscard]] QSimpleParsedNumber<qulonglong> qstrntoull(const char *nptr, qsizetype size, int base);
QT_END_NAMESPACE
#endif

View File

@@ -0,0 +1,46 @@
// Copyright (C) 2022 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 QLOCALTIME_P_H
#define QLOCALTIME_P_H
//
// W A R N I N G
// -------------
//
// This file is not part of the Qt API. It exists purely as an implementation
// detail. This header file may change from version to version without notice,
// or even be removed.
//
// We mean it.
//
#include <QtCore/private/qglobal_p.h>
#include <QtCore/private/qdatetime_p.h>
QT_BEGIN_NAMESPACE
// Packaging system time_t functions
namespace QLocalTime {
#ifndef QT_BOOTSTRAPPED
// Support for V4's Date implelenentation.
// Each returns offset from UTC in seconds (or 0 if unknown).
// V4 shall need to multiply by 1000.
// Offset is -ve East of Greenwich, +ve west of Greenwich.
// Add it to UTC seconds since epoch to get local seconds since nominal local epoch.
Q_CORE_EXPORT int getCurrentStandardUtcOffset();
Q_CORE_EXPORT int getUtcOffset(qint64 atMSecsSinceEpoch);
#endif // QT_BOOTSTRAPPED
// Support for QDateTime
QDateTimePrivate::ZoneState utcToLocal(qint64 utcMillis);
QString localTimeAbbbreviationAt(qint64 local, QDateTimePrivate::DaylightStatus dst);
QDateTimePrivate::ZoneState mapLocalTime(qint64 local, QDateTimePrivate::DaylightStatus dst);
struct SystemMillisRange { qint64 min, max; bool minClip, maxClip; };
SystemMillisRange computeSystemMillisRange();
}
QT_END_NAMESPACE
#endif // QLOCALTIME_P_H

View File

@@ -0,0 +1,83 @@
// Copyright (C) 2013 David Faure <faure+bluesystems@kde.org>
// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only
#ifndef QLOCKFILE_P_H
#define QLOCKFILE_P_H
//
// W A R N I N G
// -------------
//
// This file is not part of the Qt API. It exists purely as an
// implementation detail. This header file may change from version to
// version without notice, or even be removed.
//
// We mean it.
//
#include <QtCore/private/qglobal_p.h>
#include <QtCore/qlockfile.h>
#include <QtCore/qfile.h>
#include <qplatformdefs.h>
#ifdef Q_OS_WIN
#include <io.h>
#include <qt_windows.h>
#endif
QT_BEGIN_NAMESPACE
class QLockFilePrivate
{
public:
QLockFilePrivate(const QString &fn)
: fileName(fn),
#ifdef Q_OS_WIN
fileHandle(INVALID_HANDLE_VALUE),
#else
fileHandle(-1),
#endif
staleLockTime(30 * 1000), // 30 seconds
lockError(QLockFile::NoError),
isLocked(false)
{
}
QLockFile::LockError tryLock_sys();
bool removeStaleLock();
QByteArray lockFileContents() const;
// Returns \c true if the lock belongs to dead PID, or is old.
// The attempt to delete it will tell us if it was really stale or not, though.
bool isApparentlyStale() const;
// used in dbusmenu
Q_CORE_EXPORT static QString processNameByPid(qint64 pid);
static bool isProcessRunning(qint64 pid, const QString &appname);
QString fileName;
#ifdef Q_OS_WIN
Qt::HANDLE fileHandle;
#else
int fileHandle;
#endif
int staleLockTime; // "int milliseconds" is big enough for 24 days
QLockFile::LockError lockError;
bool isLocked;
static int getLockFileHandle(QLockFile *f)
{
int fd;
#ifdef Q_OS_WIN
// Use of this function on Windows WILL leak a file descriptor.
fd = _open_osfhandle(intptr_t(f->d_func()->fileHandle), 0);
#else
fd = f->d_func()->fileHandle;
#endif
QT_LSEEK(fd, 0, SEEK_SET);
return fd;
}
};
QT_END_NAMESPACE
#endif /* QLOCKFILE_P_H */

View File

@@ -0,0 +1,79 @@
// Copyright (C) 2019 Klarälvdalens Datakonsult AB, a KDAB Group company, info@kdab.com, author Marc Mutz <marc.mutz@kdab.com>
// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only
#ifndef QLOCKING_P_H
#define QLOCKING_P_H
//
// W A R N I N G
// -------------
//
// This file is not part of the Qt API. It exists for the convenience of
// qmutex.cpp and qmutex_unix.cpp. This header file may change from version to
// version without notice, or even be removed.
//
// We mean it.
//
#include <QtCore/qmutex.h>
#include <QtCore/private/qglobal_p.h>
#include <mutex>
QT_BEGIN_NAMESPACE
//
// This API is bridging the time until we can depend on C++17:
//
// - qt_scoped_lock returns a lock that cannot be unlocked again before the end of the scope
// - qt_unique_lock returns a lock that can be unlock()ed and moved around
// - for compat with QMutexLocker, qt_unique_lock supports passing by pointer.
// Do NOT use this overload lightly; it's only for cases such as where a Q_GLOBAL_STATIC
// may have already been deleted. In particular, do NOT port from
// QMutexLocker locker(&mutex);
// to
// auto locker = qt_unique_lock(&mutex);
// as this will not port automatically to std::unique_lock come C++17!
//
// The intent, come C++17, is to replace
// qt_scoped_lock(mutex);
// qt_unique_lock(mutex); // except qt_unique_lock(&mutex)
// with
// std::scoped_lock(mutex);
// std::unique_lock(mutex);
// resp. (C++17 meaning CTAD, guaranteed copy elision + scoped_lock available on all platforms),
// so please use these functions only in ways which don't break this mechanical search & replace.
//
namespace {
template <typename Mutex, typename Lock =
# if defined(__cpp_lib_scoped_lock) && __cpp_lib_scoped_lock >= 201703L
std::scoped_lock
# else
std::lock_guard
# endif
<typename std::decay<Mutex>::type>
>
Lock qt_scoped_lock(Mutex &mutex)
{
return Lock(mutex);
}
template <typename Mutex, typename Lock = std::unique_lock<typename std::decay<Mutex>::type>>
Lock qt_unique_lock(Mutex &mutex)
{
return Lock(mutex);
}
template <typename Mutex, typename Lock = std::unique_lock<typename std::decay<Mutex>::type>>
Lock qt_unique_lock(Mutex *mutex)
{
return mutex ? Lock(*mutex) : Lock() ;
}
} // unnamed namespace
QT_END_NAMESPACE
#endif // QLOCKING_P_H

View File

@@ -0,0 +1,30 @@
// Copyright (C) 2018 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 QLOGGING_P_H
#define QLOGGING_P_H
//
// W A R N I N G
// -------------
//
// This file is not part of the Qt API. It exists for the convenience
// of a number of Qt sources files. This header file may change from
// version to version without notice, or even be removed.
//
// We mean it.
//
#include <QtCore/private/qglobal_p.h>
QT_BEGIN_NAMESPACE
namespace QtPrivate {
Q_CORE_EXPORT bool shouldLogToStderr();
}
QT_END_NAMESPACE
#endif // QLOGGING_P_H

View File

@@ -0,0 +1,153 @@
// 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 QLOGGINGREGISTRY_P_H
#define QLOGGINGREGISTRY_P_H
//
// W A R N I N G
// -------------
//
// This file is not part of the Qt API. It exists for the convenience
// of a number of Qt sources files. This header file may change from
// version to version without notice, or even be removed.
//
// We mean it.
//
#include <QtCore/private/qglobal_p.h>
#include <QtCore/qloggingcategory.h>
#include <QtCore/qlist.h>
#include <QtCore/qhash.h>
#include <QtCore/qmap.h>
#include <QtCore/qmutex.h>
#include <QtCore/qstring.h>
#include <QtCore/qtextstream.h>
class tst_QLoggingRegistry;
QT_BEGIN_NAMESPACE
#define Q_LOGGING_CATEGORY_WITH_ENV_OVERRIDE(name, env, categoryName) \
const QLoggingCategory &name() \
{ \
static constexpr char cname[] = categoryName; \
static_assert(cname[0] == 'q' && cname[1] == 't' && cname[2] == '.' \
&& cname[4] != '\0', "Category name must start with 'qt.'"); \
static const QLoggingCategoryWithEnvironmentOverride category(cname, env); \
return category; \
}
class Q_AUTOTEST_EXPORT QLoggingRule
{
public:
QLoggingRule();
QLoggingRule(QStringView pattern, bool enabled);
int pass(QLatin1StringView categoryName, QtMsgType type) const;
enum PatternFlag {
FullText = 0x1,
LeftFilter = 0x2,
RightFilter = 0x4,
MidFilter = LeftFilter | RightFilter
};
Q_DECLARE_FLAGS(PatternFlags, PatternFlag)
QString category;
int messageType;
PatternFlags flags;
bool enabled;
private:
void parse(QStringView pattern);
};
Q_DECLARE_OPERATORS_FOR_FLAGS(QLoggingRule::PatternFlags)
Q_DECLARE_TYPEINFO(QLoggingRule, Q_RELOCATABLE_TYPE);
class Q_AUTOTEST_EXPORT QLoggingSettingsParser
{
public:
void setImplicitRulesSection(bool inRulesSection) { m_inRulesSection = inRulesSection; }
void setContent(QStringView content);
void setContent(QTextStream &stream);
QList<QLoggingRule> rules() const { return _rules; }
private:
void parseNextLine(QStringView line);
private:
bool m_inRulesSection = false;
QList<QLoggingRule> _rules;
};
class Q_AUTOTEST_EXPORT QLoggingRegistry
{
public:
QLoggingRegistry();
void initializeRules();
void registerCategory(QLoggingCategory *category, QtMsgType enableForLevel);
void unregisterCategory(QLoggingCategory *category);
#ifndef QT_BUILD_INTERNAL
Q_CORE_EXPORT // always export from QtCore
#endif
void registerEnvironmentOverrideForCategory(QByteArrayView categoryName, QByteArrayView environment);
void setApiRules(const QString &content);
QLoggingCategory::CategoryFilter
installFilter(QLoggingCategory::CategoryFilter filter);
static QLoggingRegistry *instance();
private:
void updateRules();
static void defaultCategoryFilter(QLoggingCategory *category);
enum RuleSet {
// sorted by order in which defaultCategoryFilter considers them:
QtConfigRules,
ConfigRules,
ApiRules,
EnvironmentRules,
NumRuleSets
};
QMutex registryMutex;
// protected by mutex:
QList<QLoggingRule> ruleSets[NumRuleSets];
QHash<QLoggingCategory *, QtMsgType> categories;
QLoggingCategory::CategoryFilter categoryFilter;
QMap<QByteArrayView, QByteArrayView> qtCategoryEnvironmentOverrides;
friend class ::tst_QLoggingRegistry;
};
class QLoggingCategoryWithEnvironmentOverride : public QLoggingCategory
{
public:
QLoggingCategoryWithEnvironmentOverride(const char *category, const char *env)
: QLoggingCategory(registerOverride(category, env), QtInfoMsg)
{}
private:
static const char *registerOverride(QByteArrayView categoryName, QByteArrayView environment)
{
QLoggingRegistry *c = QLoggingRegistry::instance();
if (c)
c->registerEnvironmentOverrideForCategory(categoryName, environment);
return categoryName.data();
}
};
QT_END_NAMESPACE
#endif // QLOGGINGREGISTRY_P_H

View File

@@ -0,0 +1,143 @@
// Copyright (C) 2020 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 QMAKEARRAY_P_H
#define QMAKEARRAY_P_H
//
// W A R N I N G
// -------------
//
// This file is not part of the Qt API. It exists purely as an
// implementation detail. This header file may change from version to
// version without notice, or even be removed.
//
// We mean it.
//
#include "QtCore/private/qglobal_p.h"
#include <array>
#include <type_traits>
#include <utility>
QT_BEGIN_NAMESPACE
namespace QtPrivate {
template<typename T>
constexpr T &&Forward(typename std::remove_reference<T>::type &t) noexcept
{
return static_cast<T &&>(t);
}
template<typename T>
constexpr T &&Forward(typename std::remove_reference<T>::type &&t) noexcept
{
static_assert(!std::is_lvalue_reference<T>::value,
"template argument substituting T is an lvalue reference type");
return static_cast<T &&>(t);
}
template <typename ManualType, typename ...>
struct ArrayTypeHelper
{
using type = ManualType;
};
template <typename ... Types>
struct ArrayTypeHelper<void, Types...> : std::common_type<Types...> { };
template <typename ManualType, typename... Types>
using ArrayType = std::array<typename ArrayTypeHelper<ManualType, Types...>::type,
sizeof...(Types)>;
template<typename ... Values>
struct QuickSortData { };
template <template <typename> class Predicate,
typename ... Values>
struct QuickSortFilter;
template <typename ... Right, typename ... Left>
constexpr QuickSortData<Right..., Left...> quickSortConcat(
QuickSortData<Right...>, QuickSortData<Left...>) noexcept;
template<typename ... Right, typename Middle, typename ... Left>
constexpr QuickSortData<Right..., Middle, Left...> quickSortConcat(
QuickSortData<Right...>,
QuickSortData<Middle>,
QuickSortData<Left...>) noexcept;
template <template <typename> class Predicate,
typename Head, typename ... Tail>
struct QuickSortFilter<Predicate, QuickSortData<Head, Tail...>>
{
using TailFilteredData = typename QuickSortFilter<
Predicate, QuickSortData<Tail...>>::Type;
using Type = typename std::conditional<
Predicate<Head>::value,
decltype(quickSortConcat(QuickSortData<Head> {}, TailFilteredData{})),
TailFilteredData>::type;
};
template <template <typename> class Predicate>
struct QuickSortFilter<Predicate, QuickSortData<>>
{
using Type = QuickSortData<>;
};
template <typename ... Values>
struct QuickSort;
template <typename Pivot, typename ... Values>
struct QuickSort<QuickSortData<Pivot, Values...>>
{
template <typename Left>
struct LessThan {
static constexpr const bool value = Left::data() <= Pivot::data();
};
template <typename Left>
struct MoreThan {
static constexpr const bool value = !(Left::data() <= Pivot::data());
};
using LeftSide = typename QuickSortFilter<LessThan, QuickSortData<Values...>>::Type;
using RightSide = typename QuickSortFilter<MoreThan, QuickSortData<Values...>>::Type;
using LeftQS = typename QuickSort<LeftSide>::Type;
using RightQS = typename QuickSort<RightSide>::Type;
using Type = decltype(quickSortConcat(LeftQS{}, QuickSortData<Pivot> {}, RightQS{}));
};
template <>
struct QuickSort<QuickSortData<>>
{
using Type = QuickSortData<>;
};
} // namespace QtPrivate
template <typename ManualType = void, typename ... Types>
constexpr QtPrivate::ArrayType<ManualType, Types...> qMakeArray(Types && ... t) noexcept
{
return {{QtPrivate::Forward<typename QtPrivate::ArrayType<ManualType, Types...>::value_type>(t)...}};
}
template<typename ... Values>
struct QSortedData {
using Data = typename QtPrivate::QuickSort<typename QtPrivate::QuickSortData<Values...>>::Type;
};
template<typename ... Values>
constexpr auto qMakeArray(QtPrivate::QuickSortData<Values...>) noexcept -> decltype(qMakeArray(Values::data()...))
{
return qMakeArray(Values::data() ...);
}
QT_END_NAMESPACE
#endif // QMAKEARRAY_P_H

View File

@@ -0,0 +1,36 @@
// Copyright (C) 2019 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
#if !defined(QMETAOBJECT_P_H) && !defined(UTILS_H)
# error "Include qmetaobject_p.h (or moc's utils.h) before including this file."
#endif
//
// W A R N I N G
// -------------
//
// This file is not part of the Qt API. It exists purely as an
// implementation detail. This header file may change from version to
// version without notice, or even be removed.
//
// We mean it.
//
#include <QtCore/qbytearray.h>
#include <QtCore/private/qglobal_p.h>
QT_BEGIN_NAMESPACE
// This function is shared with moc.cpp. This file should be included where needed.
static QByteArray normalizeTypeInternal(const char *t, const char *e)
{
int len = QtPrivate::qNormalizeType(t, e, nullptr);
if (len == 0)
return QByteArray();
QByteArray result(len, Qt::Uninitialized);
len = QtPrivate::qNormalizeType(t, e, result.data());
Q_ASSERT(len == result.size());
return result;
}
QT_END_NAMESPACE

View File

@@ -0,0 +1,291 @@
// Copyright (C) 2020 The Qt Company Ltd.
// Copyright (C) 2014 Olivier Goffart <ogoffart@woboq.com>
// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only
#ifndef QMETAOBJECT_P_H
#define QMETAOBJECT_P_H
//
// W A R N I N G
// -------------
//
// This file is not part of the Qt API. It exists for the convenience
// of moc. This header file may change from version to version without notice,
// or even be removed.
//
// We mean it.
//
#include <QtCore/qglobal.h>
#include <QtCore/qobjectdefs.h>
#include <QtCore/qmutex.h>
#include <QtCore/qmetaobject.h>
#ifndef QT_NO_QOBJECT
#include <private/qobject_p.h> // For QObjectPrivate::Connection
#endif
#include <private/qtools_p.h>
#include <QtCore/qvarlengtharray.h>
QT_BEGIN_NAMESPACE
// ### TODO - QTBUG-87869: wrap in a proper Q_NAMESPACE and use scoped enums, to avoid name clashes
using namespace QtMiscUtils;
enum PropertyFlags {
Invalid = 0x00000000,
Readable = 0x00000001,
Writable = 0x00000002,
Resettable = 0x00000004,
EnumOrFlag = 0x00000008,
Alias = 0x00000010,
// Reserved for future usage = 0x00000020,
StdCppSet = 0x00000100,
Constant = 0x00000400,
Final = 0x00000800,
Designable = 0x00001000,
Scriptable = 0x00004000,
Stored = 0x00010000,
User = 0x00100000,
Required = 0x01000000,
Bindable = 0x02000000
};
enum MethodFlags {
AccessPrivate = 0x00,
AccessProtected = 0x01,
AccessPublic = 0x02,
AccessMask = 0x03, // mask
MethodMethod = 0x00,
MethodSignal = 0x04,
MethodSlot = 0x08,
MethodConstructor = 0x0c,
MethodTypeMask = 0x0c,
MethodCompatibility = 0x10,
MethodCloned = 0x20,
MethodScriptable = 0x40,
MethodRevisioned = 0x80,
MethodIsConst = 0x100, // no use case for volatile so far
};
enum MetaObjectFlag {
DynamicMetaObject = 0x01,
RequiresVariantMetaObject = 0x02,
PropertyAccessInStaticMetaCall = 0x04 // since Qt 5.5, property code is in the static metacall
};
Q_DECLARE_FLAGS(MetaObjectFlags, MetaObjectFlag)
Q_DECLARE_OPERATORS_FOR_FLAGS(MetaObjectFlags)
enum MetaDataFlags {
IsUnresolvedType = 0x80000000,
TypeNameIndexMask = 0x7FFFFFFF,
IsUnresolvedSignal = 0x70000000
};
enum EnumFlags {
EnumIsFlag = 0x1,
EnumIsScoped = 0x2
};
Q_CORE_EXPORT int qMetaTypeTypeInternal(const char *);
class QArgumentType
{
public:
QArgumentType(int type)
: _type(type)
{}
QArgumentType(const QByteArray &name)
: _type(qMetaTypeTypeInternal(name.constData())), _name(name)
{}
QArgumentType()
: _type(0)
{}
int type() const
{ return _type; }
QByteArray name() const
{
if (_type && _name.isEmpty())
const_cast<QArgumentType *>(this)->_name = QMetaType(_type).name();
return _name;
}
bool operator==(const QArgumentType &other) const
{
if (_type && other._type)
return _type == other._type;
else
return name() == other.name();
}
bool operator!=(const QArgumentType &other) const
{
if (_type && other._type)
return _type != other._type;
else
return name() != other.name();
}
private:
int _type;
QByteArray _name;
};
Q_DECLARE_TYPEINFO(QArgumentType, Q_RELOCATABLE_TYPE);
typedef QVarLengthArray<QArgumentType, 10> QArgumentTypeArray;
namespace { class QMetaMethodPrivate; }
class QMetaMethodInvoker : public QMetaMethod
{
QMetaMethodInvoker() = delete;
public:
enum class InvokeFailReason : int {
// negative values mean a match was found but the invocation failed
// (and a warning has been printed)
ReturnTypeMismatch = -1,
DeadLockDetected = -2,
CallViaVirtualFailed = -3, // no warning
ConstructorCallOnObject = -4,
ConstructorCallWithoutResult = -5,
ConstructorCallFailed = -6, // no warning
CouldNotQueueParameter = -0x1000,
// zero is success
None = 0,
// positive values mean the parameters did not match
TooFewArguments,
FormalParameterMismatch = 0x1000,
};
// shadows the public function
static InvokeFailReason Q_CORE_EXPORT
invokeImpl(QMetaMethod self, void *target, Qt::ConnectionType, qsizetype paramCount,
const void *const *parameters, const char *const *typeNames,
const QtPrivate::QMetaTypeInterface *const *metaTypes);
};
struct QMetaObjectPrivate
{
// revision 7 is Qt 5.0 everything lower is not supported
// revision 8 is Qt 5.12: It adds the enum name to QMetaEnum
// revision 9 is Qt 6.0: It adds the metatype of properties and methods
// revision 10 is Qt 6.2: The metatype of the metaobject is stored in the metatypes array
// and metamethods store a flag stating whether they are const
// revision 11 is Qt 6.5: The metatype for void is stored in the metatypes array
enum { OutputRevision = 11 }; // Used by moc, qmetaobjectbuilder and qdbus
enum { IntsPerMethod = QMetaMethod::Data::Size };
enum { IntsPerEnum = QMetaEnum::Data::Size };
enum { IntsPerProperty = QMetaProperty::Data::Size };
int revision;
int className;
int classInfoCount, classInfoData;
int methodCount, methodData;
int propertyCount, propertyData;
int enumeratorCount, enumeratorData;
int constructorCount, constructorData;
int flags;
int signalCount;
static inline const QMetaObjectPrivate *get(const QMetaObject *metaobject)
{ return reinterpret_cast<const QMetaObjectPrivate*>(metaobject->d.data); }
static int originalClone(const QMetaObject *obj, int local_method_index);
static QByteArray decodeMethodSignature(const char *signature,
QArgumentTypeArray &types);
static int indexOfSignalRelative(const QMetaObject **baseObject,
const QByteArray &name, int argc,
const QArgumentType *types);
static int indexOfSlotRelative(const QMetaObject **m,
const QByteArray &name, int argc,
const QArgumentType *types);
static int indexOfSignal(const QMetaObject *m, const QByteArray &name,
int argc, const QArgumentType *types);
static int indexOfSlot(const QMetaObject *m, const QByteArray &name,
int argc, const QArgumentType *types);
static int indexOfMethod(const QMetaObject *m, const QByteArray &name,
int argc, const QArgumentType *types);
static int indexOfConstructor(const QMetaObject *m, const QByteArray &name,
int argc, const QArgumentType *types);
Q_CORE_EXPORT static QMetaMethod signal(const QMetaObject *m, int signal_index);
static inline int signalOffset(const QMetaObject *m)
{
Q_ASSERT(m != nullptr);
int offset = 0;
for (m = m->d.superdata; m; m = m->d.superdata)
offset += reinterpret_cast<const QMetaObjectPrivate *>(m->d.data)->signalCount;
return offset;
}
Q_CORE_EXPORT static int absoluteSignalCount(const QMetaObject *m);
Q_CORE_EXPORT static int signalIndex(const QMetaMethod &m);
static bool checkConnectArgs(int signalArgc, const QArgumentType *signalTypes,
int methodArgc, const QArgumentType *methodTypes);
static bool checkConnectArgs(const QMetaMethodPrivate *signal,
const QMetaMethodPrivate *method);
static QList<QByteArray> parameterTypeNamesFromSignature(const char *signature);
#ifndef QT_NO_QOBJECT
// defined in qobject.cpp
enum DisconnectType { DisconnectAll, DisconnectOne };
static void memberIndexes(const QObject *obj, const QMetaMethod &member,
int *signalIndex, int *methodIndex);
static QObjectPrivate::Connection *connect(const QObject *sender, int signal_index,
const QMetaObject *smeta,
const QObject *receiver, int method_index_relative,
const QMetaObject *rmeta = nullptr,
int type = 0, int *types = nullptr);
static bool disconnect(const QObject *sender, int signal_index,
const QMetaObject *smeta,
const QObject *receiver, int method_index, void **slot,
DisconnectType = DisconnectAll);
static inline bool disconnectHelper(QObjectPrivate::ConnectionData *connections, int signalIndex,
const QObject *receiver, int method_index, void **slot,
QBasicMutex *senderMutex, DisconnectType = DisconnectAll);
#endif
template<int MethodType>
static inline int indexOfMethodRelative(const QMetaObject **baseObject,
const QByteArray &name, int argc,
const QArgumentType *types);
static bool methodMatch(const QMetaObject *m, const QMetaMethod &method,
const QByteArray &name, int argc,
const QArgumentType *types);
Q_CORE_EXPORT static QMetaMethod firstMethod(const QMetaObject *baseObject, QByteArrayView name);
};
// For meta-object generators
enum { MetaObjectPrivateFieldCount = sizeof(QMetaObjectPrivate) / sizeof(int) };
#ifndef UTILS_H
// mirrored in moc's utils.h
static inline bool is_ident_char(char s)
{
return isAsciiLetterOrNumber(s) || s == '_';
}
static inline bool is_space(char s)
{
return (s == ' ' || s == '\t');
}
#endif
/*
This function is shared with moc.cpp. The implementation lives in qmetaobject_moc_p.h, which
should be included where needed. The declaration here is not used to avoid warnings from
the compiler about unused functions.
static QByteArray normalizeTypeInternal(const char *t, const char *e, bool fixScope = false, bool adjustConst = true);
*/
QT_END_NAMESPACE
#endif

View File

@@ -0,0 +1,309 @@
// 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 QMETAOBJECTBUILDER_P_H
#define QMETAOBJECTBUILDER_P_H
//
// W A R N I N G
// -------------
//
// This file is not part of the Qt API. It exists for the convenience
// of moc. This header file may change from version to version without notice,
// or even be removed.
//
// We mean it.
//
#include <QtCore/private/qglobal_p.h>
#include <QtCore/qobject.h>
#include <QtCore/qmetaobject.h>
#include <QtCore/qdatastream.h>
#include <QtCore/qhash.h>
#include <QtCore/qmap.h>
#include <private/qmetaobject_p.h>
QT_BEGIN_NAMESPACE
class QMetaObjectBuilderPrivate;
class QMetaMethodBuilder;
class QMetaMethodBuilderPrivate;
class QMetaPropertyBuilder;
class QMetaPropertyBuilderPrivate;
class QMetaEnumBuilder;
class QMetaEnumBuilderPrivate;
class Q_CORE_EXPORT QMetaObjectBuilder
{
public:
enum AddMember
{
ClassName = 0x00000001,
SuperClass = 0x00000002,
Methods = 0x00000004,
Signals = 0x00000008,
Slots = 0x00000010,
Constructors = 0x00000020,
Properties = 0x00000040,
Enumerators = 0x00000080,
ClassInfos = 0x00000100,
RelatedMetaObjects = 0x00000200,
StaticMetacall = 0x00000400,
PublicMethods = 0x00000800,
ProtectedMethods = 0x00001000,
PrivateMethods = 0x00002000,
AllMembers = 0x7FFFFFFF,
AllPrimaryMembers = 0x7FFFFBFC
};
Q_DECLARE_FLAGS(AddMembers, AddMember)
QMetaObjectBuilder();
explicit QMetaObjectBuilder(const QMetaObject *prototype, QMetaObjectBuilder::AddMembers members = AllMembers);
virtual ~QMetaObjectBuilder();
QByteArray className() const;
void setClassName(const QByteArray& name);
const QMetaObject *superClass() const;
void setSuperClass(const QMetaObject *meta);
MetaObjectFlags flags() const;
void setFlags(MetaObjectFlags);
int methodCount() const;
int constructorCount() const;
int propertyCount() const;
int enumeratorCount() const;
int classInfoCount() const;
int relatedMetaObjectCount() const;
QMetaMethodBuilder addMethod(const QByteArray& signature);
QMetaMethodBuilder addMethod(const QByteArray& signature, const QByteArray& returnType);
QMetaMethodBuilder addMethod(const QMetaMethod& prototype);
QMetaMethodBuilder addSlot(const QByteArray& signature);
QMetaMethodBuilder addSignal(const QByteArray& signature);
QMetaMethodBuilder addConstructor(const QByteArray& signature);
QMetaMethodBuilder addConstructor(const QMetaMethod& prototype);
QMetaPropertyBuilder addProperty(const QByteArray& name, const QByteArray& type, int notifierId=-1);
QMetaPropertyBuilder addProperty(const QByteArray& name, const QByteArray& type, QMetaType metaType, int notifierId=-1);
QMetaPropertyBuilder addProperty(const QMetaProperty& prototype);
QMetaEnumBuilder addEnumerator(const QByteArray& name);
QMetaEnumBuilder addEnumerator(const QMetaEnum& prototype);
int addClassInfo(const QByteArray& name, const QByteArray& value);
int addRelatedMetaObject(const QMetaObject *meta);
void addMetaObject(const QMetaObject *prototype, QMetaObjectBuilder::AddMembers members = AllMembers);
QMetaMethodBuilder method(int index) const;
QMetaMethodBuilder constructor(int index) const;
QMetaPropertyBuilder property(int index) const;
QMetaEnumBuilder enumerator(int index) const;
const QMetaObject *relatedMetaObject(int index) const;
QByteArray classInfoName(int index) const;
QByteArray classInfoValue(int index) const;
void removeMethod(int index);
void removeConstructor(int index);
void removeProperty(int index);
void removeEnumerator(int index);
void removeClassInfo(int index);
void removeRelatedMetaObject(int index);
int indexOfMethod(const QByteArray& signature);
int indexOfSignal(const QByteArray& signature);
int indexOfSlot(const QByteArray& signature);
int indexOfConstructor(const QByteArray& signature);
int indexOfProperty(const QByteArray& name);
int indexOfEnumerator(const QByteArray& name);
int indexOfClassInfo(const QByteArray& name);
typedef void (*StaticMetacallFunction)(QObject *, QMetaObject::Call, int, void **);
QMetaObjectBuilder::StaticMetacallFunction staticMetacallFunction() const;
void setStaticMetacallFunction(QMetaObjectBuilder::StaticMetacallFunction value);
QMetaObject *toMetaObject() const;
private:
Q_DISABLE_COPY_MOVE(QMetaObjectBuilder)
QMetaObjectBuilderPrivate *d;
friend class QMetaMethodBuilder;
friend class QMetaPropertyBuilder;
friend class QMetaEnumBuilder;
};
class Q_CORE_EXPORT QMetaMethodBuilder
{
public:
QMetaMethodBuilder() : _mobj(nullptr), _index(0) {}
int index() const;
QMetaMethod::MethodType methodType() const;
QByteArray signature() const;
QByteArray returnType() const;
void setReturnType(const QByteArray& value);
QList<QByteArray> parameterTypes() const;
QList<QByteArray> parameterNames() const;
void setParameterNames(const QList<QByteArray>& value);
QByteArray tag() const;
void setTag(const QByteArray& value);
QMetaMethod::Access access() const;
void setAccess(QMetaMethod::Access value);
int attributes() const;
void setAttributes(int value);
int isConst() const;
void setConst(bool methodIsConst=true);
int revision() const;
void setRevision(int revision);
private:
const QMetaObjectBuilder *_mobj;
int _index;
friend class QMetaObjectBuilder;
friend class QMetaPropertyBuilder;
QMetaMethodBuilder(const QMetaObjectBuilder *mobj, int index)
: _mobj(mobj), _index(index) {}
QMetaMethodBuilderPrivate *d_func() const;
};
class Q_CORE_EXPORT QMetaPropertyBuilder
{
public:
QMetaPropertyBuilder() : _mobj(nullptr), _index(0) {}
int index() const { return _index; }
QByteArray name() const;
QByteArray type() const;
bool hasNotifySignal() const;
QMetaMethodBuilder notifySignal() const;
void setNotifySignal(const QMetaMethodBuilder& value);
void removeNotifySignal();
bool isReadable() const;
bool isWritable() const;
bool isResettable() const;
bool isDesignable() const;
bool isScriptable() const;
bool isStored() const;
bool isEditable() const;
bool isUser() const;
bool hasStdCppSet() const;
bool isEnumOrFlag() const;
bool isConstant() const;
bool isFinal() const;
bool isAlias() const;
bool isBindable() const;
void setReadable(bool value);
void setWritable(bool value);
void setResettable(bool value);
void setDesignable(bool value);
void setScriptable(bool value);
void setStored(bool value);
void setUser(bool value);
void setStdCppSet(bool value);
void setEnumOrFlag(bool value);
void setConstant(bool value);
void setFinal(bool value);
void setAlias(bool value);
void setBindable(bool value);
int revision() const;
void setRevision(int revision);
private:
const QMetaObjectBuilder *_mobj;
int _index;
friend class QMetaObjectBuilder;
QMetaPropertyBuilder(const QMetaObjectBuilder *mobj, int index)
: _mobj(mobj), _index(index) {}
QMetaPropertyBuilderPrivate *d_func() const;
};
class Q_CORE_EXPORT QMetaEnumBuilder
{
public:
QMetaEnumBuilder() : _mobj(nullptr), _index(0) {}
int index() const { return _index; }
QByteArray name() const;
QByteArray enumName() const;
void setEnumName(const QByteArray &alias);
bool isFlag() const;
void setIsFlag(bool value);
bool isScoped() const;
void setIsScoped(bool value);
int keyCount() const;
QByteArray key(int index) const;
int value(int index) const;
int addKey(const QByteArray& name, int value);
void removeKey(int index);
private:
const QMetaObjectBuilder *_mobj;
int _index;
friend class QMetaObjectBuilder;
QMetaEnumBuilder(const QMetaObjectBuilder *mobj, int index)
: _mobj(mobj), _index(index) {}
QMetaEnumBuilderPrivate *d_func() const;
};
class Q_CORE_EXPORT QMetaStringTable
{
Q_DISABLE_COPY_MOVE(QMetaStringTable)
public:
explicit QMetaStringTable(const QByteArray &className);
int enter(const QByteArray &value);
static int preferredAlignment();
int blobSize() const;
void writeBlob(char *out) const;
private:
typedef QHash<QByteArray, int> Entries; // string --> index mapping
Entries m_entries;
int m_index;
QByteArray m_className;
};
Q_DECLARE_OPERATORS_FOR_FLAGS(QMetaObjectBuilder::AddMembers)
QT_END_NAMESPACE
#endif

View File

@@ -0,0 +1,215 @@
// 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 QMETATYPE_P_H
#define QMETATYPE_P_H
//
// W A R N I N G
// -------------
//
// This file is not part of the Qt API. It exists purely as an
// implementation detail. This header file may change from version to
// version without notice, or even be removed.
//
// We mean it.
//
#include <QtCore/private/qglobal_p.h>
#include "qmetatype.h"
QT_BEGIN_NAMESPACE
#define QMETATYPE_CONVERTER(To, From, assign_and_return) \
case makePair(QMetaType::To, QMetaType::From): \
if (onlyCheck) \
return true; \
{ \
const From &source = *static_cast<const From *>(from); \
To &result = *static_cast<To *>(to); \
assign_and_return \
}
#define QMETATYPE_CONVERTER_ASSIGN(To, From) \
QMETATYPE_CONVERTER(To, From, result = To(source); return true;)
#define QMETATYPE_CONVERTER_FUNCTION(To, assign_and_return) \
{ \
To &result = *static_cast<To *>(r); \
assign_and_return \
}
class QMetaTypeModuleHelper
{
Q_DISABLE_COPY_MOVE(QMetaTypeModuleHelper)
protected:
QMetaTypeModuleHelper() = default;
~QMetaTypeModuleHelper() = default;
public:
static constexpr auto makePair(int from, int to) -> quint64
{
return (quint64(from) << 32) + quint64(to);
}
virtual const QtPrivate::QMetaTypeInterface *interfaceForType(int) const = 0;
virtual bool convert(const void *, int, void *, int) const { return false; }
};
extern Q_CORE_EXPORT const QMetaTypeModuleHelper *qMetaTypeGuiHelper;
extern Q_CORE_EXPORT const QMetaTypeModuleHelper *qMetaTypeWidgetsHelper;
namespace QtMetaTypePrivate {
template<typename T>
struct TypeDefinition
{
static const bool IsAvailable = true;
};
// Ignore these types, as incomplete
#ifdef QT_BOOTSTRAPPED
template<> struct TypeDefinition<QBitArray> { static const bool IsAvailable = false; };
template<> struct TypeDefinition<QCborArray> { static const bool IsAvailable = false; };
template<> struct TypeDefinition<QCborMap> { static const bool IsAvailable = false; };
template<> struct TypeDefinition<QCborSimpleType> { static const bool IsAvailable = false; };
template<> struct TypeDefinition<QCborValue> { static const bool IsAvailable = false; };
#if QT_CONFIG(easingcurve)
template<> struct TypeDefinition<QEasingCurve> { static const bool IsAvailable = false; };
#endif
template<> struct TypeDefinition<QJsonArray> { static const bool IsAvailable = false; };
template<> struct TypeDefinition<QJsonDocument> { static const bool IsAvailable = false; };
template<> struct TypeDefinition<QJsonObject> { static const bool IsAvailable = false; };
template<> struct TypeDefinition<QJsonValue> { static const bool IsAvailable = false; };
template<> struct TypeDefinition<QUrl> { static const bool IsAvailable = false; };
template<> struct TypeDefinition<QByteArrayList> { static const bool IsAvailable = false; };
#endif
#ifdef QT_NO_GEOM_VARIANT
template<> struct TypeDefinition<QRect> { static const bool IsAvailable = false; };
template<> struct TypeDefinition<QRectF> { static const bool IsAvailable = false; };
template<> struct TypeDefinition<QSize> { static const bool IsAvailable = false; };
template<> struct TypeDefinition<QSizeF> { static const bool IsAvailable = false; };
template<> struct TypeDefinition<QLine> { static const bool IsAvailable = false; };
template<> struct TypeDefinition<QLineF> { static const bool IsAvailable = false; };
template<> struct TypeDefinition<QPoint> { static const bool IsAvailable = false; };
template<> struct TypeDefinition<QPointF> { static const bool IsAvailable = false; };
#endif
#if !QT_CONFIG(regularexpression)
template<> struct TypeDefinition<QRegularExpression> { static const bool IsAvailable = false; };
#endif
#ifdef QT_NO_CURSOR
template<> struct TypeDefinition<QCursor> { static const bool IsAvailable = false; };
#endif
#ifdef QT_NO_MATRIX4X4
template<> struct TypeDefinition<QMatrix4x4> { static const bool IsAvailable = false; };
#endif
#ifdef QT_NO_VECTOR2D
template<> struct TypeDefinition<QVector2D> { static const bool IsAvailable = false; };
#endif
#ifdef QT_NO_VECTOR3D
template<> struct TypeDefinition<QVector3D> { static const bool IsAvailable = false; };
#endif
#ifdef QT_NO_VECTOR4D
template<> struct TypeDefinition<QVector4D> { static const bool IsAvailable = false; };
#endif
#ifdef QT_NO_QUATERNION
template<> struct TypeDefinition<QQuaternion> { static const bool IsAvailable = false; };
#endif
#ifdef QT_NO_ICON
template<> struct TypeDefinition<QIcon> { static const bool IsAvailable = false; };
#endif
template <typename T> inline bool isInterfaceFor(const QtPrivate::QMetaTypeInterface *iface)
{
// typeId for built-in types are fixed and require no registration
static_assert(QMetaTypeId2<T>::IsBuiltIn, "This function only works for built-in types");
static constexpr int typeId = QtPrivate::BuiltinMetaType<T>::value;
return iface->typeId.loadRelaxed() == typeId;
}
template <typename FPointer>
inline bool checkMetaTypeFlagOrPointer(const QtPrivate::QMetaTypeInterface *iface, FPointer ptr, QMetaType::TypeFlag Flag)
{
// helper to the isXxxConstructible & isDestructible functions below: a
// meta type has the trait if the trait is trivial or we have the pointer
// to perform the operation
Q_ASSERT(!isInterfaceFor<void>(iface));
Q_ASSERT(iface->size);
return ptr != nullptr || (iface->flags & Flag) == 0;
}
inline bool isDefaultConstructible(const QtPrivate::QMetaTypeInterface *iface) noexcept
{
return checkMetaTypeFlagOrPointer(iface, iface->defaultCtr, QMetaType::NeedsConstruction);
}
inline bool isCopyConstructible(const QtPrivate::QMetaTypeInterface *iface) noexcept
{
return checkMetaTypeFlagOrPointer(iface, iface->copyCtr, QMetaType::NeedsCopyConstruction);
}
inline bool isMoveConstructible(const QtPrivate::QMetaTypeInterface *iface) noexcept
{
return checkMetaTypeFlagOrPointer(iface, iface->moveCtr, QMetaType::NeedsMoveConstruction);
}
inline bool isDestructible(const QtPrivate::QMetaTypeInterface *iface) noexcept
{
/* For metatypes of revision 1, the NeedsDestruction was set even for trivially
destructible types, but their dtor pointer would be null.
For that reason, we need the additional check here.
*/
return iface->revision < 1 ||
checkMetaTypeFlagOrPointer(iface, iface->dtor, QMetaType::NeedsDestruction);
}
inline void defaultConstruct(const QtPrivate::QMetaTypeInterface *iface, void *where)
{
Q_ASSERT(isDefaultConstructible(iface));
if (iface->defaultCtr)
iface->defaultCtr(iface, where);
else
memset(where, 0, iface->size);
}
inline void copyConstruct(const QtPrivate::QMetaTypeInterface *iface, void *where, const void *copy)
{
Q_ASSERT(isCopyConstructible(iface));
if (iface->copyCtr)
iface->copyCtr(iface, where, copy);
else
memcpy(where, copy, iface->size);
}
inline void construct(const QtPrivate::QMetaTypeInterface *iface, void *where, const void *copy)
{
if (copy)
copyConstruct(iface, where, copy);
else
defaultConstruct(iface, where);
}
inline void destruct(const QtPrivate::QMetaTypeInterface *iface, void *where)
{
Q_ASSERT(isDestructible(iface));
if (iface->dtor)
iface->dtor(iface, where);
}
const char *typedefNameForType(const QtPrivate::QMetaTypeInterface *type_d);
template<typename T>
static const QT_PREPEND_NAMESPACE(QtPrivate::QMetaTypeInterface) *getInterfaceFromType()
{
if constexpr (QtMetaTypePrivate::TypeDefinition<T>::IsAvailable) {
return &QT_PREPEND_NAMESPACE(QtPrivate::QMetaTypeInterfaceWrapper)<T>::metaType;
}
return nullptr;
}
#define QT_METATYPE_CONVERT_ID_TO_TYPE(MetaTypeName, MetaTypeId, RealName) \
case QMetaType::MetaTypeName: \
return QtMetaTypePrivate::getInterfaceFromType<RealName>();
} //namespace QtMetaTypePrivate
QT_END_NAMESPACE
#endif // QMETATYPE_P_H

View File

@@ -0,0 +1,37 @@
// Copyright (C) 2020 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 QMILANKOVICCALENDAR_CALENDAR_P_H
#define QMILANKOVICCALENDAR_CALENDAR_P_H
//
// W A R N I N G
// -------------
//
// This file is not part of the Qt API. It exists for the convenience
// of calendar implementations. This header file may change from version to
// version without notice, or even be removed.
//
// We mean it.
//
#include "qromancalendar_p.h"
QT_BEGIN_NAMESPACE
class Q_CORE_EXPORT QMilankovicCalendar : public QRomanCalendar
{
public:
// Calendar properties:
QString name() const override;
static QStringList nameList();
// Date queries:
bool isLeapYear(int year) const override;
// Julian Day conversions:
bool dateToJulianDay(int year, int month, int day, qint64 *jd) const override;
QCalendar::YearMonthDay julianDayToDate(qint64 jd) const override;
};
QT_END_NAMESPACE
#endif // QMILANKOVICCALENDAR_CALENDAR_P_H

View File

@@ -0,0 +1,93 @@
// Copyright (C) 2016 The Qt Company Ltd.
// Copyright (C) 2015 Klaralvdalens Datakonsult AB, a KDAB Group company, info@kdab.com, author David Faure <david.faure@kdab.com>
// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only
#ifndef QMIMEDATABASE_P_H
#define QMIMEDATABASE_P_H
//
// W A R N I N G
// -------------
//
// This file is not part of the Qt API. It exists purely as an
// implementation detail. This header file may change from version to
// version without notice, or even be removed.
//
// We mean it.
//
#include "qmimedatabase.h"
#include "qmimetype.h"
QT_REQUIRE_CONFIG(mimetype);
#include "qmimetype_p.h"
#include "qmimeglobpattern_p.h"
#include <QtCore/qelapsedtimer.h>
#include <QtCore/qlist.h>
#include <QtCore/qmutex.h>
#include <vector>
#include <memory>
QT_BEGIN_NAMESPACE
class QFileInfo;
class QIODevice;
class QMimeDatabase;
class QMimeProviderBase;
class QMimeDatabasePrivate
{
public:
Q_DISABLE_COPY_MOVE(QMimeDatabasePrivate)
QMimeDatabasePrivate();
~QMimeDatabasePrivate();
static QMimeDatabasePrivate *instance();
const QString &defaultMimeType() const { return m_defaultMimeType; }
bool inherits(const QString &mime, const QString &parent);
QList<QMimeType> allMimeTypes();
QString resolveAlias(const QString &nameOrAlias);
QStringList parents(const QString &mimeName);
QMimeType mimeTypeForName(const QString &nameOrAlias);
QMimeType mimeTypeForFileNameAndData(const QString &fileName, QIODevice *device);
QMimeType mimeTypeForFileExtension(const QString &fileName);
QMimeType mimeTypeForData(QIODevice *device);
QMimeType mimeTypeForFile(const QString &fileName, const QFileInfo &fileInfo, QMimeDatabase::MatchMode mode);
QMimeType findByData(const QByteArray &data, int *priorityPtr);
QStringList mimeTypeForFileName(const QString &fileName);
QMimeGlobMatchResult findByFileName(const QString &fileName);
// API for QMimeType. Takes care of locking the mutex.
void loadMimeTypePrivate(QMimeTypePrivate &mimePrivate);
void loadGenericIcon(QMimeTypePrivate &mimePrivate);
void loadIcon(QMimeTypePrivate &mimePrivate);
QStringList mimeParents(const QString &mimeName);
QStringList listAliases(const QString &mimeName);
bool mimeInherits(const QString &mime, const QString &parent);
private:
using Providers = std::vector<std::unique_ptr<QMimeProviderBase>>;
const Providers &providers();
bool shouldCheck();
void loadProviders();
QString fallbackParent(const QString &mimeTypeName) const;
const QString m_defaultMimeType;
mutable Providers m_providers;
QElapsedTimer m_lastCheck;
public:
QMutex mutex;
};
QT_END_NAMESPACE
#endif // QMIMEDATABASE_P_H

View File

@@ -0,0 +1,141 @@
// 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 QMIMEGLOBPATTERN_P_H
#define QMIMEGLOBPATTERN_P_H
//
// W A R N I N G
// -------------
//
// This file is not part of the Qt API. It exists purely as an
// implementation detail. This header file may change from version to
// version without notice, or even be removed.
//
// We mean it.
//
#include <QtCore/private/qglobal_p.h>
QT_REQUIRE_CONFIG(mimetype);
#include <QtCore/qstringlist.h>
#include <QtCore/qhash.h>
QT_BEGIN_NAMESPACE
struct QMimeGlobMatchResult
{
void addMatch(const QString &mimeType, int weight, const QString &pattern,
qsizetype knownSuffixLength = 0);
QStringList m_matchingMimeTypes; // only those with highest weight
QStringList m_allMatchingMimeTypes;
int m_weight = 0;
qsizetype m_matchingPatternLength = 0;
qsizetype m_knownSuffixLength = 0;
};
class QMimeGlobPattern
{
public:
static const unsigned MaxWeight = 100;
static const unsigned DefaultWeight = 50;
static const unsigned MinWeight = 1;
explicit QMimeGlobPattern(const QString &thePattern, const QString &theMimeType, unsigned theWeight = DefaultWeight, Qt::CaseSensitivity s = Qt::CaseInsensitive) :
m_pattern(s == Qt::CaseInsensitive ? thePattern.toLower() : thePattern),
m_mimeType(theMimeType),
m_weight(theWeight),
m_caseSensitivity(s),
m_patternType(detectPatternType(m_pattern))
{
}
void swap(QMimeGlobPattern &other) noexcept
{
qSwap(m_pattern, other.m_pattern);
qSwap(m_mimeType, other.m_mimeType);
qSwap(m_weight, other.m_weight);
qSwap(m_caseSensitivity, other.m_caseSensitivity);
qSwap(m_patternType, other.m_patternType);
}
bool matchFileName(const QString &inputFileName) const;
inline const QString &pattern() const { return m_pattern; }
inline unsigned weight() const { return m_weight; }
inline const QString &mimeType() const { return m_mimeType; }
inline bool isCaseSensitive() const { return m_caseSensitivity == Qt::CaseSensitive; }
private:
enum PatternType {
SuffixPattern,
PrefixPattern,
LiteralPattern,
VdrPattern, // special handling for "[0-9][0-9][0-9].vdr" pattern
AnimPattern, // special handling for "*.anim[1-9j]" pattern
OtherPattern
};
PatternType detectPatternType(const QString &pattern) const;
QString m_pattern;
QString m_mimeType;
int m_weight;
Qt::CaseSensitivity m_caseSensitivity;
PatternType m_patternType;
};
Q_DECLARE_SHARED(QMimeGlobPattern)
class QMimeGlobPatternList : public QList<QMimeGlobPattern>
{
public:
bool hasPattern(const QString &mimeType, const QString &pattern) const
{
const_iterator it = begin();
const const_iterator myend = end();
for (; it != myend; ++it)
if ((*it).pattern() == pattern && (*it).mimeType() == mimeType)
return true;
return false;
}
/*!
"noglobs" is very rare occurrence, so it's ok if it's slow
*/
void removeMimeType(const QString &mimeType)
{
auto isMimeTypeEqual = [&mimeType](const QMimeGlobPattern &pattern) {
return pattern.mimeType() == mimeType;
};
removeIf(isMimeTypeEqual);
}
void match(QMimeGlobMatchResult &result, const QString &fileName) const;
};
/*!
Result of the globs parsing, as data structures ready for efficient MIME type matching.
This contains:
1) a map of fast regular patterns (e.g. *.txt is stored as "txt" in a qhash's key)
2) a linear list of high-weight globs
3) a linear list of low-weight globs
*/
class QMimeAllGlobPatterns
{
public:
typedef QHash<QString, QStringList> PatternsMap; // MIME type -> patterns
void addGlob(const QMimeGlobPattern &glob);
void removeMimeType(const QString &mimeType);
void matchingGlobs(const QString &fileName, QMimeGlobMatchResult &result) const;
void clear();
PatternsMap m_fastPatterns; // example: "doc" -> "application/msword", "text/plain"
QMimeGlobPatternList m_highWeightGlobs;
QMimeGlobPatternList m_lowWeightGlobs; // <= 50, including the non-fast 50 patterns
};
QT_END_NAMESPACE
#endif // QMIMEGLOBPATTERN_P_H

View File

@@ -0,0 +1,94 @@
// 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 QMIMEMAGICRULE_P_H
#define QMIMEMAGICRULE_P_H
//
// W A R N I N G
// -------------
//
// This file is not part of the Qt API. It exists purely as an
// implementation detail. This header file may change from version to
// version without notice, or even be removed.
//
// We mean it.
//
#include <QtCore/private/qglobal_p.h>
QT_REQUIRE_CONFIG(mimetype);
#include <QtCore/qbytearray.h>
#include <QtCore/qscopedpointer.h>
#include <QtCore/qlist.h>
QT_BEGIN_NAMESPACE
class QMimeMagicRule
{
public:
enum Type { Invalid = 0, String, Host16, Host32, Big16, Big32, Little16, Little32, Byte };
QMimeMagicRule(const QString &typeStr, const QByteArray &value, const QString &offsets,
const QByteArray &mask, QString *errorString);
void swap(QMimeMagicRule &other) noexcept
{
qSwap(m_type, other.m_type);
qSwap(m_value, other.m_value);
qSwap(m_startPos, other.m_startPos);
qSwap(m_endPos, other.m_endPos);
qSwap(m_mask, other.m_mask);
qSwap(m_pattern, other.m_pattern);
qSwap(m_number, other.m_number);
qSwap(m_numberMask, other.m_numberMask);
qSwap(m_matchFunction, other.m_matchFunction);
}
bool operator==(const QMimeMagicRule &other) const;
Type type() const { return m_type; }
QByteArray value() const { return m_value; }
int startPos() const { return m_startPos; }
int endPos() const { return m_endPos; }
QByteArray mask() const;
bool isValid() const { return m_matchFunction != nullptr; }
bool matches(const QByteArray &data) const;
QList<QMimeMagicRule> m_subMatches;
static Type type(const QByteArray &type);
static QByteArray typeName(Type type);
static bool matchSubstring(const char *dataPtr, qsizetype dataSize, int rangeStart,
int rangeLength, qsizetype valueLength, const char *valueData,
const char *mask);
private:
Type m_type;
QByteArray m_value;
int m_startPos;
int m_endPos;
QByteArray m_mask;
QByteArray m_pattern;
quint32 m_number;
quint32 m_numberMask;
typedef bool (QMimeMagicRule::*MatchFunction)(const QByteArray &data) const;
MatchFunction m_matchFunction;
private:
// match functions
bool matchString(const QByteArray &data) const;
template <typename T>
bool matchNumber(const QByteArray &data) const;
};
Q_DECLARE_SHARED(QMimeMagicRule)
QT_END_NAMESPACE
#endif // QMIMEMAGICRULE_H

View File

@@ -0,0 +1,61 @@
// 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 QMIMEMAGICRULEMATCHER_P_H
#define QMIMEMAGICRULEMATCHER_P_H
//
// W A R N I N G
// -------------
//
// This file is not part of the Qt API. It exists purely as an
// implementation detail. This header file may change from version to
// version without notice, or even be removed.
//
// We mean it.
//
#include "qmimemagicrule_p.h"
QT_REQUIRE_CONFIG(mimetype);
#include <QtCore/qbytearray.h>
#include <QtCore/qlist.h>
#include <QtCore/qstring.h>
QT_BEGIN_NAMESPACE
class QMimeMagicRuleMatcher
{
public:
explicit QMimeMagicRuleMatcher(const QString &mime, unsigned priority = 65535);
void swap(QMimeMagicRuleMatcher &other) noexcept
{
qSwap(m_list, other.m_list);
qSwap(m_priority, other.m_priority);
qSwap(m_mimetype, other.m_mimetype);
}
bool operator==(const QMimeMagicRuleMatcher &other) const;
void addRule(const QMimeMagicRule &rule);
void addRules(const QList<QMimeMagicRule> &rules);
QList<QMimeMagicRule> magicRules() const;
bool matches(const QByteArray &data) const;
unsigned priority() const;
QString mimetype() const { return m_mimetype; }
private:
QList<QMimeMagicRule> m_list;
unsigned m_priority;
QString m_mimetype;
};
Q_DECLARE_SHARED(QMimeMagicRuleMatcher)
QT_END_NAMESPACE
#endif // QMIMEMAGICRULEMATCHER_P_H

View File

@@ -0,0 +1,192 @@
// Copyright (C) 2016 The Qt Company Ltd.
// Copyright (C) 2015 Klaralvdalens Datakonsult AB, a KDAB Group company, info@kdab.com, author David Faure <david.faure@kdab.com>
// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only
#ifndef QMIMEPROVIDER_P_H
#define QMIMEPROVIDER_P_H
//
// W A R N I N G
// -------------
//
// This file is not part of the Qt API. It exists purely as an
// implementation detail. This header file may change from version to
// version without notice, or even be removed.
//
// We mean it.
//
#include "qmimedatabase_p.h"
QT_REQUIRE_CONFIG(mimetype);
#include "qmimeglobpattern_p.h"
#include <QtCore/qdatetime.h>
#include <QtCore/qset.h>
#include <QtCore/qmap.h>
QT_BEGIN_NAMESPACE
class QMimeMagicRuleMatcher;
class QMimeProviderBase
{
public:
QMimeProviderBase(QMimeDatabasePrivate *db, const QString &directory);
virtual ~QMimeProviderBase() {}
virtual bool isValid() = 0;
virtual bool isInternalDatabase() const = 0;
virtual QMimeType mimeTypeForName(const QString &name) = 0;
virtual void addFileNameMatches(const QString &fileName, QMimeGlobMatchResult &result) = 0;
virtual void addParents(const QString &mime, QStringList &result) = 0;
virtual QString resolveAlias(const QString &name) = 0;
virtual void addAliases(const QString &name, QStringList &result) = 0;
virtual void findByMagic(const QByteArray &data, int *accuracyPtr, QMimeType &candidate) = 0;
virtual void addAllMimeTypes(QList<QMimeType> &result) = 0;
virtual bool loadMimeTypePrivate(QMimeTypePrivate &) { return false; }
virtual void loadIcon(QMimeTypePrivate &) {}
virtual void loadGenericIcon(QMimeTypePrivate &) {}
virtual void ensureLoaded() {}
virtual void excludeMimeTypeGlobs(const QStringList &) {}
QString directory() const { return m_directory; }
QMimeDatabasePrivate *m_db;
QString m_directory;
/*
MimeTypes with "glob-deleteall" tags are handled differently by each provider
sub-class:
- QMimeBinaryProvider parses glob-deleteall tags lazily, i.e. only when loadMimeTypePrivate()
is called, and clears the glob patterns associated with mimetypes that have this tag
- QMimeXMLProvider parses glob-deleteall from the the start, i.e. when a XML file is
parsed with QMimeTypeParser
The two lists below are used to let both provider types (XML and Binary) communicate
about mimetypes with glob-deleteall.
*/
/*
List of mimetypes in _this_ Provider that have a "glob-deleteall" tag,
glob patterns for those mimetypes should be ignored in all _other_ lower
precedence Providers.
*/
QStringList m_mimeTypesWithDeletedGlobs;
/*
List of mimetypes with glob patterns that are "overwritten" in _this_ Provider,
by a "glob-deleteall" tag in a mimetype definition in a _higher precedence_
Provider. With QMimeBinaryProvider, we can't change the data in the binary mmap'ed
file, hence the need for this list.
*/
QStringList m_mimeTypesWithExcludedGlobs;
};
/*
Parses the files 'mime.cache' and 'types' on demand
*/
class QMimeBinaryProvider final : public QMimeProviderBase
{
public:
QMimeBinaryProvider(QMimeDatabasePrivate *db, const QString &directory);
virtual ~QMimeBinaryProvider();
bool isValid() override;
bool isInternalDatabase() const override;
QMimeType mimeTypeForName(const QString &name) override;
void addFileNameMatches(const QString &fileName, QMimeGlobMatchResult &result) override;
void addParents(const QString &mime, QStringList &result) override;
QString resolveAlias(const QString &name) override;
void addAliases(const QString &name, QStringList &result) override;
void findByMagic(const QByteArray &data, int *accuracyPtr, QMimeType &candidate) override;
void addAllMimeTypes(QList<QMimeType> &result) override;
bool loadMimeTypePrivate(QMimeTypePrivate &) override;
void loadIcon(QMimeTypePrivate &) override;
void loadGenericIcon(QMimeTypePrivate &) override;
void ensureLoaded() override;
void excludeMimeTypeGlobs(const QStringList &toExclude) override;
private:
struct CacheFile;
void matchGlobList(QMimeGlobMatchResult &result, CacheFile *cacheFile, int offset, const QString &fileName);
bool matchSuffixTree(QMimeGlobMatchResult &result, CacheFile *cacheFile, int numEntries,
int firstOffset, const QString &fileName, qsizetype charPos,
bool caseSensitiveCheck);
bool matchMagicRule(CacheFile *cacheFile, int numMatchlets, int firstOffset, const QByteArray &data);
bool isMimeTypeGlobsExcluded(const char *name);
QLatin1StringView iconForMime(CacheFile *cacheFile, int posListOffset, const QByteArray &inputMime);
void loadMimeTypeList();
bool checkCacheChanged();
CacheFile *m_cacheFile = nullptr;
QStringList m_cacheFileNames;
QSet<QString> m_mimetypeNames;
bool m_mimetypeListLoaded;
struct MimeTypeExtra
{
// Both retrieved on demand in loadMimeTypePrivate
QHash<QString, QString> localeComments;
QStringList globPatterns;
};
QMap<QString, MimeTypeExtra> m_mimetypeExtra;
};
/*
Parses the raw XML files (slower)
*/
class QMimeXMLProvider final : public QMimeProviderBase
{
public:
enum InternalDatabaseEnum { InternalDatabase };
#if QT_CONFIG(mimetype_database)
enum : bool { InternalDatabaseAvailable = true };
#else
enum : bool { InternalDatabaseAvailable = false };
#endif
QMimeXMLProvider(QMimeDatabasePrivate *db, InternalDatabaseEnum);
QMimeXMLProvider(QMimeDatabasePrivate *db, const QString &directory);
~QMimeXMLProvider();
bool isValid() override;
bool isInternalDatabase() const override;
QMimeType mimeTypeForName(const QString &name) override;
void addFileNameMatches(const QString &fileName, QMimeGlobMatchResult &result) override;
void addParents(const QString &mime, QStringList &result) override;
QString resolveAlias(const QString &name) override;
void addAliases(const QString &name, QStringList &result) override;
void findByMagic(const QByteArray &data, int *accuracyPtr, QMimeType &candidate) override;
void addAllMimeTypes(QList<QMimeType> &result) override;
void ensureLoaded() override;
bool load(const QString &fileName, QString *errorMessage);
// Called by the mimetype xml parser
void addMimeType(const QMimeType &mt);
void excludeMimeTypeGlobs(const QStringList &toExclude) override;
void addGlobPattern(const QMimeGlobPattern &glob);
void addParent(const QString &child, const QString &parent);
void addAlias(const QString &alias, const QString &name);
void addMagicMatcher(const QMimeMagicRuleMatcher &matcher);
private:
void load(const QString &fileName);
void load(const char *data, qsizetype len);
typedef QHash<QString, QMimeType> NameMimeTypeMap;
NameMimeTypeMap m_nameMimeTypeMap;
typedef QHash<QString, QString> AliasHash;
AliasHash m_aliases;
typedef QHash<QString, QStringList> ParentsHash;
ParentsHash m_parents;
QMimeAllGlobPatterns m_mimeTypeGlobs;
QList<QMimeMagicRuleMatcher> m_magicMatchers;
QStringList m_allFiles;
};
QT_END_NAMESPACE
#endif // QMIMEPROVIDER_P_H

View File

@@ -0,0 +1,71 @@
// 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 QMIMETYPE_P_H
#define QMIMETYPE_P_H
//
// W A R N I N G
// -------------
//
// This file is not part of the Qt API. It exists purely as an
// implementation detail. This header file may change from version to
// version without notice, or even be removed.
//
// We mean it.
//
#include <QtCore/private/qglobal_p.h>
#include "qmimetype.h"
QT_REQUIRE_CONFIG(mimetype);
#include <QtCore/qhash.h>
#include <QtCore/qstringlist.h>
QT_BEGIN_NAMESPACE
class Q_AUTOTEST_EXPORT QMimeTypePrivate : public QSharedData
{
public:
typedef QHash<QString, QString> LocaleHash;
QMimeTypePrivate();
explicit QMimeTypePrivate(const QMimeType &other);
void clear();
void addGlobPattern(const QString &pattern);
bool loaded; // QSharedData leaves a 4 byte gap, so don't put 8 byte members first
bool fromCache; // true if this comes from the binary provider
bool hasGlobDeleteAll = false; // true if the mimetype has a glob-deleteall tag
QString name;
LocaleHash localeComments;
QString genericIconName;
QString iconName;
QStringList globPatterns;
};
QT_END_NAMESPACE
#define QMIMETYPE_BUILDER_FROM_RVALUE_REFS \
QT_BEGIN_NAMESPACE \
static QMimeType buildQMimeType ( \
QString &&name, \
QString &&genericIconName, \
QString &&iconName, \
QStringList &&globPatterns \
) \
{ \
QMimeTypePrivate qMimeTypeData; \
qMimeTypeData.loaded = true; \
qMimeTypeData.name = std::move(name); \
qMimeTypeData.genericIconName = std::move(genericIconName); \
qMimeTypeData.iconName = std::move(iconName); \
qMimeTypeData.globPatterns = std::move(globPatterns); \
return QMimeType(qMimeTypeData); \
} \
QT_END_NAMESPACE
#endif // QMIMETYPE_P_H

View File

@@ -0,0 +1,97 @@
// 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 QMIMETYPEPARSER_P_H
#define QMIMETYPEPARSER_P_H
//
// W A R N I N G
// -------------
//
// This file is not part of the Qt API. It exists purely as an
// implementation detail. This header file may change from version to
// version without notice, or even be removed.
//
// We mean it.
//
#include "qmimedatabase_p.h"
QT_REQUIRE_CONFIG(mimetype);
#include "qmimeprovider_p.h"
QT_BEGIN_NAMESPACE
class QIODevice;
class QMimeTypeParserBase
{
Q_DISABLE_COPY_MOVE(QMimeTypeParserBase)
public:
QMimeTypeParserBase() {}
virtual ~QMimeTypeParserBase() {}
bool parse(QIODevice *dev, const QString &fileName, QString *errorMessage);
static bool parseNumber(QStringView n, int *target, QString *errorMessage);
protected:
virtual bool process(const QMimeType &t, QString *errorMessage) = 0;
virtual bool process(const QMimeGlobPattern &t, QString *errorMessage) = 0;
virtual void processParent(const QString &child, const QString &parent) = 0;
virtual void processAlias(const QString &alias, const QString &name) = 0;
virtual void processMagicMatcher(const QMimeMagicRuleMatcher &matcher) = 0;
private:
enum ParseState {
ParseBeginning,
ParseMimeInfo,
ParseMimeType,
ParseComment,
ParseGenericIcon,
ParseIcon,
ParseGlobPattern,
ParseGlobDeleteAll,
ParseSubClass,
ParseAlias,
ParseMagic,
ParseMagicMatchRule,
ParseOtherMimeTypeSubTag,
ParseError
};
static ParseState nextState(ParseState currentState, QStringView startElement);
};
class QMimeTypeParser : public QMimeTypeParserBase
{
public:
explicit QMimeTypeParser(QMimeXMLProvider &provider) : m_provider(provider) {}
protected:
inline bool process(const QMimeType &t, QString *) override
{ m_provider.addMimeType(t); return true; }
inline bool process(const QMimeGlobPattern &glob, QString *) override
{ m_provider.addGlobPattern(glob); return true; }
inline void processParent(const QString &child, const QString &parent) override
{ m_provider.addParent(child, parent); }
inline void processAlias(const QString &alias, const QString &name) override
{ m_provider.addAlias(alias, name); }
inline void processMagicMatcher(const QMimeMagicRuleMatcher &matcher) override
{ m_provider.addMagicMatcher(matcher); }
private:
QMimeXMLProvider &m_provider;
};
QT_END_NAMESPACE
#endif // MIMETYPEPARSER_P_H

View File

@@ -0,0 +1,107 @@
// Copyright (C) 2016 The Qt Company Ltd.
// Copyright (C) 2016 Intel Corporation.
// Copyright (C) 2012 Olivier Goffart <ogoffart@woboq.com>
// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only
#ifndef QMUTEX_P_H
#define QMUTEX_P_H
//
// W A R N I N G
// -------------
//
// This file is not part of the Qt API. It exists for the convenience of
// qmutex.cpp and qmutex_unix.cpp. This header file may change from version to
// version without notice, or even be removed.
//
// We mean it.
//
#include <QtCore/private/qglobal_p.h>
#include <QtCore/qnamespace.h>
#include <QtCore/qmutex.h>
#include <QtCore/qatomic.h>
#include <QtCore/qdeadlinetimer.h>
#if defined(Q_OS_MAC)
# include <mach/semaphore.h>
#elif defined(Q_OS_UNIX)
# if _POSIX_VERSION-0 >= 200112L || _XOPEN_VERSION-0 >= 600
# include <semaphore.h>
# define QT_UNIX_SEMAPHORE
# endif
#endif
struct timespec;
QT_BEGIN_NAMESPACE
// We manipulate the pointer to this class in inline, atomic code,
// so syncqt mustn't mark them as private, so ELFVERSION:ignore-next
class QMutexPrivate
{
public:
~QMutexPrivate();
QMutexPrivate();
bool wait(int timeout = -1);
void wakeUp() noexcept;
// Control the lifetime of the privates
QAtomicInt refCount;
int id;
bool ref()
{
Q_ASSERT(refCount.loadRelaxed() >= 0);
int c;
do {
c = refCount.loadRelaxed();
if (c == 0)
return false;
} while (!refCount.testAndSetRelaxed(c, c + 1));
Q_ASSERT(refCount.loadRelaxed() >= 0);
return true;
}
void deref()
{
Q_ASSERT(refCount.loadRelaxed() >= 0);
if (!refCount.deref())
release();
Q_ASSERT(refCount.loadRelaxed() >= 0);
}
void release();
static QMutexPrivate *allocate();
QAtomicInt waiters; // Number of threads waiting on this mutex. (may be offset by -BigNumber)
QAtomicInt possiblyUnlocked; /* Boolean indicating that a timed wait timed out.
When it is true, a reference is held.
It is there to avoid a race that happens if unlock happens right
when the mutex is unlocked.
*/
enum { BigNumber = 0x100000 }; //Must be bigger than the possible number of waiters (number of threads)
void derefWaiters(int value) noexcept;
//platform specific stuff
#if defined(Q_OS_MAC)
semaphore_t mach_semaphore;
#elif defined(QT_UNIX_SEMAPHORE)
sem_t semaphore;
#elif defined(Q_OS_UNIX)
bool wakeup;
pthread_mutex_t mutex;
pthread_cond_t cond;
#endif
};
#ifdef Q_OS_UNIX
// helper functions for qmutex_unix.cpp and qwaitcondition_unix.cpp
// they are in qwaitcondition_unix.cpp actually
void qt_initialize_pthread_cond(pthread_cond_t *cond, const char *where);
void qt_abstime_for_timeout(struct timespec *ts, QDeadlineTimer deadline);
#endif
QT_END_NAMESPACE
#endif // QMUTEX_P_H

View File

@@ -0,0 +1,63 @@
// Copyright (C) 2021 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 QNATIVEINTERFACE_P_H
#define QNATIVEINTERFACE_P_H
//
// W A R N I N G
// -------------
//
// This file is not part of the Qt API. It exists purely as an
// implementation detail. This header file may change from version to
// version without notice, or even be removed.
//
// We mean it.
//
#include <QtCore/private/qglobal_p.h>
#include <QtCore/qloggingcategory.h>
QT_BEGIN_NAMESPACE
namespace QtPrivate {
Q_DECLARE_EXPORTED_LOGGING_CATEGORY(lcNativeInterface, Q_CORE_EXPORT)
}
// Provides a definition for the interface destructor
#define QT_DEFINE_NATIVE_INTERFACE_2(Namespace, InterfaceClass) \
QT_PREPEND_NAMESPACE(Namespace)::InterfaceClass::~InterfaceClass() = default
#define QT_DEFINE_NATIVE_INTERFACE(...) \
QT_OVERLOADED_MACRO(QT_DEFINE_NATIVE_INTERFACE, QNativeInterface, __VA_ARGS__)
#define QT_DEFINE_PRIVATE_NATIVE_INTERFACE(...) \
QT_OVERLOADED_MACRO(QT_DEFINE_NATIVE_INTERFACE, QNativeInterface::Private, __VA_ARGS__)
#define QT_NATIVE_INTERFACE_RETURN_IF(NativeInterface, baseType) \
{ \
using QtPrivate::lcNativeInterface; \
using QNativeInterface::Private::TypeInfo; \
qCDebug(lcNativeInterface, "Comparing requested interface name %s with available %s", \
name, TypeInfo<NativeInterface>::name()); \
if (qstrcmp(name, TypeInfo<NativeInterface>::name()) == 0) { \
qCDebug(lcNativeInterface, \
"Match for interface %s. Comparing revisions (requested %d / available %d)", \
name, revision, TypeInfo<NativeInterface>::revision()); \
if (revision == TypeInfo<NativeInterface>::revision()) { \
qCDebug(lcNativeInterface) << "Full match. Returning dynamic cast of" << baseType; \
return dynamic_cast<NativeInterface *>(baseType); \
} else { \
qCWarning(lcNativeInterface, \
"Native interface revision mismatch (requested %d / available %d) for " \
"interface %s", \
revision, TypeInfo<NativeInterface>::revision(), name); \
return nullptr; \
} \
} else { \
qCDebug(lcNativeInterface, "No match for requested interface name %s", name); \
} \
}
QT_END_NAMESPACE
#endif // QNATIVEINTERFACE_P_H

View File

@@ -0,0 +1,163 @@
// 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 QNONCONTIGUOUSBYTEDEVICE_P_H
#define QNONCONTIGUOUSBYTEDEVICE_P_H
//
// W A R N I N G
// -------------
//
// This file is not part of the Qt API. It exists for the convenience
// of a number of Qt sources files. This header file may change from
// version to version without notice, or even be removed.
//
// We mean it.
//
#include <QtCore/qobject.h>
#include <QtCore/qbytearray.h>
#include <QtCore/qbuffer.h>
#include <QtCore/qiodevice.h>
#include "private/qringbuffer_p.h"
#include <memory>
QT_BEGIN_NAMESPACE
class Q_CORE_EXPORT QNonContiguousByteDevice : public QObject
{
Q_OBJECT
public:
virtual const char *readPointer(qint64 maximumLength, qint64 &len) = 0;
virtual bool advanceReadPointer(qint64 amount) = 0;
virtual bool atEnd() const = 0;
virtual qint64 pos() const { return -1; }
virtual bool reset() = 0;
virtual qint64 size() const = 0;
virtual ~QNonContiguousByteDevice();
protected:
QNonContiguousByteDevice();
Q_SIGNALS:
void readyRead();
void readProgress(qint64 current, qint64 total);
};
class Q_CORE_EXPORT QNonContiguousByteDeviceFactory
{
public:
static QNonContiguousByteDevice *create(QIODevice *device);
static std::shared_ptr<QNonContiguousByteDevice> createShared(QIODevice *device);
static QNonContiguousByteDevice *create(QByteArray *byteArray);
static std::shared_ptr<QNonContiguousByteDevice> createShared(QByteArray *byteArray);
static QNonContiguousByteDevice *create(std::shared_ptr<QRingBuffer> ringBuffer);
static std::shared_ptr<QNonContiguousByteDevice> createShared(std::shared_ptr<QRingBuffer> ringBuffer);
static QIODevice *wrap(QNonContiguousByteDevice *byteDevice);
};
// the actual implementations
//
class QNonContiguousByteDeviceByteArrayImpl : public QNonContiguousByteDevice
{
public:
explicit QNonContiguousByteDeviceByteArrayImpl(QByteArray *ba);
~QNonContiguousByteDeviceByteArrayImpl();
const char *readPointer(qint64 maximumLength, qint64 &len) override;
bool advanceReadPointer(qint64 amount) override;
bool atEnd() const override;
bool reset() override;
qint64 size() const override;
qint64 pos() const override;
protected:
QByteArray *byteArray;
qint64 currentPosition;
};
class QNonContiguousByteDeviceRingBufferImpl : public QNonContiguousByteDevice
{
public:
explicit QNonContiguousByteDeviceRingBufferImpl(std::shared_ptr<QRingBuffer> rb);
~QNonContiguousByteDeviceRingBufferImpl();
const char *readPointer(qint64 maximumLength, qint64 &len) override;
bool advanceReadPointer(qint64 amount) override;
bool atEnd() const override;
bool reset() override;
qint64 size() const override;
qint64 pos() const override;
protected:
std::shared_ptr<QRingBuffer> ringBuffer;
qint64 currentPosition = 0;
};
class QNonContiguousByteDeviceIoDeviceImpl : public QNonContiguousByteDevice
{
Q_OBJECT
public:
explicit QNonContiguousByteDeviceIoDeviceImpl(QIODevice *d);
~QNonContiguousByteDeviceIoDeviceImpl();
const char *readPointer(qint64 maximumLength, qint64 &len) override;
bool advanceReadPointer(qint64 amount) override;
bool atEnd() const override;
bool reset() override;
qint64 size() const override;
qint64 pos() const override;
protected:
QIODevice *device;
QByteArray *currentReadBuffer;
qint64 currentReadBufferSize;
qint64 currentReadBufferAmount;
qint64 currentReadBufferPosition;
qint64 totalAdvancements;
bool eof;
qint64 initialPosition;
};
class QNonContiguousByteDeviceBufferImpl : public QNonContiguousByteDevice
{
Q_OBJECT
public:
explicit QNonContiguousByteDeviceBufferImpl(QBuffer *b);
~QNonContiguousByteDeviceBufferImpl();
const char *readPointer(qint64 maximumLength, qint64 &len) override;
bool advanceReadPointer(qint64 amount) override;
bool atEnd() const override;
bool reset() override;
qint64 size() const override;
protected:
QBuffer *buffer;
QByteArray byteArray;
QNonContiguousByteDeviceByteArrayImpl *arrayImpl;
};
// ... and the reverse thing
class QByteDeviceWrappingIoDevice : public QIODevice
{
public:
explicit QByteDeviceWrappingIoDevice(QNonContiguousByteDevice *bd);
~QByteDeviceWrappingIoDevice();
bool isSequential() const override;
bool atEnd() const override;
bool reset() override;
qint64 size() const override;
protected:
qint64 readData(char *data, qint64 maxSize) override;
qint64 writeData(const char *data, qint64 maxSize) override;
QNonContiguousByteDevice *byteDevice;
};
QT_END_NAMESPACE
#endif

View File

@@ -0,0 +1,62 @@
// Copyright (C) 2021 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 QNTDLL_P_H
#define QNTDLL_P_H
//
// W A R N I N G
// -------------
//
// This file is not part of the Qt API. It exists purely as an
// implementation detail. This header file may change from version to
// version without notice, or even be removed.
//
// We mean it.
//
#include <QtCore/private/qglobal_p.h>
#include <winternl.h>
QT_BEGIN_NAMESPACE
// keep the following structure as is, taken from
// https://docs.microsoft.com/en-us/windows-hardware/drivers/ddi/ntddk/ns-ntddk-_file_fs_sector_size_information
// Unfortunately we can't include the ntddk.h header, so we duplicate the code here.
typedef struct _FILE_FS_SECTOR_SIZE_INFORMATION {
ULONG LogicalBytesPerSector;
ULONG PhysicalBytesPerSectorForAtomicity;
ULONG PhysicalBytesPerSectorForPerformance;
ULONG FileSystemEffectivePhysicalBytesPerSectorForAtomicity;
ULONG Flags;
ULONG ByteOffsetForSectorAlignment;
ULONG ByteOffsetForPartitionAlignment;
} FILE_FS_SECTOR_SIZE_INFORMATION, *PFILE_FS_SECTOR_SIZE_INFORMATION;
#if !defined(Q_CC_MINGW)
// keep the following enumeration as is, taken from
// https://docs.microsoft.com/en-us/windows-hardware/drivers/ddi/wdm/ne-wdm-_fsinfoclass
// Unfortunately we can't include the wdm.h header, so we duplicate the code here.
typedef enum _FSINFOCLASS {
FileFsVolumeInformation,
FileFsLabelInformation,
FileFsSizeInformation,
FileFsDeviceInformation,
FileFsAttributeInformation,
FileFsControlInformation,
FileFsFullSizeInformation,
FileFsObjectIdInformation,
FileFsDriverPathInformation,
FileFsVolumeFlagsInformation,
FileFsSectorSizeInformation,
FileFsDataCopyInformation,
FileFsMetadataSizeInformation,
FileFsFullSizeInformationEx,
FileFsMaximumInformation
} FS_INFORMATION_CLASS, *PFS_INFORMATION_CLASS;
#endif
QT_END_NAMESPACE
#endif // QNTDLL_P_H

View File

@@ -0,0 +1,354 @@
// Copyright (C) 2020 The Qt Company Ltd.
// Copyright (C) 2021 Intel Corporation.
// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only
#ifndef QNUMERIC_P_H
#define QNUMERIC_P_H
//
// W A R N I N G
// -------------
//
// This file is not part of the Qt API. It exists purely as an
// implementation detail. This header file may change from version to
// version without notice, or even be removed.
//
// We mean it.
//
#include "QtCore/private/qglobal_p.h"
#include "QtCore/qnumeric.h"
#include "QtCore/qsimd.h"
#include <cmath>
#include <limits>
#include <type_traits>
#if !defined(Q_CC_MSVC) && defined(Q_OS_QNX)
# include <math.h>
# ifdef isnan
# define QT_MATH_H_DEFINES_MACROS
QT_BEGIN_NAMESPACE
namespace qnumeric_std_wrapper {
// the 'using namespace std' below is cases where the stdlib already put the math.h functions in the std namespace and undefined the macros.
Q_DECL_CONST_FUNCTION static inline bool math_h_isnan(double d) { using namespace std; return isnan(d); }
Q_DECL_CONST_FUNCTION static inline bool math_h_isinf(double d) { using namespace std; return isinf(d); }
Q_DECL_CONST_FUNCTION static inline bool math_h_isfinite(double d) { using namespace std; return isfinite(d); }
Q_DECL_CONST_FUNCTION static inline int math_h_fpclassify(double d) { using namespace std; return fpclassify(d); }
Q_DECL_CONST_FUNCTION static inline bool math_h_isnan(float f) { using namespace std; return isnan(f); }
Q_DECL_CONST_FUNCTION static inline bool math_h_isinf(float f) { using namespace std; return isinf(f); }
Q_DECL_CONST_FUNCTION static inline bool math_h_isfinite(float f) { using namespace std; return isfinite(f); }
Q_DECL_CONST_FUNCTION static inline int math_h_fpclassify(float f) { using namespace std; return fpclassify(f); }
}
QT_END_NAMESPACE
// These macros from math.h conflict with the real functions in the std namespace.
# undef signbit
# undef isnan
# undef isinf
# undef isfinite
# undef fpclassify
# endif // defined(isnan)
#endif
QT_BEGIN_NAMESPACE
namespace qnumeric_std_wrapper {
#if defined(QT_MATH_H_DEFINES_MACROS)
# undef QT_MATH_H_DEFINES_MACROS
Q_DECL_CONST_FUNCTION static inline bool isnan(double d) { return math_h_isnan(d); }
Q_DECL_CONST_FUNCTION static inline bool isinf(double d) { return math_h_isinf(d); }
Q_DECL_CONST_FUNCTION static inline bool isfinite(double d) { return math_h_isfinite(d); }
Q_DECL_CONST_FUNCTION static inline int fpclassify(double d) { return math_h_fpclassify(d); }
Q_DECL_CONST_FUNCTION static inline bool isnan(float f) { return math_h_isnan(f); }
Q_DECL_CONST_FUNCTION static inline bool isinf(float f) { return math_h_isinf(f); }
Q_DECL_CONST_FUNCTION static inline bool isfinite(float f) { return math_h_isfinite(f); }
Q_DECL_CONST_FUNCTION static inline int fpclassify(float f) { return math_h_fpclassify(f); }
#else
Q_DECL_CONST_FUNCTION static inline bool isnan(double d) { return std::isnan(d); }
Q_DECL_CONST_FUNCTION static inline bool isinf(double d) { return std::isinf(d); }
Q_DECL_CONST_FUNCTION static inline bool isfinite(double d) { return std::isfinite(d); }
Q_DECL_CONST_FUNCTION static inline int fpclassify(double d) { return std::fpclassify(d); }
Q_DECL_CONST_FUNCTION static inline bool isnan(float f) { return std::isnan(f); }
Q_DECL_CONST_FUNCTION static inline bool isinf(float f) { return std::isinf(f); }
Q_DECL_CONST_FUNCTION static inline bool isfinite(float f) { return std::isfinite(f); }
Q_DECL_CONST_FUNCTION static inline int fpclassify(float f) { return std::fpclassify(f); }
#endif
}
constexpr Q_DECL_CONST_FUNCTION static inline double qt_inf() noexcept
{
static_assert(std::numeric_limits<double>::has_infinity,
"platform has no definition for infinity for type double");
return std::numeric_limits<double>::infinity();
}
#if QT_CONFIG(signaling_nan)
constexpr Q_DECL_CONST_FUNCTION static inline double qt_snan() noexcept
{
static_assert(std::numeric_limits<double>::has_signaling_NaN,
"platform has no definition for signaling NaN for type double");
return std::numeric_limits<double>::signaling_NaN();
}
#endif
// Quiet NaN
constexpr Q_DECL_CONST_FUNCTION static inline double qt_qnan() noexcept
{
static_assert(std::numeric_limits<double>::has_quiet_NaN,
"platform has no definition for quiet NaN for type double");
return std::numeric_limits<double>::quiet_NaN();
}
Q_DECL_CONST_FUNCTION static inline bool qt_is_inf(double d)
{
return qnumeric_std_wrapper::isinf(d);
}
Q_DECL_CONST_FUNCTION static inline bool qt_is_nan(double d)
{
return qnumeric_std_wrapper::isnan(d);
}
Q_DECL_CONST_FUNCTION static inline bool qt_is_finite(double d)
{
return qnumeric_std_wrapper::isfinite(d);
}
Q_DECL_CONST_FUNCTION static inline int qt_fpclassify(double d)
{
return qnumeric_std_wrapper::fpclassify(d);
}
Q_DECL_CONST_FUNCTION static inline bool qt_is_inf(float f)
{
return qnumeric_std_wrapper::isinf(f);
}
Q_DECL_CONST_FUNCTION static inline bool qt_is_nan(float f)
{
return qnumeric_std_wrapper::isnan(f);
}
Q_DECL_CONST_FUNCTION static inline bool qt_is_finite(float f)
{
return qnumeric_std_wrapper::isfinite(f);
}
Q_DECL_CONST_FUNCTION static inline int qt_fpclassify(float f)
{
return qnumeric_std_wrapper::fpclassify(f);
}
#ifndef Q_QDOC
namespace {
/*!
Returns true if the double \a v can be converted to type \c T, false if
it's out of range. If the conversion is successful, the converted value is
stored in \a value; if it was not successful, \a value will contain the
minimum or maximum of T, depending on the sign of \a d. If \c T is
unsigned, then \a value contains the absolute value of \a v.
This function works for v containing infinities, but not NaN. It's the
caller's responsibility to exclude that possibility before calling it.
*/
template<typename T>
static inline bool convertDoubleTo(double v, T *value, bool allow_precision_upgrade = true)
{
static_assert(std::numeric_limits<T>::is_integer);
static_assert(std::is_integral_v<T>);
constexpr bool TypeIsLarger = std::numeric_limits<T>::digits > std::numeric_limits<double>::digits;
if constexpr (TypeIsLarger) {
using S = std::make_signed_t<T>;
constexpr S max_mantissa = S(1) << std::numeric_limits<double>::digits;
// T has more bits than double's mantissa, so don't allow "upgrading"
// to T (makes it look like the number had more precision than really
// was transmitted)
if (!allow_precision_upgrade && !(v <= double(max_mantissa) && v >= double(-max_mantissa - 1)))
return false;
}
constexpr T Tmin = (std::numeric_limits<T>::min)();
constexpr T Tmax = (std::numeric_limits<T>::max)();
// The [conv.fpint] (7.10 Floating-integral conversions) section of the C++
// standard says only exact conversions are guaranteed. Converting
// integrals to floating-point with loss of precision has implementation-
// defined behavior whether the next higher or next lower is returned;
// converting FP to integral is UB if it can't be represented.
//
// That means we can't write UINT64_MAX+1. Writing ldexp(1, 64) would be
// correct, but Clang, ICC and MSVC don't realize that it's a constant and
// the math call stays in the compiled code.
#ifdef Q_PROCESSOR_X86_64
// Of course, UB doesn't apply if we use intrinsics, in which case we are
// allowed to dpeend on exactly the processor's behavior. This
// implementation uses the truncating conversions from Scalar Double to
// integral types (CVTTSD2SI and VCVTTSD2USI), which is documented to
// return the "indefinite integer value" if the range of the target type is
// exceeded. (only implemented for x86-64 to avoid having to deal with the
// non-existence of the 64-bit intrinsics on i386)
if (std::numeric_limits<T>::is_signed) {
__m128d mv = _mm_set_sd(v);
# ifdef __AVX512F__
// use explicit round control and suppress exceptions
if (sizeof(T) > 4)
*value = T(_mm_cvtt_roundsd_i64(mv, _MM_FROUND_TO_NEAREST_INT | _MM_FROUND_NO_EXC));
else
*value = _mm_cvtt_roundsd_i32(mv, _MM_FROUND_TO_NEAREST_INT | _MM_FROUND_NO_EXC);
# else
*value = sizeof(T) > 4 ? T(_mm_cvttsd_si64(mv)) : _mm_cvttsd_si32(mv);
# endif
// if *value is the "indefinite integer value", check if the original
// variable \a v is the same value (Tmin is an exact representation)
if (*value == Tmin && !_mm_ucomieq_sd(mv, _mm_set_sd(Tmin))) {
// v != Tmin, so it was out of range
if (v > 0)
*value = Tmax;
return false;
}
// convert the integer back to double and compare for equality with v,
// to determine if we've lost any precision
__m128d mi = _mm_setzero_pd();
mi = sizeof(T) > 4 ? _mm_cvtsi64_sd(mv, *value) : _mm_cvtsi32_sd(mv, *value);
return _mm_ucomieq_sd(mv, mi);
}
# ifdef __AVX512F__
if (!std::numeric_limits<T>::is_signed) {
// Same thing as above, but this function operates on absolute values
// and the "indefinite integer value" for the 64-bit unsigned
// conversion (Tmax) is not representable in double, so it can never be
// the result of an in-range conversion. This is implemented for AVX512
// and later because of the unsigned conversion instruction. Converting
// to unsigned without losing an extra bit of precision prior to AVX512
// is left to the compiler below.
v = fabs(v);
__m128d mv = _mm_set_sd(v);
// use explicit round control and suppress exceptions
if (sizeof(T) > 4)
*value = T(_mm_cvtt_roundsd_u64(mv, _MM_FROUND_TO_NEAREST_INT | _MM_FROUND_NO_EXC));
else
*value = _mm_cvtt_roundsd_u32(mv, _MM_FROUND_TO_NEAREST_INT | _MM_FROUND_NO_EXC);
if (*value == Tmax) {
// no double can have an exact value of quint64(-1), but they can
// quint32(-1), so we need to compare for that
if (TypeIsLarger || _mm_ucomieq_sd(mv, _mm_set_sd(Tmax)))
return false;
}
// return true if it was an exact conversion
__m128d mi = _mm_setzero_pd();
mi = sizeof(T) > 4 ? _mm_cvtu64_sd(mv, *value) : _mm_cvtu32_sd(mv, *value);
return _mm_ucomieq_sd(mv, mi);
}
# endif
#endif
double supremum;
if (std::numeric_limits<T>::is_signed) {
supremum = -1.0 * Tmin; // -1 * (-2^63) = 2^63, exact (for T = qint64)
*value = Tmin;
if (v < Tmin)
return false;
} else {
using ST = typename std::make_signed<T>::type;
supremum = -2.0 * (std::numeric_limits<ST>::min)(); // -2 * (-2^63) = 2^64, exact (for T = quint64)
v = fabs(v);
}
*value = Tmax;
if (v >= supremum)
return false;
// Now we can convert, these two conversions cannot be UB
*value = T(v);
QT_WARNING_PUSH
QT_WARNING_DISABLE_FLOAT_COMPARE
return *value == v;
QT_WARNING_POP
}
template <typename T> inline bool add_overflow(T v1, T v2, T *r) { return qAddOverflow(v1, v2, r); }
template <typename T> inline bool sub_overflow(T v1, T v2, T *r) { return qSubOverflow(v1, v2, r); }
template <typename T> inline bool mul_overflow(T v1, T v2, T *r) { return qMulOverflow(v1, v2, r); }
template <typename T, T V2> bool add_overflow(T v1, std::integral_constant<T, V2>, T *r)
{
return qAddOverflow<T, V2>(v1, std::integral_constant<T, V2>{}, r);
}
template <auto V2, typename T> bool add_overflow(T v1, T *r)
{
return qAddOverflow<V2, T>(v1, r);
}
template <typename T, T V2> bool sub_overflow(T v1, std::integral_constant<T, V2>, T *r)
{
return qSubOverflow<T, V2>(v1, std::integral_constant<T, V2>{}, r);
}
template <auto V2, typename T> bool sub_overflow(T v1, T *r)
{
return qSubOverflow<V2, T>(v1, r);
}
template <typename T, T V2> bool mul_overflow(T v1, std::integral_constant<T, V2>, T *r)
{
return qMulOverflow<T, V2>(v1, std::integral_constant<T, V2>{}, r);
}
template <auto V2, typename T> bool mul_overflow(T v1, T *r)
{
return qMulOverflow<V2, T>(v1, r);
}
}
#endif // Q_QDOC
/*
Safely narrows \a x to \c{To}. Let \c L be
\c{std::numeric_limit<To>::min()} and \c H be \c{std::numeric_limit<To>::max()}.
If \a x is less than L, returns L. If \a x is greater than H,
returns H. Otherwise, returns \c{To(x)}.
*/
template <typename To, typename From>
static constexpr auto qt_saturate(From x)
{
static_assert(std::is_integral_v<To>);
static_assert(std::is_integral_v<From>);
[[maybe_unused]]
constexpr auto Lo = (std::numeric_limits<To>::min)();
constexpr auto Hi = (std::numeric_limits<To>::max)();
if constexpr (std::is_signed_v<From> == std::is_signed_v<To>) {
// same signedness, we can accept regular integer conversion rules
return x < Lo ? Lo :
x > Hi ? Hi :
/*else*/ To(x);
} else {
if constexpr (std::is_signed_v<From>) { // ie. !is_signed_v<To>
if (x < From{0})
return To{0};
}
// from here on, x >= 0
using FromU = std::make_unsigned_t<From>;
using ToU = std::make_unsigned_t<To>;
return FromU(x) > ToU(Hi) ? Hi : To(x); // assumes Hi >= 0
}
}
QT_END_NAMESPACE
#endif // QNUMERIC_P_H

View File

@@ -0,0 +1,510 @@
// Copyright (C) 2019 The Qt Company Ltd.
// Copyright (C) 2013 Olivier Goffart <ogoffart@woboq.com>
// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only
#ifndef QOBJECT_P_H
#define QOBJECT_P_H
//
// W A R N I N G
// -------------
//
// This file is not part of the Qt API. It exists for the convenience
// of qapplication_*.cpp, qwidget*.cpp and qfiledialog.cpp. This header
// file may change from version to version without notice, or even be removed.
//
// We mean it.
//
#include <QtCore/private/qglobal_p.h>
#include "QtCore/qcoreevent.h"
#include "QtCore/qlist.h"
#include "QtCore/qobject.h"
#include "QtCore/qpointer.h"
#include "QtCore/qsharedpointer.h"
#include "QtCore/qvariant.h"
#include "QtCore/qproperty.h"
#include "QtCore/private/qproperty_p.h"
#include <string>
QT_BEGIN_NAMESPACE
class QVariant;
class QThreadData;
class QObjectConnectionListVector;
namespace QtSharedPointer { struct ExternalRefCountData; }
/* for Qt Test */
struct QSignalSpyCallbackSet
{
typedef void (*BeginCallback)(QObject *caller, int signal_or_method_index, void **argv);
typedef void (*EndCallback)(QObject *caller, int signal_or_method_index);
BeginCallback signal_begin_callback,
slot_begin_callback;
EndCallback signal_end_callback,
slot_end_callback;
};
void Q_CORE_EXPORT qt_register_signal_spy_callbacks(QSignalSpyCallbackSet *callback_set);
extern Q_CORE_EXPORT QBasicAtomicPointer<QSignalSpyCallbackSet> qt_signal_spy_callback_set;
enum { QObjectPrivateVersion = QT_VERSION };
class Q_CORE_EXPORT QAbstractDeclarativeData
{
public:
static void (*destroyed)(QAbstractDeclarativeData *, QObject *);
static void (*signalEmitted)(QAbstractDeclarativeData *, QObject *, int, void **);
static int (*receivers)(QAbstractDeclarativeData *, const QObject *, int);
static bool (*isSignalConnected)(QAbstractDeclarativeData *, const QObject *, int);
static void (*setWidgetParent)(QObject *, QObject *); // Used by the QML engine to specify parents for widgets. Set by QtWidgets.
};
class Q_CORE_EXPORT QObjectPrivate : public QObjectData
{
public:
Q_DECLARE_PUBLIC(QObject)
struct ExtraData
{
ExtraData(QObjectPrivate *ptr) : parent(ptr) { }
inline void setObjectNameForwarder(const QString &name)
{
parent->q_func()->setObjectName(name);
}
inline void nameChangedForwarder(const QString &name)
{
Q_EMIT parent->q_func()->objectNameChanged(name, QObject::QPrivateSignal());
}
QList<QByteArray> propertyNames;
QList<QVariant> propertyValues;
QList<int> runningTimers;
QList<QPointer<QObject>> eventFilters;
Q_OBJECT_COMPAT_PROPERTY(QObjectPrivate::ExtraData, QString, objectName,
&QObjectPrivate::ExtraData::setObjectNameForwarder,
&QObjectPrivate::ExtraData::nameChangedForwarder)
QObjectPrivate *parent;
};
void ensureExtraData()
{
if (!extraData)
extraData = new ExtraData(this);
}
typedef void (*StaticMetaCallFunction)(QObject *, QMetaObject::Call, int, void **);
struct Connection;
struct ConnectionData;
struct ConnectionList;
struct ConnectionOrSignalVector;
struct SignalVector;
struct Sender;
/*
This contains the all connections from and to an object.
The signalVector contains the lists of connections for a given signal. The index in the vector correspond
to the signal index. The signal index is the one returned by QObjectPrivate::signalIndex (not
QMetaObject::indexOfSignal). allsignals contains a list of special connections that will get invoked on
any signal emission. This is done by connecting to signal index -1.
This vector is protected by the object mutex (signalSlotLock())
Each Connection is also part of a 'senders' linked list. This one contains all connections connected
to a slot in this object. The mutex of the receiver must be locked when touching the pointers of this
linked list.
*/
QObjectPrivate(int version = QObjectPrivateVersion);
virtual ~QObjectPrivate();
void deleteChildren();
// used to clear binding storage early in ~QObject
void clearBindingStorage();
inline void checkForIncompatibleLibraryVersion(int version) const;
void setParent_helper(QObject *);
void moveToThread_helper();
void setThreadData_helper(QThreadData *currentData, QThreadData *targetData, QBindingStatus *status);
void _q_reregisterTimers(void *pointer);
bool isSender(const QObject *receiver, const char *signal) const;
QObjectList receiverList(const char *signal) const;
QObjectList senderList() const;
inline void ensureConnectionData();
inline void addConnection(int signal, Connection *c);
static inline bool removeConnection(Connection *c);
static QObjectPrivate *get(QObject *o) { return o->d_func(); }
static const QObjectPrivate *get(const QObject *o) { return o->d_func(); }
int signalIndex(const char *signalName, const QMetaObject **meta = nullptr) const;
bool isSignalConnected(uint signalIdx, bool checkDeclarative = true) const;
bool maybeSignalConnected(uint signalIndex) const;
inline bool isDeclarativeSignalConnected(uint signalIdx) const;
// To allow abitrary objects to call connectNotify()/disconnectNotify() without making
// the API public in QObject. This is used by QQmlNotifierEndpoint.
inline void connectNotify(const QMetaMethod &signal);
inline void disconnectNotify(const QMetaMethod &signal);
void reinitBindingStorageAfterThreadMove();
template <typename Func1, typename Func2>
static inline QMetaObject::Connection connect(const typename QtPrivate::FunctionPointer<Func1>::Object *sender, Func1 signal,
const typename QtPrivate::FunctionPointer<Func2>::Object *receiverPrivate, Func2 slot,
Qt::ConnectionType type = Qt::AutoConnection);
template <typename Func1, typename Func2>
static inline bool disconnect(const typename QtPrivate::FunctionPointer<Func1>::Object *sender, Func1 signal,
const typename QtPrivate::FunctionPointer<Func2>::Object *receiverPrivate, Func2 slot);
static QMetaObject::Connection connectImpl(const QObject *sender, int signal_index,
const QObject *receiver, void **slot,
QtPrivate::QSlotObjectBase *slotObj, int type,
const int *types, const QMetaObject *senderMetaObject);
static QMetaObject::Connection connect(const QObject *sender, int signal_index, QtPrivate::QSlotObjectBase *slotObj, Qt::ConnectionType type);
static QMetaObject::Connection connect(const QObject *sender, int signal_index,
const QObject *receiver,
QtPrivate::QSlotObjectBase *slotObj,
Qt::ConnectionType type);
static bool disconnect(const QObject *sender, int signal_index, void **slot);
static bool disconnect(const QObject *sender, int signal_index, const QObject *receiver,
void **slot);
virtual std::string flagsForDumping() const;
QtPrivate::QPropertyAdaptorSlotObject *
getPropertyAdaptorSlotObject(const QMetaProperty &property);
public:
mutable ExtraData *extraData; // extra data set by the user
// This atomic requires acquire/release semantics in a few places,
// e.g. QObject::moveToThread must synchronize with QCoreApplication::postEvent,
// because postEvent is thread-safe.
// However, most of the code paths involving QObject are only reentrant and
// not thread-safe, so synchronization should not be necessary there.
QAtomicPointer<QThreadData> threadData; // id of the thread that owns the object
using ConnectionDataPointer = QExplicitlySharedDataPointer<ConnectionData>;
QAtomicPointer<ConnectionData> connections;
union {
QObject *currentChildBeingDeleted; // should only be used when QObjectData::isDeletingChildren is set
QAbstractDeclarativeData *declarativeData; //extra data used by the declarative module
};
// these objects are all used to indicate that a QObject was deleted
// plus QPointer, which keeps a separate list
QAtomicPointer<QtSharedPointer::ExternalRefCountData> sharedRefcount;
};
/*
Catch mixing of incompatible library versions.
Should be called from the constructor of every non-final subclass
of QObjectPrivate, to ensure we catch incompatibilities between
the intermediate base and subclasses thereof.
*/
inline void QObjectPrivate::checkForIncompatibleLibraryVersion(int version) const
{
#if defined(QT_BUILD_INTERNAL)
// Don't check the version parameter in internal builds.
// This allows incompatible versions to be loaded, possibly for testing.
Q_UNUSED(version);
#else
if (Q_UNLIKELY(version != QObjectPrivateVersion)) {
qFatal("Cannot mix incompatible Qt library (%d.%d.%d) with this library (%d.%d.%d)",
(version >> 16) & 0xff, (version >> 8) & 0xff, version & 0xff,
(QObjectPrivateVersion >> 16) & 0xff, (QObjectPrivateVersion >> 8) & 0xff, QObjectPrivateVersion & 0xff);
}
#endif
}
inline bool QObjectPrivate::isDeclarativeSignalConnected(uint signal_index) const
{
return !isDeletingChildren && declarativeData && QAbstractDeclarativeData::isSignalConnected
&& QAbstractDeclarativeData::isSignalConnected(declarativeData, q_func(), signal_index);
}
inline void QObjectPrivate::connectNotify(const QMetaMethod &signal)
{
q_ptr->connectNotify(signal);
}
inline void QObjectPrivate::disconnectNotify(const QMetaMethod &signal)
{
q_ptr->disconnectNotify(signal);
}
namespace QtPrivate {
inline const QObject *getQObject(const QObjectPrivate *d) { return d->q_func(); }
template <typename Func>
struct FunctionStorageByValue
{
Func f;
Func &func() noexcept { return f; }
};
template <typename Func>
struct FunctionStorageEmptyBaseClassOptimization : Func
{
Func &func() noexcept { return *this; }
using Func::Func;
};
template <typename Func>
using FunctionStorage = typename std::conditional_t<
std::conjunction_v<
std::is_empty<Func>,
std::negation<std::is_final<Func>>
>,
FunctionStorageEmptyBaseClassOptimization<Func>,
FunctionStorageByValue<Func>
>;
template <typename ObjPrivate> inline void assertObjectType(QObjectPrivate *d)
{
using Obj = std::remove_pointer_t<decltype(std::declval<ObjPrivate *>()->q_func())>;
assertObjectType<Obj>(d->q_ptr);
}
template<typename Func, typename Args, typename R>
class QPrivateSlotObject : public QSlotObjectBase, private FunctionStorage<Func>
{
typedef QtPrivate::FunctionPointer<Func> FuncType;
static void impl(int which, QSlotObjectBase *this_, QObject *r, void **a, bool *ret)
{
switch (which) {
case Destroy:
delete static_cast<QPrivateSlotObject*>(this_);
break;
case Call:
FuncType::template call<Args, R>(static_cast<QPrivateSlotObject*>(this_)->func(),
static_cast<typename FuncType::Object *>(QObjectPrivate::get(r)), a);
break;
case Compare:
*ret = *reinterpret_cast<Func *>(a) == static_cast<QPrivateSlotObject*>(this_)->func();
break;
case NumOperations: ;
}
}
public:
explicit QPrivateSlotObject(Func f) : QSlotObjectBase(&impl), FunctionStorage<Func>{std::move(f)} {}
};
} //namespace QtPrivate
template <typename Func1, typename Func2>
inline QMetaObject::Connection QObjectPrivate::connect(const typename QtPrivate::FunctionPointer<Func1>::Object *sender, Func1 signal,
const typename QtPrivate::FunctionPointer<Func2>::Object *receiverPrivate, Func2 slot,
Qt::ConnectionType type)
{
typedef QtPrivate::FunctionPointer<Func1> SignalType;
typedef QtPrivate::FunctionPointer<Func2> SlotType;
static_assert(QtPrivate::HasQ_OBJECT_Macro<typename SignalType::Object>::Value,
"No Q_OBJECT in the class with the signal");
//compilation error if the arguments does not match.
static_assert(int(SignalType::ArgumentCount) >= int(SlotType::ArgumentCount),
"The slot requires more arguments than the signal provides.");
static_assert((QtPrivate::CheckCompatibleArguments<typename SignalType::Arguments, typename SlotType::Arguments>::value),
"Signal and slot arguments are not compatible.");
static_assert((QtPrivate::AreArgumentsCompatible<typename SlotType::ReturnType, typename SignalType::ReturnType>::value),
"Return type of the slot is not compatible with the return type of the signal.");
const int *types = nullptr;
if (type == Qt::QueuedConnection || type == Qt::BlockingQueuedConnection)
types = QtPrivate::ConnectionTypes<typename SignalType::Arguments>::types();
return QObject::connectImpl(sender, reinterpret_cast<void **>(&signal),
QtPrivate::getQObject(receiverPrivate), reinterpret_cast<void **>(&slot),
new QtPrivate::QPrivateSlotObject<Func2, typename QtPrivate::List_Left<typename SignalType::Arguments, SlotType::ArgumentCount>::Value,
typename SignalType::ReturnType>(slot),
type, types, &SignalType::Object::staticMetaObject);
}
template <typename Func1, typename Func2>
bool QObjectPrivate::disconnect(const typename QtPrivate::FunctionPointer< Func1 >::Object* sender, Func1 signal,
const typename QtPrivate::FunctionPointer< Func2 >::Object* receiverPrivate, Func2 slot)
{
typedef QtPrivate::FunctionPointer<Func1> SignalType;
typedef QtPrivate::FunctionPointer<Func2> SlotType;
static_assert(QtPrivate::HasQ_OBJECT_Macro<typename SignalType::Object>::Value,
"No Q_OBJECT in the class with the signal");
//compilation error if the arguments does not match.
static_assert((QtPrivate::CheckCompatibleArguments<typename SignalType::Arguments, typename SlotType::Arguments>::value),
"Signal and slot arguments are not compatible.");
return QObject::disconnectImpl(sender, reinterpret_cast<void **>(&signal),
receiverPrivate->q_ptr, reinterpret_cast<void **>(&slot),
&SignalType::Object::staticMetaObject);
}
class QSemaphore;
class Q_CORE_EXPORT QAbstractMetaCallEvent : public QEvent
{
public:
QAbstractMetaCallEvent(const QObject *sender, int signalId, QSemaphore *semaphore = nullptr)
: QEvent(MetaCall), signalId_(signalId), sender_(sender)
#if QT_CONFIG(thread)
, semaphore_(semaphore)
#endif
{ Q_UNUSED(semaphore); }
~QAbstractMetaCallEvent();
virtual void placeMetaCall(QObject *object) = 0;
inline const QObject *sender() const { return sender_; }
inline int signalId() const { return signalId_; }
private:
int signalId_;
const QObject *sender_;
#if QT_CONFIG(thread)
QSemaphore *semaphore_;
#endif
};
class Q_CORE_EXPORT QMetaCallEvent : public QAbstractMetaCallEvent
{
public:
// blocking queued with semaphore - args always owned by caller
QMetaCallEvent(ushort method_offset, ushort method_relative,
QObjectPrivate::StaticMetaCallFunction callFunction,
const QObject *sender, int signalId,
void **args, QSemaphore *semaphore);
QMetaCallEvent(QtPrivate::QSlotObjectBase *slotObj,
const QObject *sender, int signalId,
void **args, QSemaphore *semaphore);
QMetaCallEvent(QtPrivate::SlotObjUniquePtr slotObj,
const QObject *sender, int signalId,
void **args, QSemaphore *semaphore);
// queued - args allocated by event, copied by caller
QMetaCallEvent(ushort method_offset, ushort method_relative,
QObjectPrivate::StaticMetaCallFunction callFunction,
const QObject *sender, int signalId,
int nargs);
QMetaCallEvent(QtPrivate::QSlotObjectBase *slotObj,
const QObject *sender, int signalId,
int nargs);
QMetaCallEvent(QtPrivate::SlotObjUniquePtr slotObj,
const QObject *sender, int signalId,
int nargs);
~QMetaCallEvent() override;
template<typename ...Args>
static QMetaCallEvent *create(QtPrivate::QSlotObjectBase *slotObj, const QObject *sender,
int signal_index, const Args &...argv)
{
const void* const argp[] = { nullptr, std::addressof(argv)... };
const QMetaType metaTypes[] = { QMetaType::fromType<void>(), QMetaType::fromType<Args>()... };
constexpr auto argc = sizeof...(Args) + 1;
return create_impl(slotObj, sender, signal_index, argc, argp, metaTypes);
}
template<typename ...Args>
static QMetaCallEvent *create(QtPrivate::SlotObjUniquePtr slotObj, const QObject *sender,
int signal_index, const Args &...argv)
{
const void* const argp[] = { nullptr, std::addressof(argv)... };
const QMetaType metaTypes[] = { QMetaType::fromType<void>(), QMetaType::fromType<Args>()... };
constexpr auto argc = sizeof...(Args) + 1;
return create_impl(std::move(slotObj), sender, signal_index, argc, argp, metaTypes);
}
inline int id() const { return d.method_offset_ + d.method_relative_; }
inline const void * const* args() const { return d.args_; }
inline void ** args() { return d.args_; }
inline const QMetaType *types() const { return reinterpret_cast<QMetaType *>(d.args_ + d.nargs_); }
inline QMetaType *types() { return reinterpret_cast<QMetaType *>(d.args_ + d.nargs_); }
virtual void placeMetaCall(QObject *object) override;
private:
static QMetaCallEvent *create_impl(QtPrivate::QSlotObjectBase *slotObj, const QObject *sender,
int signal_index, size_t argc, const void * const argp[],
const QMetaType metaTypes[])
{
if (slotObj)
slotObj->ref();
return create_impl(QtPrivate::SlotObjUniquePtr{slotObj}, sender,
signal_index, argc, argp, metaTypes);
}
static QMetaCallEvent *create_impl(QtPrivate::SlotObjUniquePtr slotObj, const QObject *sender,
int signal_index, size_t argc, const void * const argp[],
const QMetaType metaTypes[]);
inline void allocArgs();
struct Data {
QtPrivate::SlotObjUniquePtr slotObj_;
void **args_;
QObjectPrivate::StaticMetaCallFunction callFunction_;
int nargs_;
ushort method_offset_;
ushort method_relative_;
} d;
// preallocate enough space for three arguments
alignas(void *) char prealloc_[3 * sizeof(void *) + 3 * sizeof(QMetaType)];
};
class QBoolBlocker
{
Q_DISABLE_COPY_MOVE(QBoolBlocker)
public:
explicit inline QBoolBlocker(bool &b, bool value = true) : block(b), reset(b) { block = value; }
inline ~QBoolBlocker() { block = reset; }
private:
bool &block;
bool reset;
};
void Q_CORE_EXPORT qDeleteInEventHandler(QObject *o);
struct QAbstractDynamicMetaObject;
struct Q_CORE_EXPORT QDynamicMetaObjectData
{
virtual ~QDynamicMetaObjectData();
virtual void objectDestroyed(QObject *) { delete this; }
virtual QMetaObject *toDynamicMetaObject(QObject *) = 0;
virtual int metaCall(QObject *, QMetaObject::Call, int _id, void **) = 0;
};
struct Q_CORE_EXPORT QAbstractDynamicMetaObject : public QDynamicMetaObjectData, public QMetaObject
{
~QAbstractDynamicMetaObject();
QMetaObject *toDynamicMetaObject(QObject *) override { return this; }
virtual int createProperty(const char *, const char *) { return -1; }
int metaCall(QObject *, QMetaObject::Call c, int _id, void **a) override
{ return metaCall(c, _id, a); }
virtual int metaCall(QMetaObject::Call, int _id, void **) { return _id; } // Compat overload
};
inline const QBindingStorage *qGetBindingStorage(const QObjectPrivate *o)
{
return &o->bindingStorage;
}
inline QBindingStorage *qGetBindingStorage(QObjectPrivate *o)
{
return &o->bindingStorage;
}
inline const QBindingStorage *qGetBindingStorage(const QObjectPrivate::ExtraData *ed)
{
return &ed->parent->bindingStorage;
}
inline QBindingStorage *qGetBindingStorage(QObjectPrivate::ExtraData *ed)
{
return &ed->parent->bindingStorage;
}
QT_END_NAMESPACE
#endif // QOBJECT_P_H

View File

@@ -0,0 +1,249 @@
// Copyright (C) 2019 The Qt Company Ltd.
// Copyright (C) 2013 Olivier Goffart <ogoffart@woboq.com>
// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only
#ifndef QOBJECT_P_P_H
#define QOBJECT_P_P_H
//
// W A R N I N G
// -------------
//
// This file is not part of the Qt API. It exists for the convenience
// of qobject.cpp. This header file may change from version to version
// without notice, or even be removed.
//
// We mean it.
//
// Even though this file is only used by qobject.cpp, the only reason this
// code lives here is that some special apps/libraries for e.g., QtJambi,
// Gammaray need access to the structs in this file.
#include <QtCore/qobject.h>
#include <QtCore/private/qobject_p.h>
QT_BEGIN_NAMESPACE
// ConnectionList is a singly-linked list
struct QObjectPrivate::ConnectionList
{
QAtomicPointer<Connection> first;
QAtomicPointer<Connection> last;
};
static_assert(std::is_trivially_destructible_v<QObjectPrivate::ConnectionList>);
Q_DECLARE_TYPEINFO(QObjectPrivate::ConnectionList, Q_RELOCATABLE_TYPE);
struct QObjectPrivate::ConnectionOrSignalVector
{
union {
// linked list of orphaned connections that need cleaning up
ConnectionOrSignalVector *nextInOrphanList;
// linked list of connections connected to slots in this object
Connection *next;
};
static SignalVector *asSignalVector(ConnectionOrSignalVector *c)
{
if (reinterpret_cast<quintptr>(c) & 1)
return reinterpret_cast<SignalVector *>(reinterpret_cast<quintptr>(c) & ~quintptr(1u));
return nullptr;
}
static Connection *fromSignalVector(SignalVector *v)
{
return reinterpret_cast<Connection *>(reinterpret_cast<quintptr>(v) | quintptr(1u));
}
};
static_assert(std::is_trivial_v<QObjectPrivate::ConnectionOrSignalVector>);
struct QObjectPrivate::Connection : public ConnectionOrSignalVector
{
// linked list of connections connected to slots in this object, next is in base class
Connection **prev;
// linked list of connections connected to signals in this object
QAtomicPointer<Connection> nextConnectionList;
Connection *prevConnectionList;
QObject *sender;
QAtomicPointer<QObject> receiver;
QAtomicPointer<QThreadData> receiverThreadData;
union {
StaticMetaCallFunction callFunction;
QtPrivate::QSlotObjectBase *slotObj;
};
QAtomicPointer<const int> argumentTypes;
QAtomicInt ref_{
2
}; // ref_ is 2 for the use in the internal lists, and for the use in QMetaObject::Connection
uint id = 0;
ushort method_offset;
ushort method_relative;
signed int signal_index : 27; // In signal range (see QObjectPrivate::signalIndex())
ushort connectionType : 2; // 0 == auto, 1 == direct, 2 == queued, 3 == blocking
ushort isSlotObject : 1;
ushort ownArgumentTypes : 1;
ushort isSingleShot : 1;
Connection() : ownArgumentTypes(true) { }
~Connection();
int method() const
{
Q_ASSERT(!isSlotObject);
return method_offset + method_relative;
}
void ref() { ref_.ref(); }
void freeSlotObject()
{
if (isSlotObject) {
slotObj->destroyIfLastRef();
isSlotObject = false;
}
}
void deref()
{
if (!ref_.deref()) {
Q_ASSERT(!receiver.loadRelaxed());
Q_ASSERT(!isSlotObject);
delete this;
}
}
};
Q_DECLARE_TYPEINFO(QObjectPrivate::Connection, Q_RELOCATABLE_TYPE);
struct QObjectPrivate::SignalVector : public ConnectionOrSignalVector
{
quintptr allocated;
// ConnectionList signals[]
ConnectionList &at(int i) { return reinterpret_cast<ConnectionList *>(this + 1)[i + 1]; }
const ConnectionList &at(int i) const
{
return reinterpret_cast<const ConnectionList *>(this + 1)[i + 1];
}
int count() const { return static_cast<int>(allocated); }
};
static_assert(
std::is_trivial_v<QObjectPrivate::SignalVector>); // it doesn't need to be, but it helps
struct QObjectPrivate::ConnectionData
{
// the id below is used to avoid activating new connections. When the object gets
// deleted it's set to 0, so that signal emission stops
QAtomicInteger<uint> currentConnectionId;
QAtomicInt ref;
QAtomicPointer<SignalVector> signalVector;
Connection *senders = nullptr;
Sender *currentSender = nullptr; // object currently activating the object
QAtomicPointer<Connection> orphaned;
~ConnectionData()
{
Q_ASSERT(ref.loadRelaxed() == 0);
auto *c = orphaned.fetchAndStoreRelaxed(nullptr);
if (c)
deleteOrphaned(c);
SignalVector *v = signalVector.loadRelaxed();
if (v) {
v->~SignalVector();
free(v);
}
}
// must be called on the senders connection data
// assumes the senders and receivers lock are held
void removeConnection(Connection *c);
enum LockPolicy {
NeedToLock,
// Beware that we need to temporarily release the lock
// and thus calling code must carefully consider whether
// invariants still hold.
AlreadyLockedAndTemporarilyReleasingLock
};
void cleanOrphanedConnections(QObject *sender, LockPolicy lockPolicy = NeedToLock)
{
if (orphaned.loadRelaxed() && ref.loadAcquire() == 1)
cleanOrphanedConnectionsImpl(sender, lockPolicy);
}
void cleanOrphanedConnectionsImpl(QObject *sender, LockPolicy lockPolicy);
ConnectionList &connectionsForSignal(int signal)
{
return signalVector.loadRelaxed()->at(signal);
}
void resizeSignalVector(uint size)
{
SignalVector *vector = this->signalVector.loadRelaxed();
if (vector && vector->allocated > size)
return;
size = (size + 7) & ~7;
void *ptr = malloc(sizeof(SignalVector) + (size + 1) * sizeof(ConnectionList));
auto newVector = new (ptr) SignalVector;
int start = -1;
if (vector) {
// not (yet) existing trait:
// static_assert(std::is_relocatable_v<SignalVector>);
// static_assert(std::is_relocatable_v<ConnectionList>);
memcpy(newVector, vector,
sizeof(SignalVector) + (vector->allocated + 1) * sizeof(ConnectionList));
start = vector->count();
}
for (int i = start; i < int(size); ++i)
new (&newVector->at(i)) ConnectionList();
newVector->next = nullptr;
newVector->allocated = size;
signalVector.storeRelaxed(newVector);
if (vector) {
Connection *o = nullptr;
/* No ABA issue here: When adding a node, we only care about the list head, it doesn't
* matter if the tail changes.
*/
do {
o = orphaned.loadRelaxed();
vector->nextInOrphanList = o;
} while (!orphaned.testAndSetRelease(
o, ConnectionOrSignalVector::fromSignalVector(vector)));
}
}
int signalVectorCount() const
{
return signalVector.loadAcquire() ? signalVector.loadRelaxed()->count() : -1;
}
static void deleteOrphaned(ConnectionOrSignalVector *c);
};
struct QObjectPrivate::Sender
{
Sender(QObject *receiver, QObject *sender, int signal)
: receiver(receiver), sender(sender), signal(signal)
{
if (receiver) {
ConnectionData *cd = receiver->d_func()->connections.loadRelaxed();
previous = cd->currentSender;
cd->currentSender = this;
}
}
~Sender()
{
if (receiver)
receiver->d_func()->connections.loadRelaxed()->currentSender = previous;
}
void receiverDeleted()
{
Sender *s = this;
while (s) {
s->receiver = nullptr;
s = s->previous;
}
}
Sender *previous;
QObject *receiver;
QObject *sender;
int signal;
};
Q_DECLARE_TYPEINFO(QObjectPrivate::Sender, Q_RELOCATABLE_TYPE);
QT_END_NAMESPACE
#endif

Some files were not shown because too many files have changed in this diff Show More