summaryrefslogtreecommitdiffstats
path: root/src/corelib/json/qjson_p.h
diff options
context:
space:
mode:
Diffstat (limited to 'src/corelib/json/qjson_p.h')
-rw-r--r--src/corelib/json/qjson_p.h18
1 files changed, 17 insertions, 1 deletions
diff --git a/src/corelib/json/qjson_p.h b/src/corelib/json/qjson_p.h
index 3580e0b61c..5e34845fe3 100644
--- a/src/corelib/json/qjson_p.h
+++ b/src/corelib/json/qjson_p.h
@@ -573,7 +573,8 @@ public:
Entry *entryAt(int i) const {
return reinterpret_cast<Entry *>(((char *)this) + table()[i]);
}
- int indexOf(const QString &key, bool *exists);
+ int indexOf(const QString &key, bool *exists) const;
+ int indexOf(QLatin1String key, bool *exists) const;
bool isValid() const;
};
@@ -675,6 +676,10 @@ public:
inline bool operator !=(const QString &key) const { return !operator ==(key); }
inline bool operator >=(const QString &key) const;
+ bool operator==(QLatin1String key) const;
+ inline bool operator!=(QLatin1String key) const { return !operator ==(key); }
+ inline bool operator>=(QLatin1String key) const;
+
bool operator ==(const Entry &other) const;
bool operator >=(const Entry &other) const;
};
@@ -687,9 +692,20 @@ inline bool Entry::operator >=(const QString &key) const
return (shallowKey() >= key);
}
+inline bool Entry::operator >=(QLatin1String key) const
+{
+ if (value.latinKey)
+ return shallowLatin1Key() >= key;
+ else
+ return shallowKey() >= key;
+}
+
inline bool operator <(const QString &key, const Entry &e)
{ return e >= key; }
+inline bool operator<(QLatin1String key, const Entry &e)
+{ return e >= key; }
+
class Header {
public: