Lines Matching defs:key

319     /// @brief default object key comparator type
320 /// The actual object key comparator type (@ref object_comparator_t) may be
325 // in functions involving lookup by key with types other than object_t::key_type (aka. StringType)
367 /// @brief object key comparator type
1972 reference at(const typename object_t::key_type& key)
1980 auto it = m_value.object->find(key);
1983 JSON_THROW(out_of_range::create(403, detail::concat("key '", key, "' not found"), this));
1992 reference at(KeyType && key)
2000 auto it = m_value.object->find(std::forward<KeyType>(key));
2003 JSON_THROW(out_of_range::create(403, detail::concat("key '", string_t(std::forward<KeyType>(key)), "' not found"), this));
2010 const_reference at(const typename object_t::key_type& key) const
2018 auto it = m_value.object->find(key);
2021 JSON_THROW(out_of_range::create(403, detail::concat("key '", key, "' not found"), this));
2030 const_reference at(KeyType && key) const
2038 auto it = m_value.object->find(std::forward<KeyType>(key));
2041 JSON_THROW(out_of_range::create(403, detail::concat("key '", string_t(std::forward<KeyType>(key)), "' not found"), this));
2107 reference operator[](typename object_t::key_type key)
2120 auto result = m_value.object->emplace(std::move(key), nullptr);
2129 const_reference operator[](const typename object_t::key_type& key) const
2134 auto it = m_value.object->find(key);
2145 reference operator[](T* key)
2147 return operator[](typename object_t::key_type(key));
2151 const_reference operator[](T* key) const
2153 return operator[](typename object_t::key_type(key));
2160 reference operator[](KeyType && key)
2173 auto result = m_value.object->emplace(std::forward<KeyType>(key), nullptr);
2184 const_reference operator[](KeyType && key) const
2189 auto it = m_value.object->find(std::forward<KeyType>(key));
2214 ValueType value(const typename object_t::key_type& key, const ValueType& default_value) const
2219 // if key is found, return value and given default value otherwise
2220 const auto it = find(key);
2239 ReturnType value(const typename object_t::key_type& key, ValueType && default_value) const
2244 // if key is found, return value and given default value otherwise
2245 const auto it = find(key);
2265 ValueType value(KeyType && key, const ValueType& default_value) const
2270 // if key is found, return value and given default value otherwise
2271 const auto it = find(std::forward<KeyType>(key));
2292 ReturnType value(KeyType && key, ValueType && default_value) const
2297 // if key is found, return value and given default value otherwise
2298 const auto it = find(std::forward<KeyType>(key));
2558 size_type erase_internal(KeyType && key)
2566 return m_value.object->erase(std::forward<KeyType>(key));
2571 size_type erase_internal(KeyType && key)
2579 const auto it = m_value.object->find(std::forward<KeyType>(key));
2590 /// @brief remove element from a JSON object given a key
2592 size_type erase(const typename object_t::key_type& key)
2596 return erase_internal(key);
2599 /// @brief remove element from a JSON object given a key
2603 size_type erase(KeyType && key)
2605 return erase_internal(std::forward<KeyType>(key));
2640 iterator find(const typename object_t::key_type& key)
2646 result.m_it.object_iterator = m_value.object->find(key);
2654 const_iterator find(const typename object_t::key_type& key) const
2660 result.m_it.object_iterator = m_value.object->find(key);
2670 iterator find(KeyType && key)
2676 result.m_it.object_iterator = m_value.object->find(std::forward<KeyType>(key));
2686 const_iterator find(KeyType && key) const
2692 result.m_it.object_iterator = m_value.object->find(std::forward<KeyType>(key));
2698 /// @brief returns the number of occurrences of a key in a JSON object
2700 size_type count(const typename object_t::key_type& key) const
2703 return is_object() ? m_value.object->count(key) : 0;
2706 /// @brief returns the number of occurrences of a key in a JSON object
2710 size_type count(KeyType && key) const
2713 return is_object() ? m_value.object->count(std::forward<KeyType>(key)) : 0;
2718 bool contains(const typename object_t::key_type& key) const
2720 return is_object() && m_value.object->find(key) != m_value.object->end();
2727 bool contains(KeyType && key) const
2729 return is_object() && m_value.object->find(std::forward<KeyType>(key)) != m_value.object->end();
3180 basic_json&& key = init.begin()->moved_or_copied();
3182 std::move(key.get_ref<string_t&>()), (init.begin() + 1)->moved_or_copied()));
3223 /// @brief add an object to an object if key does not exist
3438 auto it2 = m_value.object->find(it.key());
3445 m_value.object->operator[](it.key()) = it.value();
3447 m_value.object->operator[](it.key()).m_parent = this;
4791 JSON_THROW(out_of_range::create(403, detail::concat("key '", last_path, "' not found"), this));
5022 // escape the key name to be used in a JSON patch
5023 const auto path_key = detail::concat(path, '/', detail::escape(it.key()));
5025 if (target.find(it.key()) != target.end())
5027 // recursive call to compare object values at key it
5028 auto temp_diff = diff(it.value(), target[it.key()], path_key);
5033 // found a key that is not in o -> remove it
5044 if (source.find(it.key()) == source.end())
5046 // found a key that is not in this -> add it
5047 const auto path_key = detail::concat(path, '/', detail::escape(it.key()));
5103 erase(it.key());
5107 operator[](it.key()).merge_patch(it.value());