title
stringclasses
1 value
text
stringlengths
30
1.11M
id
stringlengths
27
31
include/nlohmann/detail/json_pointer.hpp/contains bool contains(const BasicJsonType* ptr) const { using size_type = typename BasicJsonType::size_type; for (const auto& reference_token : reference_tokens) { switch (ptr->type()) { case detail::value_...
apositive_train_query0_00000
single_include/nlohmann/json.hpp/contains bool contains(const json_pointer& ptr) const { return ptr.contains(this); }
apositive_train_query0_00001
include/nlohmann/adl_serializer.hpp/adl_serializer/from_json class adl_serializer: static auto from_json(BasicJsonType&& j, ValueType& val) noexcept( noexcept(::nlohmann::from_json(std::forward<BasicJsonType>(j), val))) -> decltype(::nlohmann::from_json(std::forward<BasicJsonType>(j), val), void()) {...
negative_train_query0_00000
include/nlohmann/adl_serializer.hpp/adl_serializer/to_json class adl_serializer: static auto to_json(BasicJsonType& j, ValueType&& val) noexcept( noexcept(::nlohmann::to_json(j, std::forward<ValueType>(val)))) -> decltype(::nlohmann::to_json(j, std::forward<ValueType>(val)), void()) { ::nlohm...
negative_train_query0_00001
include/nlohmann/json.hpp/is_number_float constexpr bool is_number_float() const noexcept { return m_type == value_t::number_float; }
negative_train_query0_00002
include/nlohmann/json.hpp/swap void swap(string_t& other) { // swap only works for strings if (JSON_HEDLEY_LIKELY(is_string())) { std::swap(*(m_value.string), other); } else { JSON_THROW(type_error::create(310, "cannot use swap() with " + s...
negative_train_query0_00003
include/nlohmann/json.hpp/is_number_unsigned constexpr bool is_number_unsigned() const noexcept { return m_type == value_t::number_unsigned; }
negative_train_query0_00004
include/nlohmann/json.hpp/back reference back() { auto tmp = end(); --tmp; return *tmp; }
negative_train_query0_00005
include/nlohmann/json.hpp/begin iterator begin() noexcept { iterator result(this); result.set_begin(); return result; }
negative_train_query0_00006
include/nlohmann/json.hpp/to_msgpack static void to_msgpack(const basic_json& j, detail::output_adapter<uint8_t> o) { binary_writer<uint8_t>(o).write_msgpack(j); }
negative_train_query0_00007
include/nlohmann/json.hpp/to_ubjson static std::vector<uint8_t> to_ubjson(const basic_json& j, const bool use_size = false, const bool use_type = false) { std::vector<uint8_t> result; to_ubjson(j, result, use_siz...
negative_train_query0_00008
include/nlohmann/json.hpp/from_cbor JSON_HEDLEY_WARN_UNUSED_RESULT static basic_json from_cbor(detail::input_adapter&& i, const bool strict = true, const bool allow_exceptions = true) { basic_json result; detail::json_sax_dom_pa...
negative_train_query0_00009
include/nlohmann/json.hpp/from_ubjson JSON_HEDLEY_WARN_UNUSED_RESULT static basic_json from_ubjson(A1 && a1, A2 && a2, const bool strict = true, const bool allow_exceptions = true) { basic_json result; detail::json_sax_dom_p...
negative_train_query0_00010
include/nlohmann/json.hpp/basic_json basic_json(std::nullptr_t = nullptr) noexcept : basic_json(value_t::null) { assert_invariant(); }
negative_train_query0_00011
include/nlohmann/json.hpp/push_back void push_back(const basic_json& val) { // push_back only works for null objects or arrays if (JSON_HEDLEY_UNLIKELY(not(is_null() or is_array()))) { JSON_THROW(type_error::create(308, "cannot use push_back() with " + std::string(type_name()...
negative_train_query0_00012
include/nlohmann/json.hpp/value string_t value(const typename object_t::key_type& key, const char* default_value) const { return value(key, string_t(default_value)); }
negative_train_query0_00013
include/nlohmann/json.hpp/cend const_iterator cend() const noexcept { const_iterator result(this); result.set_end(); return result; }
negative_train_query0_00014
include/nlohmann/json.hpp/crend const_reverse_iterator crend() const noexcept { return const_reverse_iterator(cbegin()); }
negative_train_query0_00015
include/nlohmann/json.hpp/from_bson JSON_HEDLEY_WARN_UNUSED_RESULT static basic_json from_bson(A1 && a1, A2 && a2, const bool strict = true, const bool allow_exceptions = true) { basic_json result; detail::json_sax_dom_parser<ba...
negative_train_query0_00016
include/nlohmann/json.hpp/unflatten basic_json unflatten() const { return json_pointer::unflatten(*this); }
negative_train_query0_00017
include/nlohmann/json.hpp/end iterator end() noexcept { iterator result(this); result.set_end(); return result; }
negative_train_query0_00018
include/nlohmann/json.hpp/crbegin const_reverse_iterator crbegin() const noexcept { return const_reverse_iterator(cend()); }
negative_train_query0_00019
include/nlohmann/json.hpp/merge_patch void merge_patch(const basic_json& apply_patch) { if (apply_patch.is_object()) { if (not is_object()) { *this = object(); } for (auto it = apply_patch.begin(); it != apply_patch.end(); ++it) ...
negative_train_query0_00020
include/nlohmann/json.hpp/front const_reference front() const { return *cbegin(); }
negative_train_query0_00021
include/nlohmann/json.hpp/from_msgpack JSON_HEDLEY_WARN_UNUSED_RESULT static basic_json from_msgpack(A1 && a1, A2 && a2, const bool strict = true, const bool allow_exceptions = true) { basic_json result; detail::json_sax_d...
negative_train_query0_00022
include/nlohmann/json.hpp/get_allocator static allocator_type get_allocator() { return allocator_type(); }
negative_train_query0_00023
include/nlohmann/json.hpp/is_boolean constexpr bool is_boolean() const noexcept { return m_type == value_t::boolean; }
negative_train_query0_00024
include/nlohmann/json.hpp/cbegin const_iterator cbegin() const noexcept { const_iterator result(this); result.set_begin(); return result; }
negative_train_query0_00025
include/nlohmann/json.hpp/insert iterator insert(const_iterator pos, basic_json&& val) { return insert(pos, val); }
negative_train_query0_00026
include/nlohmann/json.hpp/patch basic_json patch(const basic_json& json_patch) const { // make a working copy to apply the patch to basic_json result = *this; // the valid JSON Patch operations enum class patch_operations {add, remove, replace, move, copy, test, invalid}; ...
negative_train_query0_00027
include/nlohmann/json.hpp/array JSON_HEDLEY_WARN_UNUSED_RESULT static basic_json array(initializer_list_t init = {}) { return basic_json(init, false, value_t::array); }
negative_train_query0_00028
include/nlohmann/json.hpp/is_null constexpr bool is_null() const noexcept { return m_type == value_t::null; }
negative_train_query0_00029
include/nlohmann/json.hpp/JSON_INTERNAL_CATCH ValueType value(const json_pointer& ptr, const ValueType& default_value) const { // at only works for objects if (JSON_HEDLEY_LIKELY(is_object())) { // if pointer resolves a value, return it or use default value JSON_T...
negative_train_query0_00030
include/nlohmann/json.hpp/is_number_integer constexpr bool is_number_integer() const noexcept { return m_type == value_t::number_integer or m_type == value_t::number_unsigned; }
negative_train_query0_00031
include/nlohmann/json.hpp/rbegin reverse_iterator rbegin() noexcept { return reverse_iterator(end()); }
negative_train_query0_00032
include/nlohmann/json.hpp/accept static bool accept(IteratorType first, IteratorType last) { return parser(detail::input_adapter(first, last)).accept(true); }
negative_train_query0_00033
include/nlohmann/json.hpp/is_number constexpr bool is_number() const noexcept { return is_number_integer() or is_number_float(); }
negative_train_query0_00034
include/nlohmann/json.hpp/to_bson static std::vector<uint8_t> to_bson(const basic_json& j) { std::vector<uint8_t> result; to_bson(j, result); return result; }
negative_train_query0_00035
include/nlohmann/json.hpp/erase IteratorType erase(IteratorType first, IteratorType last) { // make sure iterator fits the current value if (JSON_HEDLEY_UNLIKELY(this != first.m_object or this != last.m_object)) { JSON_THROW(invalid_iterator::create(203, "iterators do not fit...
negative_train_query0_00036
include/nlohmann/json.hpp/sax_parse static bool sax_parse(IteratorType first, IteratorType last, SAX* sax) { return parser(detail::input_adapter(first, last)).sax_parse(sax); }
negative_train_query0_00037
include/nlohmann/json.hpp/object JSON_HEDLEY_WARN_UNUSED_RESULT static basic_json object(initializer_list_t init = {}) { return basic_json(init, false, value_t::object); }
negative_train_query0_00038
include/nlohmann/json.hpp/is_string constexpr bool is_string() const noexcept { return m_type == value_t::string; }
negative_train_query0_00039
include/nlohmann/json.hpp/rend reverse_iterator rend() noexcept { return reverse_iterator(begin()); }
negative_train_query0_00040
include/nlohmann/json.hpp/JSON_CATCH JSON_CATCH (std::out_of_range&) { // create better exception explanation JSON_THROW(out_of_range::create(403, "key '" + key + "' not found")); }
negative_train_query0_00041
include/nlohmann/json.hpp/to_cbor static void to_cbor(const basic_json& j, detail::output_adapter<char> o) { binary_writer<char>(o).write_cbor(j); }
negative_train_query0_00042
include/nlohmann/json.hpp/is_discarded constexpr bool is_discarded() const noexcept { return m_type == value_t::discarded; }
negative_train_query0_00043
include/nlohmann/json.hpp/count size_type count(KeyT&& key) const { // return 0 for all nonobject types return is_object() ? m_value.object->count(std::forward<KeyT>(key)) : 0; }
negative_train_query0_00044
include/nlohmann/json.hpp/type constexpr value_t type() const noexcept { return m_type; }
negative_train_query0_00045
include/nlohmann/json.hpp/is_array constexpr bool is_array() const noexcept { return m_type == value_t::array; }
negative_train_query0_00046
include/nlohmann/json.hpp/diff JSON_HEDLEY_WARN_UNUSED_RESULT static basic_json diff(const basic_json& source, const basic_json& target, const std::string& path = "") { // the patch basic_json result(value_t::array); // if the values are the same, return e...
negative_train_query0_00047
include/nlohmann/json.hpp/is_object constexpr bool is_object() const noexcept { return m_type == value_t::object; }
negative_train_query0_00048
include/nlohmann/json.hpp/clear void clear() noexcept { switch (m_type) { case value_t::number_integer: { m_value.number_integer = 0; break; } case value_t::number_unsigned: { m_value.num...
negative_train_query0_00049
include/nlohmann/json.hpp/is_structured constexpr bool is_structured() const noexcept { return is_array() or is_object(); }
negative_train_query0_00050
include/nlohmann/json.hpp/at const_reference at(const json_pointer& ptr) const { return ptr.get_checked(this); }
negative_train_query0_00051
include/nlohmann/json.hpp/is_primitive constexpr bool is_primitive() const noexcept { return is_null() or is_string() or is_boolean() or is_number(); }
negative_train_query0_00052
include/nlohmann/json.hpp/contains bool contains(KeyT && key) const { return is_object() and m_value.object->find(std::forward<KeyT>(key)) != m_value.object->end(); }
negative_train_query0_00053
include/nlohmann/json.hpp/emplace std::pair<iterator, bool> emplace(Args&& ... args) { // emplace only works for null objects or arrays if (JSON_HEDLEY_UNLIKELY(not(is_null() or is_object()))) { JSON_THROW(type_error::create(311, "cannot use emplace() with " + std::string(typ...
negative_train_query0_00054
include/nlohmann/json.hpp/parse static basic_json parse(IteratorType first, IteratorType last, const parser_callback_t cb = nullptr, const bool allow_exceptions = true) { basic_json result; parser(detail::input_adapter(first, last), cb, all...
negative_train_query0_00055
include/nlohmann/json.hpp/find const_iterator find(KeyT&& key) const { auto result = cend(); if (is_object()) { result.m_it.object_iterator = m_value.object->find(std::forward<KeyT>(key)); } return result; }
negative_train_query0_00056
include/nlohmann/json.hpp/emplace_back reference emplace_back(Args&& ... args) { // emplace_back only works for null objects or arrays if (JSON_HEDLEY_UNLIKELY(not(is_null() or is_array()))) { JSON_THROW(type_error::create(311, "cannot use emplace_back() with " + std::string(...
negative_train_query0_00057
include/nlohmann/json.hpp/flatten basic_json flatten() const { basic_json result(value_t::object); json_pointer::flatten("", *this, result); return result; }
negative_train_query0_00058
include/nlohmann/json.hpp/meta JSON_HEDLEY_WARN_UNUSED_RESULT static basic_json meta() { basic_json result; result["copyright"] = "(C) 2013-2017 Niels Lohmann"; result["name"] = "JSON for Modern C++"; result["url"] = "https://github.com/nlohmann/json"; result["versio...
negative_train_query0_00059
include/nlohmann/json.hpp/update void update(const_reference j) { // implicitly convert null value to an empty object if (is_null()) { m_type = value_t::object; m_value.object = create<object_t>(); assert_invariant(); } if (JSON_HEDLEY...
negative_train_query0_00060
include/nlohmann/json.hpp/insert_iterator iterator insert_iterator(const_iterator pos, Args&& ... args) { iterator result(this); assert(m_value.array != nullptr); auto insert_pos = std::distance(m_value.array->begin(), pos.m_it.array_iterator); m_value.array->insert(pos.m_it.arr...
negative_train_query0_00061
include/nlohmann/json.hpp/assert_invariant void assert_invariant() const noexcept { assert(m_type != value_t::object or m_value.object != nullptr); assert(m_type != value_t::array or m_value.array != nullptr); assert(m_type != value_t::string or m_value.string != nullptr); }
negative_train_query0_00062
include/nlohmann/json.hpp/json_value/json_value class json_value: json_value(array_t&& value) { array = create<array_t>(std::move(value)); }
negative_train_query0_00063
include/nlohmann/detail/json_ref.hpp/json_ref/json_ref class json_ref: json_ref(Args && ... args) : owned_value(std::forward<Args>(args)...), value_ref(&owned_value), is_rvalue(true) {}
negative_train_query0_00064
include/nlohmann/detail/exceptions.hpp/parse_error/parse_error class parse_error: parse_error(int id_, std::size_t byte_, const char* what_arg) : exception(id_, what_arg), byte(byte_) {}
negative_train_query0_00065
include/nlohmann/detail/json_pointer.hpp/split static std::vector<std::string> split(const std::string& reference_string) { std::vector<std::string> result; // special case: empty reference string -> no reference tokens if (reference_string.empty()) { return result; ...
negative_train_query0_00066
include/nlohmann/detail/json_pointer.hpp/escape static std::string escape(std::string s) { replace_substring(s, "~", "~0"); replace_substring(s, "/", "~1"); return s; }
negative_train_query0_00067
include/nlohmann/detail/json_pointer.hpp/unflatten static BasicJsonType unflatten(const BasicJsonType& value) { if (JSON_HEDLEY_UNLIKELY(not value.is_object())) { JSON_THROW(detail::type_error::create(314, "only objects can be unflattened")); } BasicJsonType resu...
negative_train_query0_00068
include/nlohmann/detail/json_pointer.hpp/replace_substring static void replace_substring(std::string& s, const std::string& f, const std::string& t) { assert(not f.empty()); for (auto pos = s.find(f); // find first occurrence of f ...
negative_train_query0_00069
include/nlohmann/detail/json_pointer.hpp/unescape static void unescape(std::string& s) { replace_substring(s, "~1", "/"); replace_substring(s, "~0", "~"); }
negative_train_query0_00070
include/nlohmann/detail/json_pointer.hpp/flatten static void flatten(const std::string& reference_string, const BasicJsonType& value, BasicJsonType& result) { switch (value.type()) { case detail::value_t::array: { ...
negative_train_query0_00071
include/nlohmann/detail/json_pointer.hpp/json_pointer/json_pointer class json_pointer: explicit json_pointer(const std::string& s = "") : reference_tokens(split(s)) {}
negative_train_query0_00072
include/nlohmann/detail/json_pointer.hpp/json_pointer/JSON_CATCH class json_pointer: JSON_CATCH(std::out_of_range&) { JSON_THROW(detail::out_of_range::create(404, "unresolved reference token '" + s + "'")); }
negative_train_query0_00073
include/nlohmann/detail/input/input_adapters.hpp/input_stream_adapter/input_stream_adapter class input_stream_adapter: input_stream_adapter(const input_stream_adapter&) = delete;
negative_train_query0_00074
include/nlohmann/detail/input/input_adapters.hpp/input_buffer_adapter/input_buffer_adapter class input_buffer_adapter: input_buffer_adapter(input_buffer_adapter&&) = delete;
negative_train_query0_00075
include/nlohmann/detail/input/input_adapters.hpp/file_input_adapter/file_input_adapter class file_input_adapter: file_input_adapter(file_input_adapter&&) = default;
negative_train_query0_00076
include/nlohmann/detail/input/input_adapters.hpp/wide_string_input_adapter/wide_string_input_adapter class wide_string_input_adapter: explicit wide_string_input_adapter(const WideStringType& w) noexcept : str(w) {}
negative_train_query0_00077
include/nlohmann/detail/input/input_adapters.hpp/wide_string_input_adapter/fill_buffer class wide_string_input_adapter: void fill_buffer() { wide_string_input_helper<WideStringType, T>::fill_buffer(str, current_wchar, utf8_bytes, utf8_bytes_index, utf8_bytes_filled); }
negative_train_query0_00078
include/nlohmann/detail/input/input_adapters.hpp/input_adapter/input_adapter class input_adapter: input_adapter(const ContiguousContainer& c) : input_adapter(std::begin(c), std::end(c)) {}
negative_train_query0_00079
include/nlohmann/detail/input/lexer.hpp/lexer/lexer class lexer: lexer(lexer&&) = delete;
negative_train_query0_00080
include/nlohmann/detail/input/binary_reader.hpp/binary_reader/binary_reader class binary_reader: binary_reader(const binary_reader&) = delete;
negative_train_query0_00081
include/nlohmann/detail/input/binary_reader.hpp/binary_reader/get_string class binary_reader: bool get_string(const input_format_t format, const NumberType len, string_t& result) { bool success = true; std::generate_n(std::back_inserter(result), len, [this,...
negative_train_query0_00082
include/nlohmann/detail/input/binary_reader.hpp/binary_reader/get_number class binary_reader: bool get_number(const input_format_t format, NumberType& result) { // step 1: read input into array with system's byte order std::array<std::uint8_t, sizeof(NumberType)> vec; for (std::size_t i =...
negative_train_query0_00083
include/nlohmann/detail/input/binary_reader.hpp/binary_reader/get_bson_string class binary_reader: bool get_bson_string(const NumberType len, string_t& result) { if (JSON_HEDLEY_UNLIKELY(len < 1)) { auto last_token = get_token_string(); return sax->parse_error(chars_read, ...
negative_train_query0_00084
include/nlohmann/detail/input/parser.hpp/parser/parser class parser: explicit parser(detail::input_adapter_t&& adapter, const parser_callback_t cb = nullptr, const bool allow_exceptions_ = true) : callback(cb), m_lexer(std::move(adapter)), allow_exceptions(allow_except...
negative_train_query0_00085
include/nlohmann/detail/input/parser.hpp/parser/sax_parse_internal class parser: bool sax_parse_internal(SAX* sax) { // stack to remember the hierarchy of structured values we are parsing // true = array; false = object std::vector<bool> states; // value to avoid a goto (see comme...
negative_train_query0_00086
include/nlohmann/detail/input/parser.hpp/parser/sax_parse class parser: bool sax_parse(SAX* sax, const bool strict = true) { (void)detail::is_sax_static_asserts<SAX, BasicJsonType> {}; const bool result = sax_parse_internal(sax); // strict mode: next byte must be EOF if (result a...
negative_train_query0_00087
include/nlohmann/detail/input/json_sax.hpp/json_sax_dom_parser/json_sax_dom_parser class json_sax_dom_parser: json_sax_dom_parser(json_sax_dom_parser&&) = default;
negative_train_query0_00088
include/nlohmann/detail/input/json_sax.hpp/json_sax_dom_callback_parser/json_sax_dom_callback_parser class json_sax_dom_callback_parser: json_sax_dom_callback_parser(json_sax_dom_callback_parser&&) = default;
negative_train_query0_00089
include/nlohmann/detail/input/json_sax.hpp/json_sax_dom_callback_parser/handle_value class json_sax_dom_callback_parser: std::pair<bool, BasicJsonType*> handle_value(Value&& v, const bool skip_callback = false) { assert(not keep_stack.empty()); // do not handle this value if we know it would be ...
negative_train_query0_00090
include/nlohmann/detail/output/binary_writer.hpp/binary_writer/binary_writer class binary_writer: explicit binary_writer(output_adapter_t<CharType> adapter) : oa(adapter) { assert(oa); }
negative_train_query0_00091
include/nlohmann/detail/output/binary_writer.hpp/binary_writer/write_number_with_ubjson_prefix class binary_writer: void write_number_with_ubjson_prefix(const NumberType n, const bool add_prefix) { if (add_prefix) { oa->write_character(get_ubjs...
negative_train_query0_00092
include/nlohmann/detail/output/binary_writer.hpp/binary_writer/write_number class binary_writer: void write_number(const NumberType n) { // step 1: write number to array of length NumberType std::array<CharType, sizeof(NumberType)> vec; std::memcpy(vec.data(), &n, sizeof(NumberType)); ...
negative_train_query0_00093
include/nlohmann/detail/output/binary_writer.hpp/binary_writer/to_char_type class binary_writer: static constexpr CharType to_char_type(InputCharType x) noexcept { return x; }
negative_train_query0_00094
include/nlohmann/detail/output/serializer.hpp/serializer/serializer class serializer: serializer(serializer&&) = delete;
negative_train_query0_00095
include/nlohmann/detail/output/serializer.hpp/serializer/dump_integer class serializer: void dump_integer(NumberType x) { static constexpr std::array<std::array<char, 2>, 100> digits_to_99 { { {{'0', '0'}}, {{'0', '1'}}, {{'0', '2'}}, {{'0', '3'}}, {{'0', '4'}}, {{'0',...
negative_train_query0_00096
include/nlohmann/detail/output/output_adapters.hpp/output_vector_adapter/output_vector_adapter class output_vector_adapter: explicit output_vector_adapter(std::vector<CharType>& vec) noexcept : v(vec) {}
negative_train_query0_00097