Lines Matching defs:first
2566 return ej_pair.first == e; \
2580 e = ((it != std::end(m)) ? it : std::begin(m))->first; \
2959 for (auto pos = s.find(f); // find first occurrence of f
4354 tokens.emplace_back(element.first.c_str());
4432 @note For an input with n bytes, 1 is the index of the first character and
4879 return value_type(p.first, p.second.template get<typename ConstructibleObjectType::mapped_type>());
5697 j = { p.first, p.second };
6150 std::istream flags; any input errors (e.g., EOF) will be detected by the first
6213 iterator_input_adapter(IteratorType first, IteratorType last)
6214 : current(std::move(first)), end(std::move(last))
6419 static adapter_type create(IteratorType first, IteratorType last)
6421 return adapter_type(std::move(first), std::move(last));
6443 static adapter_type create(IteratorType first, IteratorType last)
6445 return adapter_type(base_adapter_type(std::move(first), std::move(last)));
6451 typename iterator_input_adapter_factory<IteratorType>::adapter_type input_adapter(IteratorType first, IteratorType last)
6454 return factory_type::create(first, last);
6550 span_input_adapter(IteratorType first, IteratorType last)
6551 : ia(input_adapter(first, last)) {}
8551 // try to parse integers first and fall back to floats
8795 // the first character is not the beginning of the BOM; unget it to
9977 This function first reads starting bytes to determine the expected
10073 This function first reads starting bytes to determine the expected
10644 This function first reads starting bytes to determine the expected
10727 This function first reads starting bytes to determine the expected
11029 if (size_and_type.first != npos)
11035 for (std::size_t i = 0; i < size_and_type.first; ++i)
11047 for (std::size_t i = 0; i < size_and_type.first; ++i)
11308 result.first = npos; // size
11342 bool is_error = get_ubjson_size_value(result.first, is_ndarray);
11357 bool is_error = get_ubjson_size_value(result.first, is_ndarray);
11567 if (input_format == input_format_t::bjdata && size_and_type.first != npos && (size_and_type.second & (1 << 8)) != 0)
11572 return p.first < t;
11575 if (JSON_HEDLEY_UNLIKELY(it == bjd_types_map.end() || it->first != size_and_type.second))
11594 if (JSON_HEDLEY_UNLIKELY(!sax->key(key) || !sax->start_array(size_and_type.first) ))
11599 for (std::size_t i = 0; i < size_and_type.first; ++i)
11610 if (size_and_type.first != npos)
11612 if (JSON_HEDLEY_UNLIKELY(!sax->start_array(size_and_type.first)))
11621 for (std::size_t i = 0; i < size_and_type.first; ++i)
11632 for (std::size_t i = 0; i < size_and_type.first; ++i)
11673 if (input_format == input_format_t::bjdata && size_and_type.first != npos && (size_and_type.second & (1 << 8)) != 0)
11681 if (size_and_type.first != npos)
11683 if (JSON_HEDLEY_UNLIKELY(!sax->start_object(size_and_type.first)))
11690 for (std::size_t i = 0; i < size_and_type.first; ++i)
11705 for (std::size_t i = 0; i < size_and_type.first; ++i)
12177 // read first token
12489 // new value, we need to evaluate the new state first.
12543 // new value, we need to evaluate the new state first.
12980 @brief set the iterator to the first value
13514 return m_it.object_iterator->first;
14293 // first char should be between '1' and '9'
14367 // search for the first slash after the first character
14369 // set the beginning of the first reference token
14453 flatten(detail::concat(reference_string, '/', detail::escape(element.first)), element.second, result);
14509 json_pointer(element.first).get_and_create(result) = element.second;
15056 // The conversions below encode the sign in the first
15313 write_cbor(el.first);
15635 write_msgpack(el.first);
15845 write_number_with_ubjson_prefix(el.first.size(), true, use_bjdata);
15847 reinterpret_cast<const CharType*>(el.first.c_str()),
15848 el.first.size());
16179 return result += calc_bson_element_size(el.first, el.second);
16195 write_bson_element(el.first, el.second);
17836 @brief generates a decimal representation of the floating-point number value in [first, last).
17848 char* to_chars(char* first, const char* last, FloatType value)
17857 *first++ = '-';
17866 *first++ = '0';
17868 *first++ = '.';
17869 *first++ = '0';
17870 return first;
17876 JSON_ASSERT(last - first >= std::numeric_limits<FloatType>::max_digits10);
17884 dtoa_impl::grisu2(first, len, decimal_exponent, value);
17893 JSON_ASSERT(last - first >= kMaxExp + 2);
17894 JSON_ASSERT(last - first >= 2 + (-kMinExp - 1) + std::numeric_limits<FloatType>::max_digits10);
17895 JSON_ASSERT(last - first >= std::numeric_limits<FloatType>::max_digits10 + 6);
17897 return dtoa_impl::format_buffer(first, len, decimal_exponent, kMinExp, kMaxExp);
18018 // first n-1 elements
18024 dump_escaped(i->first, ensure_ascii);
18035 dump_escaped(i->first, ensure_ascii);
18047 // first n-1 elements
18052 dump_escaped(i->first, ensure_ascii);
18062 dump_escaped(i->first, ensure_ascii);
18091 // first n-1 elements
18113 // first n-1 elements
18403 // in case we saw this character the first time, we
18929 ordered_map(It first, It last, const Allocator& alloc = Allocator())
18930 : Container{first, last, alloc} {}
18938 if (m_compare(it->first, key))
18953 if (m_compare(it->first, key))
18964 return emplace(key, T{}).first->second;
18971 return emplace(std::forward<KeyType>(key), T{}).first->second;
18990 if (m_compare(it->first, key))
19005 if (m_compare(it->first, key))
19018 if (m_compare(it->first, key))
19033 if (m_compare(it->first, key))
19046 if (m_compare(it->first, key))
19067 if (m_compare(it->first, key))
19087 iterator erase(iterator first, iterator last)
19089 if (first == last)
19091 return first;
19094 const auto elements_affected = std::distance(first, last);
19095 const auto offset = std::distance(Container::begin(), first);
19101 // to first. We will need this later.
19105 // first last
19108 // We start at first and re-construct (viz. copy) the elements from
19109 // the back of the vector. Example for first iteration:
19117 for (auto it = first; std::next(it, elements_affected) != Container::end(); ++it)
19125 // first last
19132 // first last
19134 // first is now pointing past the last deleted element, but we cannot
19144 if (m_compare(it->first, key))
19158 if (m_compare(it->first, key))
19170 if (m_compare(it->first, key))
19184 if (m_compare(it->first, key))
19196 if (m_compare(it->first, key))
19206 return emplace(value.first, std::move(value.second));
19213 if (m_compare(it->first, value.first))
19227 void insert(InputIt first, InputIt last)
19229 for (auto it = first; it != last; ++it)
20074 // check if each element is an array with two elements whose first
20198 basic_json(InputIT first, InputIT last)
20200 JSON_ASSERT(first.m_object != nullptr);
20204 if (JSON_HEDLEY_UNLIKELY(first.m_object != last.m_object))
20209 // copy type from first iterator
20210 m_type = first.m_object->m_type;
20221 if (JSON_HEDLEY_UNLIKELY(!first.m_it.primitive_iterator.is_begin()
20224 JSON_THROW(invalid_iterator::create(204, "iterators out of range", first.m_object));
20242 m_value.number_integer = first.m_object->m_value.number_integer;
20248 m_value.number_unsigned = first.m_object->m_value.number_unsigned;
20254 m_value.number_float = first.m_object->m_value.number_float;
20260 m_value.boolean = first.m_object->m_value.boolean;
20266 m_value = *first.m_object->m_value.string;
20272 m_value.object = create<object_t>(first.m_it.object_iterator,
20279 m_value.array = create<array_t>(first.m_it.array_iterator,
20286 m_value = *first.m_object->m_value.binary;
20293 JSON_THROW(invalid_iterator::create(206, detail::concat("cannot construct with iterators from ", first.m_object->type_name()), first.m_object));
21299 return set_parent(result.first->second);
21352 return set_parent(result.first->second);
21558 /// @brief access the first element
21565 /// @brief access the first element
21665 IteratorType erase(IteratorType first, IteratorType last)
21668 if (JSON_HEDLEY_UNLIKELY(this != first.m_object || this != last.m_object))
21684 if (JSON_HEDLEY_LIKELY(!first.m_it.primitive_iterator.is_begin()
21712 result.m_it.object_iterator = m_value.object->erase(first.m_it.object_iterator,
21719 result.m_it.array_iterator = m_value.array->erase(first.m_it.array_iterator,
21934 /// @brief returns an iterator to the first element
21943 /// @brief returns an iterator to the first element
21950 /// @brief returns a const iterator to the first element
22019 /// @brief returns a const reverse iterator to one before the first
22341 set_parent(res.first->second);
22422 set_parent(res.first->second);
22426 it.m_it.object_iterator = res.first;
22502 iterator insert(const_iterator pos, const_iterator first, const_iterator last)
22517 if (JSON_HEDLEY_UNLIKELY(first.m_object != last.m_object))
22522 if (JSON_HEDLEY_UNLIKELY(first.m_object == this))
22528 return insert_iterator(pos, first.m_it.array_iterator, last.m_it.array_iterator);
22553 void insert(const_iterator first, const_iterator last)
22562 if (JSON_HEDLEY_UNLIKELY(first.m_object != last.m_object))
22568 if (JSON_HEDLEY_UNLIKELY(!first.m_object->is_object()))
22570 JSON_THROW(invalid_iterator::create(202, "iterators first and last must point to objects", this));
22573 m_value.object->insert(first.m_it.object_iterator, last.m_it.object_iterator);
22585 void update(const_iterator first, const_iterator last, bool merge_objects = false)
22601 if (JSON_HEDLEY_UNLIKELY(first.m_object != last.m_object))
22607 if (JSON_HEDLEY_UNLIKELY(!first.m_object->is_object()))
22609 JSON_THROW(type_error::create(312, detail::concat("cannot use update() with ", first.m_object->type_name()), first.m_object));
22612 for (auto it = first; it != last; ++it)
23200 static basic_json parse(IteratorType first,
23207 parser(detail::input_adapter(std::move(first), std::move(last)), cb, allow_exceptions, ignore_comments).parse(true, result);
23235 static bool accept(IteratorType first, IteratorType last,
23238 return parser(detail::input_adapter(std::move(first), std::move(last)), nullptr, false, ignore_comments).accept(true);
23268 static bool sax_parse(IteratorType first, IteratorType last, SAX* sax,
23273 auto ia = detail::input_adapter(std::move(first), std::move(last));
23523 static basic_json from_cbor(IteratorType first, IteratorType last,
23530 auto ia = detail::input_adapter(std::move(first), std::move(last));
23581 static basic_json from_msgpack(IteratorType first, IteratorType last,
23587 auto ia = detail::input_adapter(std::move(first), std::move(last));
23635 static basic_json from_ubjson(IteratorType first, IteratorType last,
23641 auto ia = detail::input_adapter(std::move(first), std::move(last));
23690 static basic_json from_bjdata(IteratorType first, IteratorType last,
23696 auto ia = detail::input_adapter(std::move(first), std::move(last));
23720 static basic_json from_bson(IteratorType first, IteratorType last,
23726 auto ia = detail::input_adapter(std::move(first), std::move(last));
24153 // first pass: traverse common elements
24197 // first pass: traverse this object's elements