Lines Matching defs:string

31 #include <string> // string, stoi, to_string
84 - If `m_type == value_t::string`, then `m_value.string != nullptr`.
253 result["version"]["string"] =
343 /// @brief a type for a string
409 string | string | pointer to @ref string_t
429 /// string (stored with pointer to save storage)
430 string_t* string;
469 case value_t::string:
471 string = create<string_t>("");
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))) {}
623 case value_t::string:
626 std::allocator_traits<decltype(alloc)>::destroy(alloc, string);
627 std::allocator_traits<decltype(alloc)>::deallocate(alloc, string, 1);
676 JSON_ASSERT(m_type != value_t::string || m_value.string != nullptr);
717 case value_t::string:
864 case value_t::string:
897 // element is a string
930 std::move(*((*element.m_value.array)[0].m_value.string)),
1041 case value_t::string:
1086 case value_t::string:
1088 m_value = *first.m_object->m_value.string;
1154 case value_t::string:
1156 m_value = *other.m_value.string;
1356 /// @brief return whether value is a string
1360 return m_type == value_t::string;
1426 /// get a pointer to the value (string)
1429 return is_string() ? m_value.string : nullptr;
1432 /// get a pointer to the value (string)
1435 return is_string() ? m_value.string : nullptr;
1583 associative containers such as `std::unordered_map<std::string\,
1848 ambiguities as these types implicitly convert to `std::string`.
1854 string is requested); see example below
1862 associative containers such as `std::unordered_map<std::string\,
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));
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));
2433 case value_t::string:
2444 std::allocator_traits<decltype(alloc)>::destroy(alloc, m_value.string);
2445 std::allocator_traits<decltype(alloc)>::deallocate(alloc, m_value.string, 1);
2446 m_value.string = nullptr;
2503 case value_t::string:
2515 std::allocator_traits<decltype(alloc)>::destroy(alloc, m_value.string);
2516 std::allocator_traits<decltype(alloc)>::deallocate(alloc, m_value.string, 1);
2517 m_value.string = nullptr;
2919 case value_t::string:
2958 case value_t::string:
2992 case value_t::string:
3047 case value_t::string:
3049 m_value.string->clear();
3521 swap(*(m_value.string), other);
3589 case value_t::string: \
3590 return (*lhs.m_value.string) op (*rhs.m_value.string); \
4148 /// @brief return the type as string
4161 case value_t::string:
4162 return "string";
4674 const auto get_op = [](const std::string & op)
4760 case value_t::string: // LCOV_EXCL_LINE
4811 const auto get_value = [&val](const std::string & op,
4812 const std::string & member,
4824 // NOLINTNEXTLINE(performance-inefficient-string-concatenation)
4828 // check if result is of type string
4831 // NOLINTNEXTLINE(performance-inefficient-string-concatenation)
4832 JSON_THROW(parse_error::create(105, 0, detail::concat(error_msg, " must have string member '", member, "'"), &val));
4846 const auto op = get_value("op", "op", true).template get<std::string>();
4847 const auto path = get_value(op, "path", true).template get<std::string>();
4873 const auto from_path = get_value("move", "from", true).template get<std::string>();
4890 const auto from_path = get_value("copy", "from", true).template get<std::string>();
4950 const std::string& path = "")
5060 case value_t::string:
5123 std::string to_string(const NLOHMANN_BASIC_JSON_TPL& j)
5133 /// @brief user-defined string literal for JSON values
5141 /// @brief user-defined string literal for JSON pointer
5146 return nlohmann::json::json_pointer(std::string(s, n));