Lines Matching defs:create
378 static T* create(Args&& ... args)
459 object = create<object_t>();
465 array = create<array_t>();
471 string = create<string_t>("");
477 binary = create<binary_t>();
517 JSON_THROW(other_error::create(500, "961c151d2e87f2686a955a9be24d316f1362bf21 3.11.2", nullptr)); // LCOV_EXCL_LINE
525 json_value(const string_t& value) : string(create<string_t>(value)) {}
528 json_value(string_t&& value) : string(create<string_t>(std::move(value))) {}
531 json_value(const object_t& value) : object(create<object_t>(value)) {}
534 json_value(object_t&& value) : object(create<object_t>(std::move(value))) {}
537 json_value(const array_t& value) : array(create<array_t>(value)) {}
540 json_value(array_t&& value) : array(create<array_t>(std::move(value))) {}
543 json_value(const typename binary_t::container_type& value) : binary(create<binary_t>(value)) {}
546 json_value(typename binary_t::container_type&& value) : binary(create<binary_t>(std::move(value))) {}
549 json_value(const binary_t& value) : binary(create<binary_t>(value)) {}
552 json_value(binary_t&& value) : binary(create<binary_t>(std::move(value))) {}
803 /// @brief create an empty value with a given type
811 /// @brief create a null object
819 /// @brief create a JSON value from compatible types
834 /// @brief create a JSON value from an existing one
890 /// @brief create a container (array or object) from an initializer list
907 // if array is wanted, do not create an object though possible
916 JSON_THROW(type_error::create(301, "cannot create object from initializer list", nullptr));
922 // the initializer list is a list of pairs -> create object
936 // the initializer list describes an array -> create array
938 m_value.array = create<array_t>(init.begin(), init.end());
945 /// @brief explicitly create a binary array (without subtype)
956 /// @brief explicitly create a binary array (with subtype)
967 /// @brief explicitly create a binary array
978 /// @brief explicitly create a binary array (with subtype)
989 /// @brief explicitly create an array from an initializer list
997 /// @brief explicitly create an object from an initializer list
1010 m_value.array = create<array_t>(cnt, val);
1028 JSON_THROW(invalid_iterator::create(201, "iterators are not compatible", nullptr));
1046 JSON_THROW(invalid_iterator::create(204, "iterators out of range", first.m_object));
1094 m_value.object = create<object_t>(first.m_it.object_iterator,
1101 m_value.array = create<array_t>(first.m_it.array_iterator,
1115 JSON_THROW(invalid_iterator::create(206, detail::concat("cannot construct with iterators from ", first.m_object->type_name()), first.m_object));
1399 JSON_THROW(type_error::create(302, detail::concat("type must be boolean, but is ", type_name()), this));
1520 JSON_THROW(type_error::create(303, detail::concat("incompatible ReferenceType for get_ref, actual type is ", obj.type_name()), &obj));
1895 JSON_THROW(type_error::create(302, detail::concat("type must be binary, but is ", type_name()), this));
1907 JSON_THROW(type_error::create(302, detail::concat("type must be binary, but is ", type_name()), this));
1937 // create better exception explanation
1938 JSON_THROW(out_of_range::create(401, detail::concat("array index ", std::to_string(idx), " is out of range"), this));
1943 JSON_THROW(type_error::create(304, detail::concat("cannot use at() with ", type_name()), this));
1960 // create better exception explanation
1961 JSON_THROW(out_of_range::create(401, detail::concat("array index ", std::to_string(idx), " is out of range"), this));
1966 JSON_THROW(type_error::create(304, detail::concat("cannot use at() with ", type_name()), this));
1977 JSON_THROW(type_error::create(304, detail::concat("cannot use at() with ", type_name()), this));
1983 JSON_THROW(out_of_range::create(403, detail::concat("key '", key, "' not found"), this));
1997 JSON_THROW(type_error::create(304, detail::concat("cannot use at() with ", type_name()), this));
2003 JSON_THROW(out_of_range::create(403, detail::concat("key '", string_t(std::forward<KeyType>(key)), "' not found"), this));
2015 JSON_THROW(type_error::create(304, detail::concat("cannot use at() with ", type_name()), this));
2021 JSON_THROW(out_of_range::create(403, detail::concat("key '", key, "' not found"), this));
2035 JSON_THROW(type_error::create(304, detail::concat("cannot use at() with ", type_name()), this));
2041 JSON_THROW(out_of_range::create(403, detail::concat("key '", string_t(std::forward<KeyType>(key)), "' not found"), this));
2054 m_value.array = create<array_t>();
2089 JSON_THROW(type_error::create(305, detail::concat("cannot use operator[] with a numeric argument with ", type_name()), this));
2102 JSON_THROW(type_error::create(305, detail::concat("cannot use operator[] with a numeric argument with ", type_name()), this));
2113 m_value.object = create<object_t>();
2124 JSON_THROW(type_error::create(305, detail::concat("cannot use operator[] with a string argument with ", type_name()), this));
2139 JSON_THROW(type_error::create(305, detail::concat("cannot use operator[] with a string argument with ", type_name()), this));
2166 m_value.object = create<object_t>();
2177 JSON_THROW(type_error::create(305, detail::concat("cannot use operator[] with a string argument with ", type_name()), this));
2194 JSON_THROW(type_error::create(305, detail::concat("cannot use operator[] with a string argument with ", type_name()), this));
2229 JSON_THROW(type_error::create(306, detail::concat("cannot use value() with ", type_name()), this));
2254 JSON_THROW(type_error::create(306, detail::concat("cannot use value() with ", type_name()), this));
2280 JSON_THROW(type_error::create(306, detail::concat("cannot use value() with ", type_name()), this));
2307 JSON_THROW(type_error::create(306, detail::concat("cannot use value() with ", type_name()), this));
2331 JSON_THROW(type_error::create(306, detail::concat("cannot use value() with ", type_name()), this));
2356 JSON_THROW(type_error::create(306, detail::concat("cannot use value() with ", type_name()), this));
2422 JSON_THROW(invalid_iterator::create(202, "iterator does not fit current value", this));
2438 JSON_THROW(invalid_iterator::create(205, "iterator out of range", this));
2476 JSON_THROW(type_error::create(307, detail::concat("cannot use erase() with ", type_name()), this));
2492 JSON_THROW(invalid_iterator::create(203, "iterators do not fit current value", this));
2509 JSON_THROW(invalid_iterator::create(204, "iterators out of range", this));
2549 JSON_THROW(type_error::create(307, detail::concat("cannot use erase() with ", type_name()), this));
2563 JSON_THROW(type_error::create(307, detail::concat("cannot use erase() with ", type_name()), this));
2576 JSON_THROW(type_error::create(307, detail::concat("cannot use erase() with ", type_name()), this));
2617 JSON_THROW(out_of_range::create(401, detail::concat("array index ", std::to_string(idx), " is out of range"), this));
2624 JSON_THROW(type_error::create(307, detail::concat("cannot use erase() with ", type_name()), this));
3085 JSON_THROW(type_error::create(308, detail::concat("cannot use push_back() with ", type_name()), this));
3118 JSON_THROW(type_error::create(308, detail::concat("cannot use push_back() with ", type_name()), this));
3150 JSON_THROW(type_error::create(308, detail::concat("cannot use push_back() with ", type_name()), this));
3206 JSON_THROW(type_error::create(311, detail::concat("cannot use emplace_back() with ", type_name()), this));
3231 JSON_THROW(type_error::create(311, detail::concat("cannot use emplace() with ", type_name()), this));
3246 // create result iterator and set iterator to the result of emplace
3285 JSON_THROW(invalid_iterator::create(202, "iterator does not fit current value", this));
3292 JSON_THROW(type_error::create(309, detail::concat("cannot use insert() with ", type_name()), this));
3312 JSON_THROW(invalid_iterator::create(202, "iterator does not fit current value", this));
3319 JSON_THROW(type_error::create(309, detail::concat("cannot use insert() with ", type_name()), this));
3329 JSON_THROW(type_error::create(309, detail::concat("cannot use insert() with ", type_name()), this));
3335 JSON_THROW(invalid_iterator::create(202, "iterator does not fit current value", this));
3341 JSON_THROW(invalid_iterator::create(210, "iterators do not fit", this));
3346 JSON_THROW(invalid_iterator::create(211, "passed iterators may not belong to container", this));
3360 JSON_THROW(type_error::create(309, detail::concat("cannot use insert() with ", type_name()), this));
3366 JSON_THROW(invalid_iterator::create(202, "iterator does not fit current value", this));
3380 JSON_THROW(type_error::create(309, detail::concat("cannot use insert() with ", type_name()), this));
3386 JSON_THROW(invalid_iterator::create(210, "iterators do not fit", this));
3392 JSON_THROW(invalid_iterator::create(202, "iterators first and last must point to objects", this));
3413 m_value.object = create<object_t>();
3419 JSON_THROW(type_error::create(312, detail::concat("cannot use update() with ", type_name()), this));
3425 JSON_THROW(invalid_iterator::create(210, "iterators do not fit", this));
3431 JSON_THROW(type_error::create(312, detail::concat("cannot use update() with ", first.m_object->type_name()), first.m_object));
3493 JSON_THROW(type_error::create(310, detail::concat("cannot use swap(array_t&) with ", type_name()), this));
3509 JSON_THROW(type_error::create(310, detail::concat("cannot use swap(object_t&) with ", type_name()), this));
3525 JSON_THROW(type_error::create(310, detail::concat("cannot use swap(string_t&) with ", type_name()), this));
3541 JSON_THROW(type_error::create(310, detail::concat("cannot use swap(binary_t&) with ", type_name()), this));
3557 JSON_THROW(type_error::create(310, detail::concat("cannot use swap(binary_t::container_type&) with ", type_name()), this));
4202 /// @brief create a CBOR serialization of a given JSON value
4211 /// @brief create a CBOR serialization of a given JSON value
4218 /// @brief create a CBOR serialization of a given JSON value
4225 /// @brief create a MessagePack serialization of a given JSON value
4234 /// @brief create a MessagePack serialization of a given JSON value
4241 /// @brief create a MessagePack serialization of a given JSON value
4248 /// @brief create a UBJSON serialization of a given JSON value
4259 /// @brief create a UBJSON serialization of a given JSON value
4267 /// @brief create a UBJSON serialization of a given JSON value
4275 /// @brief create a BJData serialization of a given JSON value
4286 /// @brief create a BJData serialization of a given JSON value
4294 /// @brief create a BJData serialization of a given JSON value
4302 /// @brief create a BSON serialization of a given JSON value
4311 /// @brief create a BSON serialization of a given JSON value
4318 /// @brief create a BSON serialization of a given JSON value
4325 /// @brief create a JSON value from an input in CBOR format
4341 /// @brief create a JSON value from an input in CBOR format
4384 /// @brief create a JSON value from an input in MessagePack format
4399 /// @brief create a JSON value from an input in MessagePack format
4438 /// @brief create a JSON value from an input in UBJSON format
4453 /// @brief create a JSON value from an input in UBJSON format
4493 /// @brief create a JSON value from an input in BJData format
4508 /// @brief create a JSON value from an input in BJData format
4523 /// @brief create a JSON value from an input in BSON format
4538 /// @brief create a JSON value from an input in BSON format
4750 JSON_THROW(out_of_range::create(401, detail::concat("array index ", std::to_string(idx), " is out of range"), &parent));
4791 JSON_THROW(out_of_range::create(403, detail::concat("key '", last_path, "' not found"), this));
4804 JSON_THROW(parse_error::create(104, 0, "JSON patch must be an array of objects", &json_patch));
4825 JSON_THROW(parse_error::create(105, 0, detail::concat(error_msg, " must have member '", member, "'"), &val));
4832 JSON_THROW(parse_error::create(105, 0, detail::concat(error_msg, " must have string member '", member, "'"), &val));
4842 JSON_THROW(parse_error::create(104, 0, "JSON patch must be an array of objects", &val));
4920 JSON_THROW(other_error::create(501, detail::concat("unsuccessful: ", val.dump()), &val));
4931 JSON_THROW(parse_error::create(105, 0, detail::concat("operation value '", op, "' is invalid"), &val));