diff options
Diffstat (limited to 'src/qjsonvalue.h')
-rw-r--r-- | src/qjsonvalue.h | 16 |
1 files changed, 5 insertions, 11 deletions
diff --git a/src/qjsonvalue.h b/src/qjsonvalue.h index 4f5b7da..eba93f5 100644 --- a/src/qjsonvalue.h +++ b/src/qjsonvalue.h @@ -56,7 +56,7 @@ public: enum Type { Null = 0x0, Bool = 0x1, - Number = 0x2, + Double = 0x2, String = 0x3, Array = 0x4, Object = 0x5, @@ -83,15 +83,14 @@ public: Type type() const; inline bool isNull() const { return type() == Null; } inline bool isBool() const { return type() == Bool; } - inline bool isNumber() const { return type() == Number; } + inline bool isDouble() const { return type() == Double; } inline bool isString() const { return type() == String; } inline bool isArray() const { return type() == Array; } inline bool isObject() const { return type() == Object; } inline bool isUndefined() const { return type() == Undefined; } bool toBool() const; - double toNumber() const; - int toInt() const; + double toDouble() const; QString toString() const; QJsonArray toArray() const; QJsonObject toObject() const; @@ -117,10 +116,6 @@ private: uint valueToStore(uint offset) const; void copyData(char *dest, bool compressed) const; - // ### This should be: - // Private::Data *d; - // Private::Base *b; - // Private::Value *v; Type t; Private::Data *d; // needed for Objects and Arrays union { @@ -149,15 +144,14 @@ public: inline QJsonValue::Type type() const { return toValue().type(); } inline bool isNull() const { return type() == QJsonValue::Null; } inline bool isBool() const { return type() == QJsonValue::Bool; } - inline bool isNumber() const { return type() == QJsonValue::Number; } + inline bool isDouble() const { return type() == QJsonValue::Double; } inline bool isString() const { return type() == QJsonValue::String; } inline bool isArray() const { return type() == QJsonValue::Array; } inline bool isObject() const { return type() == QJsonValue::Object; } inline bool isUndefined() const { return type() == QJsonValue::Undefined; } inline bool toBool() const { return toValue().toBool(); } - inline double toNumber() const { return toValue().toNumber(); } - inline int toInt() const { return toValue().toInt(); } + inline double toDouble() const { return toValue().toDouble(); } inline QString toString() const { return toValue().toString(); } inline QJsonArray toArray() const; inline QJsonObject toObject() const; |