15 Q_ASSERT(singleProperty >=
static_cast<int>(CPropertyIndexRef::GlobalIndexCValueObject));
31 copy.m_indexes.pop_front();
45 for (
const int i : m_indexes)
47 Q_ASSERT(i >=
static_cast<int>(CPropertyIndexRef::GlobalIndexCValueObject));
48 if (!s.isEmpty()) { s.append(
";"); }
49 s.append(QString::number(i));
57 if (indexes.isEmpty()) {
return; }
58 for (
const auto &index : QStringView { indexes }.split(
';'))
60 if (index.isEmpty()) {
continue; }
62 int i = index.toInt(&ok);
64 Q_ASSERT(i >=
static_cast<int>(CPropertyIndexRef::GlobalIndexCValueObject));
78 const QJsonValue value = json.value(QLatin1String(
"indexes"));
79 if (!value.isString()) {
throw CJsonException(
"'indexes' missing or not a string"); }
91 Q_ASSERT_X(!this->
isEmpty(), Q_FUNC_INFO,
"No index");
92 return m_indexes.front();
97 if (this->
isEmpty()) {
return false; }
Thrown when a convertFromJson method encounters an unrecoverable error in JSON data.
QList< int > indexList() const
Index list.
CPropertyIndex()=default
Default constructor.
bool isEmpty() const
Empty?
void prepend(int newLeftIndex)
Shift existing indexes to right and insert given index at front.
bool isMyself() const
Myself index, used with nesting.
bool startsWith(int index) const
Starts with given index?
int frontToInt() const
Front to integer.
bool contains(int index) const
Contains index?
QJsonObject toJson() const
Cast to JSON object.
QString convertToQString(bool i18n=false) const
Cast as QString.
Q_REQUIRED_RESULT CPropertyIndex copyFrontRemoved() const
Copy with first element removed.
bool isNested() const
Is nested index?
void convertFromJson(const QJsonObject &json)
Assign from JSON object.
void parseFromString(const QString &indexes)
Parse indexes from string.
Non-owning reference to a CPropertyIndex with a subset of its features.
Free functions in swift::misc.
#define SWIFT_VERIFY_X(COND, WHERE, WHAT)
A weaker kind of assert.