Lines Matching refs:Value
35 /** \brief Type of the value held by a Value object.
38 nullValue = 0, ///< 'null' value
39 intValue, ///< signed integer value
40 uintValue, ///< unsigned integer value
41 realValue, ///< double value
42 stringValue, ///< UTF-8 string value
43 booleanValue, ///< bool value
44 arrayValue, ///< array value (ordered list)
45 objectValue ///< object value (collection of name/value pairs).
49 commentBefore = 0, ///< a comment placed on the line before a value
50 commentAfterOnSameLine, ///< a comment just after a value on the same line
51 commentAfter, ///< a comment on the line after a value (only make sense for
52 /// root value)
58 // typedef CppTL::AnyEnumerator<const Value &> EnumValues;
63 * Value constructor and objectValue member assignement takes advantage of the
69 * Json::Value aValue( StaticString("some text") );
70 * Json::Value object;
87 /** \brief Represents a <a HREF="http://www.json.org">JSON</a> value.
90 * - signed integer [range: Value::minInt - Value::maxInt]
91 * - unsigned integer (range: 0 - Value::maxUInt)
96 * - an ordered list of Value
97 * - collection of name/value pairs (javascript object)
99 * The type of the held value is represented by a #ValueType and
109 * The get() methods can be used to obtanis default value in the case the
116 class JSON_API Value {
136 static const Value& null;
137 /// Minimum signed integer value that can be stored in a Json::Value.
139 /// Maximum signed integer value that can be stored in a Json::Value.
141 /// Maximum unsigned integer value that can be stored in a Json::Value.
144 /// Minimum signed int value that can be stored in a Json::Value.
146 /// Maximum signed int value that can be stored in a Json::Value.
148 /// Maximum unsigned int value that can be stored in a Json::Value.
152 /// Minimum signed 64 bits int value that can be stored in a Json::Value.
154 /// Maximum signed 64 bits int value that can be stored in a Json::Value.
156 /// Maximum unsigned 64 bits int value that can be stored in a Json::Value.
189 typedef std::map<CZString, Value> ObjectValues;
191 typedef CppTL::SmallMap<CZString, Value> ObjectValues;
197 /** \brief Create a default Value of the given type.
202 Another Value can then be set to this one by assignment.
207 Json::Value null_value; // null
208 Json::Value arr_value(Json::arrayValue); // []
209 Json::Value obj_value(Json::objectValue); // {}
212 Value(ValueType type = nullValue);
213 Value(Int value);
214 Value(UInt value);
216 Value(Int64 value);
217 Value(UInt64 value);
219 Value(double value);
220 Value(const char* value);
221 Value(const char* beginValue, const char* endValue);
222 /** \brief Constructs a value from a static string.
224 * Like other value string constructor but do not duplicate the string for
229 * Json::Value aValue( StaticString("some text") );
232 Value(const StaticString& value);
233 Value(const std::string& value);
235 Value(const CppTL::ConstString& value);
237 Value(bool value);
238 Value(const Value& other);
239 ~Value();
241 Value& operator=(Value other);
245 void swap(Value& other);
249 bool operator<(const Value& other) const;
250 bool operator<=(const Value& other) const;
251 bool operator>=(const Value& other) const;
252 bool operator>(const Value& other) const;
254 bool operator==(const Value& other) const;
255 bool operator!=(const Value& other) const;
257 int compare(const Value& other) const;
314 /// If the array contains less than index element, then null value are
317 /// (You may need to say 'value[0u]' to get your compiler to distinguish
319 Value& operator[](ArrayIndex index);
322 /// If the array contains less than index element, then null value are
325 /// (You may need to say 'value[0u]' to get your compiler to distinguish
327 Value& operator[](int index);
330 /// (You may need to say 'value[0u]' to get your compiler to distinguish
332 const Value& operator[](ArrayIndex index) const;
335 /// (You may need to say 'value[0u]' to get your compiler to distinguish
337 const Value& operator[](int index) const;
340 /// value,
342 Value get(ArrayIndex index, const Value& defaultValue) const;
345 /// \brief Append value to array at the end.
347 /// Equivalent to jsonvalue[jsonvalue.size()] = value;
348 Value& append(const Value& value);
350 /// Access an object value by name, create a null member if it does not exist.
351 Value& operator[](const char* key);
352 /// Access an object value by name, returns null if there is no member with
354 const Value& operator[](const char* key) const;
355 /// Access an object value by name, create a null member if it does not exist.
356 Value& operator[](const std::string& key);
357 /// Access an object value by name, returns null if there is no member with
359 const Value& operator[](const std::string& key) const;
360 /** \brief Access an object value by name, create a null member if it does not
367 * Json::Value object;
372 Value& operator[](const StaticString& key);
374 /// Access an object value by name, create a null member if it does not exist.
375 Value& operator[](const CppTL::ConstString& key);
376 /// Access an object value by name, returns null if there is no member with
378 const Value& operator[](const CppTL::ConstString& key) const;
381 Value get(const char* key, const Value& defaultValue) const;
383 Value get(const std::string& key, const Value& defaultValue) const;
386 Value get(const CppTL::ConstString& key, const Value& defaultValue) const;
391 /// \return the removed Value, or null.
394 Value removeMember(const char* key);
396 Value removeMember(const std::string& key);
436 // which this value was parsed, if any.
445 Value& resolveReference(const char* key, bool isStatic);
499 // [start, limit) byte offsets in the source JSON text from which this Value
532 * - ".[n]" => elements at index 'n' of root node (an array value)
533 * - ".name" => member named 'name' of root node (an object value)
548 const Value& resolve(const Value& root) const;
549 Value resolve(const Value& root, const Value& defaultValue) const;
552 Value& make(Value& root) const;
569 /** \brief Allocator to customize Value internal map.
643 Value items_[itemPerLink];
650 *Value.
655 * value. This provides a better compromise between memory usage and speed.
668 friend class Value;
699 const Value* find(const char* key) const;
701 Value* find(const char* key);
703 Value& resolveReference(const char* key, bool isStatic);
713 Value& setNewItem(const char* key,
718 Value& unsafeAdd(const char* key, bool isStatic, HashKey hashedKey);
733 static Value& value(const IteratorState& iterator);
743 /** \brief A simplified deque implementation used internally by Value.
758 friend class Value;
765 typedef Value::ArrayIndex ArrayIndex;
773 Value** currentPageIndex_;
787 Value& resolveReference(ArrayIndex index);
789 Value* find(ArrayIndex index) const;
799 static Value& dereference(const IteratorState& iterator);
800 static Value& unsafeDereference(const IteratorState& iterator);
809 Value** pages_;
814 /** \brief Experimental: do not use. Allocator to customize Value internal
841 virtual void reallocateArrayPageIndex( Value **&indexes,
850 void *newIndexes = realloc( indexes, sizeof(Value*) * newIndexCount );
854 indexes = static_cast<Value **>( newIndexes );
856 virtual void releaseArrayPageIndex( Value **indexes,
863 virtual Value *allocateArrayPage()
865 return static_cast<Value *>( malloc( sizeof(Value) *
869 virtual void releaseArrayPage( Value *value )
871 if ( value )
872 free( value );
896 reallocateArrayPageIndex(Value**& indexes,
900 releaseArrayPageIndex(Value** indexes,
902 virtual Value* allocateArrayPage() = 0;
903 virtual void releaseArrayPage(Value* value) = 0;
907 /** \brief base class for Value iterators.
919 explicit ValueIteratorBase(const Value::ObjectValues::iterator& current);
933 /// Return either the index or the member name of the referenced value as a
934 /// Value.
935 Value key() const;
937 /// Return the index of the referenced Value. -1 if it is not an arrayValue.
940 /// Return the member name of the referenced Value. "" if it is not an
945 Value& deref() const;
959 Value::ObjectValues::iterator current_;
960 // Indicates that iterator is for a null value.
971 /** \brief const iterator for object and array value.
975 friend class Value;
978 typedef const Value value_type;
981 typedef const Value& reference;
982 typedef const Value* pointer;
988 /*! \internal Use by Value to create an iterator.
991 explicit ValueConstIterator(const Value::ObjectValues::iterator& current);
1026 /** \brief Iterator for object and array value.
1029 friend class Value;
1032 typedef Value value_type;
1035 typedef Value& reference;
1036 typedef Value* pointer;
1044 /*! \internal Use by Value to create an iterator.
1047 explicit ValueIterator(const Value::ObjectValues::iterator& current);