19 #ifndef JSON_VALUE_USE_INTERNAL_MAP
20 : current_(), isNull_(
true) {
23 : isArray_(
true), isNull_(
true) {
24 iterator_.array_ = ValueInternalArray::IteratorState();
28 #ifndef JSON_VALUE_USE_INTERNAL_MAP
30 const Value::ObjectValues::iterator& current)
31 : current_(current), isNull_(false) {}
34 const ValueInternalArray::IteratorState& state)
36 iterator_.array_ = state;
40 const ValueInternalMap::IteratorState& state)
42 iterator_.map_ = state;
47 #ifndef JSON_VALUE_USE_INTERNAL_MAP
48 return current_->second;
51 return ValueInternalArray::dereference(iterator_.array_);
52 return ValueInternalMap::value(iterator_.map_);
57 #ifndef JSON_VALUE_USE_INTERNAL_MAP
61 ValueInternalArray::increment(iterator_.array_);
62 ValueInternalMap::increment(iterator_.map_);
67 #ifndef JSON_VALUE_USE_INTERNAL_MAP
71 ValueInternalArray::decrement(iterator_.array_);
72 ValueInternalMap::decrement(iterator_.map_);
78 #ifndef JSON_VALUE_USE_INTERNAL_MAP
79 #ifdef JSON_USE_CPPTL_SMALLMAP
80 return current_ - other.current_;
87 if (isNull_ && other.isNull_) {
97 for (Value::ObjectValues::iterator it = current_; it != other.current_;
105 return ValueInternalArray::distance(iterator_.array_,
107 return ValueInternalMap::distance(iterator_.map_, other.iterator_.
map_);
112 #ifndef JSON_VALUE_USE_INTERNAL_MAP
114 return other.isNull_;
116 return current_ == other.current_;
119 return ValueInternalArray::equals(iterator_.array_, other.iterator_.
array_);
120 return ValueInternalMap::equals(iterator_.map_, other.iterator_.
map_);
125 #ifndef JSON_VALUE_USE_INTERNAL_MAP
126 current_ = other.current_;
127 isNull_ = other.isNull_;
130 iterator_.array_ = other.iterator_.
array_;
131 iterator_.map_ = other.iterator_.
map_;
136 #ifndef JSON_VALUE_USE_INTERNAL_MAP
137 const Value::CZString czstring = (*current_).first;
138 if (czstring.c_str()) {
139 if (czstring.isStaticString())
141 return Value(czstring.c_str());
143 return Value(czstring.index());
146 return Value(ValueInternalArray::indexOf(iterator_.array_));
148 const char*
memberName = ValueInternalMap::key(iterator_.map_, isStatic);
151 return Value(memberName);
156 #ifndef JSON_VALUE_USE_INTERNAL_MAP
157 const Value::CZString czstring = (*current_).first;
158 if (!czstring.c_str())
159 return czstring.index();
163 return Value::UInt(ValueInternalArray::indexOf(iterator_.array_));
169 #ifndef JSON_VALUE_USE_INTERNAL_MAP
170 const char* name = (*current_).first.c_str();
171 return name ? name :
"";
174 return ValueInternalMap::key(iterator_.map_);
189 #ifndef JSON_VALUE_USE_INTERNAL_MAP
191 const Value::ObjectValues::iterator& current)
195 const ValueInternalArray::IteratorState& state)
196 : ValueIteratorBase(state) {}
199 const ValueInternalMap::IteratorState& state)
200 : ValueIteratorBase(state) {}
219 #ifndef JSON_VALUE_USE_INTERNAL_MAP
224 : ValueIteratorBase(state) {}
227 : ValueIteratorBase(state) {}
base class for Value iterators.
Lightweight wrapper to tag static string.
ValueInternalMap::IteratorState map_
bool isEqual(const SelfType &other) const
difference_type computeDistance(const SelfType &other) const
void copy(const SelfType &other)
const iterator for object and array value.
SelfType & operator=(const SelfType &other)
SelfType & operator=(const ValueIteratorBase &other)
UInt index() const
Return the index of the referenced Value. -1 if it is not an arrayValue.
Value key() const
Return either the index or the member name of the referenced value as a Value.
Iterator for object and array value.
ValueInternalArray::IteratorState array_
const char * memberName() const
Return the member name of the referenced Value.