| 3154 | bool Value::isValidIndex(ArrayIndex index) const { return index < size(); } |
| 3155 | |
| 3156 | Value const* Value::find(char const* key, char const* cend) const { |
| 3157 | JSON_ASSERT_MESSAGE( |
| 3158 | type_ == nullValue || type_ == objectValue, |
| 3159 | "in Json::Value::find(key, end, found): requires objectValue or nullValue"); |
| 3160 | if (type_ == nullValue) return NULL; |
| 3161 | CZString actualKey(key, static_cast<unsigned>(cend - key), CZString::noDuplication); |
| 3162 | ObjectValues::const_iterator it = value_.map_->find(actualKey); |
| 3163 | if (it == value_.map_->end()) return NULL; |
| 3164 | return &(*it).second; |
| 3165 | } |
| 3166 | const Value& Value::operator[](const char* key) const { |
| 3167 | Value const* found = find(key, key + strlen(key)); |
| 3168 | if (!found) return nullRef; |