_internal::Json => Json::_internal (#1834)
Co-authored-by: Anton Kolesnyk <antkmsft@users.noreply.github.com>
This commit is contained in:
parent
3d6cd38658
commit
2562df6682
@ -83,7 +83,7 @@ SOFTWARE.
|
||||
|
||||
#include <cstddef> // size_t
|
||||
|
||||
namespace Azure { namespace Core { namespace _internal { namespace Json { namespace detail {
|
||||
namespace Azure { namespace Core { namespace Json { namespace _internal { namespace detail {
|
||||
/// struct to capture the start position of the current token
|
||||
struct position_t
|
||||
{
|
||||
@ -98,7 +98,7 @@ namespace Azure { namespace Core { namespace _internal { namespace Json { namesp
|
||||
constexpr operator size_t() const { return chars_read_total; }
|
||||
};
|
||||
|
||||
}}}}} // namespace Azure::Core::_internal::Json::detail
|
||||
}}}}} // namespace Azure::Core::Json::_internal::detail
|
||||
|
||||
// #include <nlohmann/detail/macro_scope.hpp>
|
||||
|
||||
@ -2140,7 +2140,7 @@ _az_JSON_HEDLEY_DIAGNOSTIC_PUSH
|
||||
|
||||
namespace Azure
|
||||
{
|
||||
namespace Core { namespace _internal { namespace Json { namespace detail {
|
||||
namespace Core { namespace Json { namespace _internal { namespace detail {
|
||||
////////////////
|
||||
// exceptions //
|
||||
////////////////
|
||||
@ -2551,7 +2551,7 @@ _az_JSON_HEDLEY_DIAGNOSTIC_PUSH
|
||||
{
|
||||
}
|
||||
};
|
||||
}}}} // namespace Core::_internal::Json::detail
|
||||
}}}} // namespace Core::Json::_internal::detail
|
||||
} // namespace Azure
|
||||
|
||||
// #include <nlohmann/detail/macro_scope.hpp>
|
||||
@ -2563,7 +2563,7 @@ _az_JSON_HEDLEY_DIAGNOSTIC_PUSH
|
||||
|
||||
// #include <nlohmann/detail/boolean_operators.hpp>
|
||||
|
||||
namespace Azure { namespace Core { namespace _internal { namespace Json { namespace detail {
|
||||
namespace Azure { namespace Core { namespace Json { namespace _internal { namespace detail {
|
||||
// alias templates to reduce boilerplate
|
||||
template <bool B, typename T = void> using enable_if_t = typename std::enable_if<B, T>::type;
|
||||
|
||||
@ -2618,7 +2618,7 @@ namespace Azure { namespace Core { namespace _internal { namespace Json { namesp
|
||||
};
|
||||
|
||||
template <typename T> constexpr T static_const<T>::value;
|
||||
}}}}} // namespace Azure::Core::_internal::Json::detail
|
||||
}}}}} // namespace Azure::Core::Json::_internal::detail
|
||||
|
||||
// #include <nlohmann/detail/meta/type_traits.hpp>
|
||||
|
||||
@ -2634,17 +2634,17 @@ namespace Azure { namespace Core { namespace _internal { namespace Json { namesp
|
||||
|
||||
// #include <nlohmann/detail/meta/void_t.hpp>
|
||||
|
||||
namespace Azure { namespace Core { namespace _internal { namespace Json { namespace detail {
|
||||
namespace Azure { namespace Core { namespace Json { namespace _internal { namespace detail {
|
||||
template <typename... Ts> struct make_void
|
||||
{
|
||||
using type = void;
|
||||
};
|
||||
template <typename... Ts> using void_t = typename make_void<Ts...>::type;
|
||||
}}}}} // namespace Azure::Core::_internal::Json::detail
|
||||
}}}}} // namespace Azure::Core::Json::_internal::detail
|
||||
|
||||
// #include <nlohmann/detail/meta/cpp_future.hpp>
|
||||
|
||||
namespace Azure { namespace Core { namespace _internal { namespace Json { namespace detail {
|
||||
namespace Azure { namespace Core { namespace Json { namespace _internal { namespace detail {
|
||||
template <typename It, typename = void> struct iterator_types
|
||||
{
|
||||
};
|
||||
@ -2685,7 +2685,7 @@ namespace Azure { namespace Core { namespace _internal { namespace Json { namesp
|
||||
using pointer = T*;
|
||||
using reference = T&;
|
||||
};
|
||||
}}}}} // namespace Azure::Core::_internal::Json::detail
|
||||
}}}}} // namespace Azure::Core::Json::_internal::detail
|
||||
|
||||
// #include <nlohmann/detail/macro_scope.hpp>
|
||||
|
||||
@ -2698,7 +2698,7 @@ namespace Azure { namespace Core { namespace _internal { namespace Json { namesp
|
||||
// #include <nlohmann/detail/meta/void_t.hpp>
|
||||
|
||||
// https://en.cppreference.com/w/cpp/experimental/is_detected
|
||||
namespace Azure { namespace Core { namespace _internal { namespace Json { namespace detail {
|
||||
namespace Azure { namespace Core { namespace Json { namespace _internal { namespace detail {
|
||||
struct nonesuch
|
||||
{
|
||||
nonesuch() = delete;
|
||||
@ -2740,7 +2740,7 @@ namespace Azure { namespace Core { namespace _internal { namespace Json { namesp
|
||||
|
||||
template <class To, template <class...> class Op, class... Args>
|
||||
using is_detected_convertible = std::is_convertible<detected_t<Op, Args...>, To>;
|
||||
}}}}} // namespace Azure::Core::_internal::Json::detail
|
||||
}}}}} // namespace Azure::Core::Json::_internal::detail
|
||||
|
||||
#include <cstdint> // int64_t, uint64_t
|
||||
#include <map> // map
|
||||
@ -2753,7 +2753,7 @@ namespace Azure { namespace Core { namespace _internal { namespace Json { namesp
|
||||
@see https://github.com/nlohmann
|
||||
@since version 1.0.0
|
||||
*/
|
||||
namespace Azure { namespace Core { namespace _internal { namespace Json {
|
||||
namespace Azure { namespace Core { namespace Json { namespace _internal {
|
||||
/*!
|
||||
@brief default JSONSerializer template argument
|
||||
|
||||
@ -2798,9 +2798,9 @@ namespace Azure { namespace Core { namespace _internal { namespace Json {
|
||||
@since version 1.0.0
|
||||
*/
|
||||
using json = basic_json<>;
|
||||
}}}} // namespace Azure::Core::_internal::Json
|
||||
}}}} // namespace Azure::Core::Json::_internal
|
||||
|
||||
namespace Azure { namespace Core { namespace _internal { namespace Json {
|
||||
namespace Azure { namespace Core { namespace Json { namespace _internal {
|
||||
/*!
|
||||
@brief detail namespace with internal helper functions
|
||||
|
||||
@ -3216,7 +3216,7 @@ namespace Azure { namespace Core { namespace _internal { namespace Json {
|
||||
{
|
||||
};
|
||||
} // namespace detail
|
||||
}}}} // namespace Azure::Core::_internal::Json
|
||||
}}}} // namespace Azure::Core::Json::_internal
|
||||
|
||||
// #include <nlohmann/detail/value_t.hpp>
|
||||
|
||||
@ -3227,7 +3227,7 @@ namespace Azure { namespace Core { namespace _internal { namespace Json {
|
||||
|
||||
// #include <nlohmann/detail/boolean_operators.hpp>
|
||||
|
||||
namespace Azure { namespace Core { namespace _internal { namespace Json { namespace detail {
|
||||
namespace Azure { namespace Core { namespace Json { namespace _internal { namespace detail {
|
||||
///////////////////////////
|
||||
// JSON type enumeration //
|
||||
///////////////////////////
|
||||
@ -3301,9 +3301,9 @@ namespace Azure { namespace Core { namespace _internal { namespace Json { namesp
|
||||
const auto r_index = static_cast<std::size_t>(rhs);
|
||||
return l_index < order.size() && r_index < order.size() && order[l_index] < order[r_index];
|
||||
}
|
||||
}}}}} // namespace Azure::Core::_internal::Json::detail
|
||||
}}}}} // namespace Azure::Core::Json::_internal::detail
|
||||
|
||||
namespace Azure { namespace Core { namespace _internal { namespace Json {
|
||||
namespace Azure { namespace Core { namespace Json { namespace _internal {
|
||||
namespace detail {
|
||||
template <typename BasicJsonType>
|
||||
void from_json(const BasicJsonType& j, typename std::nullptr_t& n)
|
||||
@ -3725,7 +3725,7 @@ namespace Azure { namespace Core { namespace _internal { namespace Json {
|
||||
namespace {
|
||||
constexpr const auto& from_json = detail::static_const<detail::from_json_fn>::value;
|
||||
} // namespace
|
||||
}}}} // namespace Azure::Core::_internal::Json
|
||||
}}}} // namespace Azure::Core::Json::_internal
|
||||
|
||||
// #include <nlohmann/detail/conversions/to_json.hpp>
|
||||
|
||||
@ -3751,7 +3751,7 @@ namespace Azure { namespace Core { namespace _internal { namespace Json {
|
||||
|
||||
// #include <nlohmann/detail/value_t.hpp>
|
||||
|
||||
namespace Azure { namespace Core { namespace _internal { namespace Json { namespace detail {
|
||||
namespace Azure { namespace Core { namespace Json { namespace _internal { namespace detail {
|
||||
template <typename string_type> void int_to_string(string_type& target, std::size_t value)
|
||||
{
|
||||
target = std::to_string(value);
|
||||
@ -3856,7 +3856,7 @@ namespace Azure { namespace Core { namespace _internal { namespace Json { namesp
|
||||
// For further reference see https://blog.tartanllama.xyz/structured-bindings/
|
||||
// And see https://github.com/nlohmann/json/pull/1391
|
||||
template <std::size_t N, typename IteratorType, enable_if_t<N == 0, int> = 0>
|
||||
auto get(const Azure::Core::_internal::Json::detail::iteration_proxy_value<IteratorType>& i)
|
||||
auto get(const Azure::Core::Json::_internal::detail::iteration_proxy_value<IteratorType>& i)
|
||||
-> decltype(i.key())
|
||||
{
|
||||
return i.key();
|
||||
@ -3865,12 +3865,12 @@ namespace Azure { namespace Core { namespace _internal { namespace Json { namesp
|
||||
// For further reference see https://blog.tartanllama.xyz/structured-bindings/
|
||||
// And see https://github.com/nlohmann/json/pull/1391
|
||||
template <std::size_t N, typename IteratorType, enable_if_t<N == 1, int> = 0>
|
||||
auto get(const Azure::Core::_internal::Json::detail::iteration_proxy_value<IteratorType>& i)
|
||||
auto get(const Azure::Core::Json::_internal::detail::iteration_proxy_value<IteratorType>& i)
|
||||
-> decltype(i.value())
|
||||
{
|
||||
return i.value();
|
||||
}
|
||||
}}}}} // namespace Azure::Core::_internal::Json::detail
|
||||
}}}}} // namespace Azure::Core::Json::_internal::detail
|
||||
|
||||
// The Addition to the STD Namespace is required to add
|
||||
// Structured Bindings Support to the iteration_proxy_value class
|
||||
@ -3883,17 +3883,17 @@ namespace std {
|
||||
#pragma clang diagnostic ignored "-Wmismatched-tags"
|
||||
#endif
|
||||
template <typename IteratorType>
|
||||
class tuple_size<::Azure::Core::_internal::Json::detail::iteration_proxy_value<IteratorType>>
|
||||
class tuple_size<::Azure::Core::Json::_internal::detail::iteration_proxy_value<IteratorType>>
|
||||
: public std::integral_constant<std::size_t, 2> {
|
||||
};
|
||||
|
||||
template <std::size_t N, typename IteratorType>
|
||||
class tuple_element<
|
||||
N,
|
||||
::Azure::Core::_internal::Json::detail::iteration_proxy_value<IteratorType>> {
|
||||
::Azure::Core::Json::_internal::detail::iteration_proxy_value<IteratorType>> {
|
||||
public:
|
||||
using type = decltype(get<N>(
|
||||
std::declval<::Azure::Core::_internal::Json::detail::iteration_proxy_value<IteratorType>>()));
|
||||
std::declval<::Azure::Core::Json::_internal::detail::iteration_proxy_value<IteratorType>>()));
|
||||
};
|
||||
#if defined(__clang__)
|
||||
#pragma clang diagnostic pop
|
||||
@ -3906,7 +3906,7 @@ public:
|
||||
|
||||
// #include <nlohmann/detail/value_t.hpp>
|
||||
|
||||
namespace Azure { namespace Core { namespace _internal { namespace Json {
|
||||
namespace Azure { namespace Core { namespace Json { namespace _internal {
|
||||
namespace detail {
|
||||
//////////////////
|
||||
// constructors //
|
||||
@ -4317,9 +4317,9 @@ namespace Azure { namespace Core { namespace _internal { namespace Json {
|
||||
namespace {
|
||||
constexpr const auto& to_json = detail::static_const<detail::to_json_fn>::value;
|
||||
} // namespace
|
||||
}}}} // namespace Azure::Core::_internal::Json
|
||||
}}}} // namespace Azure::Core::Json::_internal
|
||||
|
||||
namespace Azure { namespace Core { namespace _internal { namespace Json {
|
||||
namespace Azure { namespace Core { namespace Json { namespace _internal {
|
||||
|
||||
template <typename, typename> struct adl_serializer
|
||||
{
|
||||
@ -4334,12 +4334,12 @@ namespace Azure { namespace Core { namespace _internal { namespace Json {
|
||||
*/
|
||||
template <typename BasicJsonType, typename ValueType>
|
||||
static auto from_json(BasicJsonType&& j, ValueType& val) noexcept(
|
||||
noexcept(::Azure::Core::_internal::Json::from_json(std::forward<BasicJsonType>(j), val)))
|
||||
noexcept(::Azure::Core::Json::_internal::from_json(std::forward<BasicJsonType>(j), val)))
|
||||
-> decltype(
|
||||
::Azure::Core::_internal::Json::from_json(std::forward<BasicJsonType>(j), val),
|
||||
::Azure::Core::Json::_internal::from_json(std::forward<BasicJsonType>(j), val),
|
||||
void())
|
||||
{
|
||||
::Azure::Core::_internal::Json::from_json(std::forward<BasicJsonType>(j), val);
|
||||
::Azure::Core::Json::_internal::from_json(std::forward<BasicJsonType>(j), val);
|
||||
}
|
||||
|
||||
/*!
|
||||
@ -4353,16 +4353,16 @@ namespace Azure { namespace Core { namespace _internal { namespace Json {
|
||||
*/
|
||||
template <typename BasicJsonType, typename ValueType>
|
||||
static auto to_json(BasicJsonType& j, ValueType&& val) noexcept(
|
||||
noexcept(::Azure::Core::_internal::Json::to_json(j, std::forward<ValueType>(val))))
|
||||
noexcept(::Azure::Core::Json::_internal::to_json(j, std::forward<ValueType>(val))))
|
||||
-> decltype(
|
||||
::Azure::Core::_internal::Json::to_json(j, std::forward<ValueType>(val)),
|
||||
::Azure::Core::Json::_internal::to_json(j, std::forward<ValueType>(val)),
|
||||
void())
|
||||
{
|
||||
::Azure::Core::_internal::Json::to_json(j, std::forward<ValueType>(val));
|
||||
::Azure::Core::Json::_internal::to_json(j, std::forward<ValueType>(val));
|
||||
}
|
||||
};
|
||||
|
||||
}}}} // namespace Azure::Core::_internal::Json
|
||||
}}}} // namespace Azure::Core::Json::_internal
|
||||
|
||||
// #include <nlohmann/byte_container_with_subtype.hpp>
|
||||
|
||||
@ -4370,7 +4370,7 @@ namespace Azure { namespace Core { namespace _internal { namespace Json {
|
||||
#include <tuple> // tie
|
||||
#include <utility> // move
|
||||
|
||||
namespace Azure { namespace Core { namespace _internal { namespace Json {
|
||||
namespace Azure { namespace Core { namespace Json { namespace _internal {
|
||||
|
||||
/*!
|
||||
@brief an internal type for a backed binary type
|
||||
@ -4517,7 +4517,7 @@ namespace Azure { namespace Core { namespace _internal { namespace Json {
|
||||
bool m_has_subtype = false;
|
||||
};
|
||||
|
||||
}}}} // namespace Azure::Core::_internal::Json
|
||||
}}}} // namespace Azure::Core::Json::_internal
|
||||
|
||||
// #include <nlohmann/detail/boolean_operators.hpp>
|
||||
|
||||
@ -4563,7 +4563,7 @@ namespace Azure { namespace Core { namespace _internal { namespace Json {
|
||||
|
||||
// #include <nlohmann/detail/macro_scope.hpp>
|
||||
|
||||
namespace Azure { namespace Core { namespace _internal { namespace Json { namespace detail {
|
||||
namespace Azure { namespace Core { namespace Json { namespace _internal { namespace detail {
|
||||
/// the supported input formats
|
||||
enum class input_format_t
|
||||
{
|
||||
@ -5006,7 +5006,7 @@ namespace Azure { namespace Core { namespace _internal { namespace Json { namesp
|
||||
private:
|
||||
contiguous_bytes_input_adapter ia;
|
||||
};
|
||||
}}}}} // namespace Azure::Core::_internal::Json::detail
|
||||
}}}}} // namespace Azure::Core::Json::_internal::detail
|
||||
|
||||
// #include <nlohmann/detail/input/json_sax.hpp>
|
||||
|
||||
@ -5020,12 +5020,12 @@ namespace Azure { namespace Core { namespace _internal { namespace Json { namesp
|
||||
|
||||
// #include <nlohmann/detail/macro_scope.hpp>
|
||||
|
||||
namespace Azure { namespace Core { namespace _internal { namespace Json {
|
||||
namespace Azure { namespace Core { namespace Json { namespace _internal {
|
||||
|
||||
/*!
|
||||
@brief SAX interface
|
||||
|
||||
This class describes the SAX interface used by @ref Azure::Core::_internal::Json::json::sax_parse.
|
||||
This class describes the SAX interface used by @ref Azure::Core::Json::_internal::json::sax_parse.
|
||||
Each function is called in different situations while the input is parsed. The
|
||||
boolean return value informs the parser whether to continue processing the
|
||||
input.
|
||||
@ -5704,7 +5704,7 @@ namespace Azure { namespace Core { namespace _internal { namespace Json {
|
||||
};
|
||||
} // namespace detail
|
||||
|
||||
}}}} // namespace Azure::Core::_internal::Json
|
||||
}}}} // namespace Azure::Core::Json::_internal
|
||||
|
||||
// #include <nlohmann/detail/macro_scope.hpp>
|
||||
|
||||
@ -5718,7 +5718,7 @@ namespace Azure { namespace Core { namespace _internal { namespace Json {
|
||||
|
||||
// #include <nlohmann/detail/meta/type_traits.hpp>
|
||||
|
||||
namespace Azure { namespace Core { namespace _internal { namespace Json { namespace detail {
|
||||
namespace Azure { namespace Core { namespace Json { namespace _internal { namespace detail {
|
||||
template <typename T> using null_function_t = decltype(std::declval<T&>().null());
|
||||
|
||||
template <typename T>
|
||||
@ -5843,11 +5843,11 @@ namespace Azure { namespace Core { namespace _internal { namespace Json { namesp
|
||||
"Missing/invalid function: bool parse_error(std::size_t, const "
|
||||
"std::string&, const exception&)");
|
||||
};
|
||||
}}}}} // namespace Azure::Core::_internal::Json::detail
|
||||
}}}}} // namespace Azure::Core::Json::_internal::detail
|
||||
|
||||
// #include <nlohmann/detail/value_t.hpp>
|
||||
|
||||
namespace Azure { namespace Core { namespace _internal { namespace Json { namespace detail {
|
||||
namespace Azure { namespace Core { namespace Json { namespace _internal { namespace detail {
|
||||
|
||||
/*!
|
||||
@brief determine system byte order
|
||||
@ -8278,7 +8278,7 @@ namespace Azure { namespace Core { namespace _internal { namespace Json { namesp
|
||||
/// the SAX parser
|
||||
json_sax_t* sax = nullptr;
|
||||
};
|
||||
}}}}} // namespace Azure::Core::_internal::Json::detail
|
||||
}}}}} // namespace Azure::Core::Json::_internal::detail
|
||||
|
||||
// #include <nlohmann/detail/input/input_adapters.hpp>
|
||||
|
||||
@ -8300,7 +8300,7 @@ namespace Azure { namespace Core { namespace _internal { namespace Json { namesp
|
||||
|
||||
// #include <nlohmann/detail/macro_scope.hpp>
|
||||
|
||||
namespace Azure { namespace Core { namespace _internal { namespace Json { namespace detail {
|
||||
namespace Azure { namespace Core { namespace Json { namespace _internal { namespace detail {
|
||||
///////////
|
||||
// lexer //
|
||||
///////////
|
||||
@ -9769,7 +9769,7 @@ namespace Azure { namespace Core { namespace _internal { namespace Json { namesp
|
||||
/// the decimal point
|
||||
const char_int_type decimal_point_char = '.';
|
||||
};
|
||||
}}}}} // namespace Azure::Core::_internal::Json::detail
|
||||
}}}}} // namespace Azure::Core::Json::_internal::detail
|
||||
|
||||
// #include <nlohmann/detail/input/parser.hpp>
|
||||
|
||||
@ -9795,7 +9795,7 @@ namespace Azure { namespace Core { namespace _internal { namespace Json { namesp
|
||||
|
||||
// #include <nlohmann/detail/value_t.hpp>
|
||||
|
||||
namespace Azure { namespace Core { namespace _internal { namespace Json { namespace detail {
|
||||
namespace Azure { namespace Core { namespace Json { namespace _internal { namespace detail {
|
||||
////////////
|
||||
// parser //
|
||||
////////////
|
||||
@ -10285,7 +10285,7 @@ namespace Azure { namespace Core { namespace _internal { namespace Json { namesp
|
||||
/// whether to throw exceptions in case of errors
|
||||
const bool allow_exceptions = true;
|
||||
};
|
||||
}}}}} // namespace Azure::Core::_internal::Json::detail
|
||||
}}}}} // namespace Azure::Core::Json::_internal::detail
|
||||
|
||||
// #include <nlohmann/detail/iterators/internal_iterator.hpp>
|
||||
|
||||
@ -10294,7 +10294,7 @@ namespace Azure { namespace Core { namespace _internal { namespace Json { namesp
|
||||
#include <cstddef> // ptrdiff_t
|
||||
#include <limits> // numeric_limits
|
||||
|
||||
namespace Azure { namespace Core { namespace _internal { namespace Json { namespace detail {
|
||||
namespace Azure { namespace Core { namespace Json { namespace _internal { namespace detail {
|
||||
/*
|
||||
@brief an iterator for primitive JSON types
|
||||
|
||||
@ -10390,9 +10390,9 @@ namespace Azure { namespace Core { namespace _internal { namespace Json { namesp
|
||||
return *this;
|
||||
}
|
||||
};
|
||||
}}}}} // namespace Azure::Core::_internal::Json::detail
|
||||
}}}}} // namespace Azure::Core::Json::_internal::detail
|
||||
|
||||
namespace Azure { namespace Core { namespace _internal { namespace Json { namespace detail {
|
||||
namespace Azure { namespace Core { namespace Json { namespace _internal { namespace detail {
|
||||
/*!
|
||||
@brief an iterator value
|
||||
|
||||
@ -10410,7 +10410,7 @@ namespace Azure { namespace Core { namespace _internal { namespace Json { namesp
|
||||
/// generic iterator for all other types
|
||||
primitive_iterator_t primitive_iterator{};
|
||||
};
|
||||
}}}}} // namespace Azure::Core::_internal::Json::detail
|
||||
}}}}} // namespace Azure::Core::Json::_internal::detail
|
||||
|
||||
// #include <nlohmann/detail/iterators/iter_impl.hpp>
|
||||
|
||||
@ -10433,7 +10433,7 @@ namespace Azure { namespace Core { namespace _internal { namespace Json { namesp
|
||||
|
||||
// #include <nlohmann/detail/value_t.hpp>
|
||||
|
||||
namespace Azure { namespace Core { namespace _internal { namespace Json { namespace detail {
|
||||
namespace Azure { namespace Core { namespace Json { namespace _internal { namespace detail {
|
||||
// forward declare, to be able to friend it later on
|
||||
template <typename IteratorType> class iteration_proxy;
|
||||
template <typename IteratorType> class iteration_proxy_value;
|
||||
@ -11017,7 +11017,7 @@ namespace Azure { namespace Core { namespace _internal { namespace Json { namesp
|
||||
/// the actual iterator of the associated instance
|
||||
internal_iterator<typename std::remove_const<BasicJsonType>::type> m_it{};
|
||||
};
|
||||
}}}}} // namespace Azure::Core::_internal::Json::detail
|
||||
}}}}} // namespace Azure::Core::Json::_internal::detail
|
||||
|
||||
// #include <nlohmann/detail/iterators/iteration_proxy.hpp>
|
||||
|
||||
@ -11027,7 +11027,7 @@ namespace Azure { namespace Core { namespace _internal { namespace Json { namesp
|
||||
#include <iterator> // reverse_iterator
|
||||
#include <utility> // declval
|
||||
|
||||
namespace Azure { namespace Core { namespace _internal { namespace Json { namespace detail {
|
||||
namespace Azure { namespace Core { namespace Json { namespace _internal { namespace detail {
|
||||
//////////////////////
|
||||
// reverse_iterator //
|
||||
//////////////////////
|
||||
@ -11132,7 +11132,7 @@ namespace Azure { namespace Core { namespace _internal { namespace Json { namesp
|
||||
return it.operator*();
|
||||
}
|
||||
};
|
||||
}}}}} // namespace Azure::Core::_internal::Json::detail
|
||||
}}}}} // namespace Azure::Core::Json::_internal::detail
|
||||
|
||||
// #include <nlohmann/detail/iterators/primitive_iterator.hpp>
|
||||
|
||||
@ -11152,7 +11152,7 @@ namespace Azure { namespace Core { namespace _internal { namespace Json { namesp
|
||||
|
||||
// #include <nlohmann/detail/value_t.hpp>
|
||||
|
||||
namespace Azure { namespace Core { namespace _internal { namespace Json {
|
||||
namespace Azure { namespace Core { namespace Json { namespace _internal {
|
||||
template <typename BasicJsonType> class json_pointer {
|
||||
// allow basic_json to access private members
|
||||
_az_NLOHMANN_BASIC_JSON_TPL_DECLARATION friend class basic_json;
|
||||
@ -12073,7 +12073,7 @@ namespace Azure { namespace Core { namespace _internal { namespace Json {
|
||||
/// the reference tokens
|
||||
std::vector<std::string> reference_tokens;
|
||||
};
|
||||
}}}} // namespace Azure::Core::_internal::Json
|
||||
}}}} // namespace Azure::Core::Json::_internal
|
||||
|
||||
// #include <nlohmann/detail/json_ref.hpp>
|
||||
|
||||
@ -12082,7 +12082,7 @@ namespace Azure { namespace Core { namespace _internal { namespace Json {
|
||||
|
||||
// #include <nlohmann/detail/meta/type_traits.hpp>
|
||||
|
||||
namespace Azure { namespace Core { namespace _internal { namespace Json { namespace detail {
|
||||
namespace Azure { namespace Core { namespace Json { namespace _internal { namespace detail {
|
||||
template <typename BasicJsonType> class json_ref {
|
||||
public:
|
||||
using value_type = BasicJsonType;
|
||||
@ -12134,7 +12134,7 @@ namespace Azure { namespace Core { namespace _internal { namespace Json { namesp
|
||||
value_type* value_ref = nullptr;
|
||||
const bool is_rvalue;
|
||||
};
|
||||
}}}}} // namespace Azure::Core::_internal::Json::detail
|
||||
}}}}} // namespace Azure::Core::Json::_internal::detail
|
||||
|
||||
// #include <nlohmann/detail/macro_scope.hpp>
|
||||
|
||||
@ -12168,7 +12168,7 @@ namespace Azure { namespace Core { namespace _internal { namespace Json { namesp
|
||||
#include <vector> // vector
|
||||
// #include <nlohmann/detail/macro_scope.hpp>
|
||||
|
||||
namespace Azure { namespace Core { namespace _internal { namespace Json { namespace detail {
|
||||
namespace Azure { namespace Core { namespace Json { namespace _internal { namespace detail {
|
||||
/// abstract output adapter interface
|
||||
template <typename CharType> struct output_adapter_protocol
|
||||
{
|
||||
@ -12258,9 +12258,9 @@ namespace Azure { namespace Core { namespace _internal { namespace Json { namesp
|
||||
private:
|
||||
output_adapter_t<CharType> oa = nullptr;
|
||||
};
|
||||
}}}}} // namespace Azure::Core::_internal::Json::detail
|
||||
}}}}} // namespace Azure::Core::Json::_internal::detail
|
||||
|
||||
namespace Azure { namespace Core { namespace _internal { namespace Json { namespace detail {
|
||||
namespace Azure { namespace Core { namespace Json { namespace _internal { namespace detail {
|
||||
///////////////////
|
||||
// binary writer //
|
||||
///////////////////
|
||||
@ -13801,7 +13801,7 @@ namespace Azure { namespace Core { namespace _internal { namespace Json { namesp
|
||||
/// the output
|
||||
output_adapter_t<CharType> oa = nullptr;
|
||||
};
|
||||
}}}}} // namespace Azure::Core::_internal::Json::detail
|
||||
}}}}} // namespace Azure::Core::Json::_internal::detail
|
||||
|
||||
// #include <nlohmann/detail/output/output_adapters.hpp>
|
||||
|
||||
@ -13836,7 +13836,7 @@ namespace Azure { namespace Core { namespace _internal { namespace Json { namesp
|
||||
|
||||
// #include <nlohmann/detail/macro_scope.hpp>
|
||||
|
||||
namespace Azure { namespace Core { namespace _internal { namespace Json { namespace detail {
|
||||
namespace Azure { namespace Core { namespace Json { namespace _internal { namespace detail {
|
||||
|
||||
/*!
|
||||
@brief implements the Grisu2 algorithm for binary to decimal floating-point
|
||||
@ -14903,7 +14903,7 @@ namespace Azure { namespace Core { namespace _internal { namespace Json { namesp
|
||||
return dtoa_impl::format_buffer(first, len, decimal_exponent, kMinExp, kMaxExp);
|
||||
}
|
||||
|
||||
}}}}} // namespace Azure::Core::_internal::Json::detail
|
||||
}}}}} // namespace Azure::Core::Json::_internal::detail
|
||||
|
||||
// #include <nlohmann/detail/exceptions.hpp>
|
||||
|
||||
@ -14917,7 +14917,7 @@ namespace Azure { namespace Core { namespace _internal { namespace Json { namesp
|
||||
|
||||
// #include <nlohmann/detail/value_t.hpp>
|
||||
|
||||
namespace Azure { namespace Core { namespace _internal { namespace Json { namespace detail {
|
||||
namespace Azure { namespace Core { namespace Json { namespace _internal { namespace detail {
|
||||
///////////////////
|
||||
// serialization //
|
||||
///////////////////
|
||||
@ -15677,7 +15677,7 @@ namespace Azure { namespace Core { namespace _internal { namespace Json { namesp
|
||||
void dump_float(number_float_t x, std::true_type /*is_ieee_single_or_double*/)
|
||||
{
|
||||
char* begin = number_buffer.data();
|
||||
char* end = ::Azure::Core::_internal::Json::detail::to_chars(
|
||||
char* end = ::Azure::Core::Json::_internal::detail::to_chars(
|
||||
begin, begin + number_buffer.size(), x);
|
||||
|
||||
o->write_characters(begin, static_cast<size_t>(end - begin));
|
||||
@ -15846,7 +15846,7 @@ namespace Azure { namespace Core { namespace _internal { namespace Json { namesp
|
||||
/// error_handler how to react on decoding errors
|
||||
const error_handler_t error_handler;
|
||||
};
|
||||
}}}}} // namespace Azure::Core::_internal::Json::detail
|
||||
}}}}} // namespace Azure::Core::Json::_internal::detail
|
||||
|
||||
// #include <nlohmann/detail/value_t.hpp>
|
||||
|
||||
@ -15857,7 +15857,7 @@ namespace Azure { namespace Core { namespace _internal { namespace Json { namesp
|
||||
@see https://github.com/nlohmann
|
||||
@since version 1.0.0
|
||||
*/
|
||||
namespace Azure { namespace Core { namespace _internal { namespace Json {
|
||||
namespace Azure { namespace Core { namespace Json { namespace _internal {
|
||||
|
||||
/*!
|
||||
@brief a class to store JSON values
|
||||
@ -15946,66 +15946,66 @@ namespace Azure { namespace Core { namespace _internal { namespace Json {
|
||||
_az_NLOHMANN_BASIC_JSON_TPL_DECLARATION class basic_json {
|
||||
private:
|
||||
template <detail::value_t> friend struct detail::external_constructor;
|
||||
friend ::Azure::Core::_internal::Json::json_pointer<basic_json>;
|
||||
friend ::Azure::Core::Json::_internal::json_pointer<basic_json>;
|
||||
|
||||
template <typename BasicJsonType, typename InputType>
|
||||
friend class ::Azure::Core::_internal::Json::detail::parser;
|
||||
friend ::Azure::Core::_internal::Json::detail::serializer<basic_json>;
|
||||
friend class ::Azure::Core::Json::_internal::detail::parser;
|
||||
friend ::Azure::Core::Json::_internal::detail::serializer<basic_json>;
|
||||
template <typename BasicJsonType>
|
||||
friend class ::Azure::Core::_internal::Json::detail::iter_impl;
|
||||
friend class ::Azure::Core::Json::_internal::detail::iter_impl;
|
||||
template <typename BasicJsonType, typename CharType>
|
||||
friend class ::Azure::Core::_internal::Json::detail::binary_writer;
|
||||
friend class ::Azure::Core::Json::_internal::detail::binary_writer;
|
||||
template <typename BasicJsonType, typename InputType, typename SAX>
|
||||
friend class ::Azure::Core::_internal::Json::detail::binary_reader;
|
||||
friend class ::Azure::Core::Json::_internal::detail::binary_reader;
|
||||
template <typename BasicJsonType>
|
||||
friend class ::Azure::Core::_internal::Json::detail::json_sax_dom_parser;
|
||||
friend class ::Azure::Core::Json::_internal::detail::json_sax_dom_parser;
|
||||
template <typename BasicJsonType>
|
||||
friend class ::Azure::Core::_internal::Json::detail::json_sax_dom_callback_parser;
|
||||
friend class ::Azure::Core::Json::_internal::detail::json_sax_dom_callback_parser;
|
||||
|
||||
/// workaround type for MSVC
|
||||
using basic_json_t = _az_NLOHMANN_BASIC_JSON_TPL;
|
||||
|
||||
// convenience aliases for types residing in namespace detail;
|
||||
using lexer = ::Azure::Core::_internal::Json::detail::lexer_base<basic_json>;
|
||||
using lexer = ::Azure::Core::Json::_internal::detail::lexer_base<basic_json>;
|
||||
|
||||
template <typename InputAdapterType>
|
||||
static ::Azure::Core::_internal::Json::detail::parser<basic_json, InputAdapterType> parser(
|
||||
static ::Azure::Core::Json::_internal::detail::parser<basic_json, InputAdapterType> parser(
|
||||
InputAdapterType adapter,
|
||||
detail::parser_callback_t<basic_json> cb = nullptr,
|
||||
bool allow_exceptions = true)
|
||||
{
|
||||
return ::Azure::Core::_internal::Json::detail::parser<basic_json, InputAdapterType>(
|
||||
return ::Azure::Core::Json::_internal::detail::parser<basic_json, InputAdapterType>(
|
||||
std::move(adapter), std::move(cb), allow_exceptions);
|
||||
}
|
||||
|
||||
using primitive_iterator_t = ::Azure::Core::_internal::Json::detail::primitive_iterator_t;
|
||||
using primitive_iterator_t = ::Azure::Core::Json::_internal::detail::primitive_iterator_t;
|
||||
template <typename BasicJsonType>
|
||||
using internal_iterator
|
||||
= ::Azure::Core::_internal::Json::detail::internal_iterator<BasicJsonType>;
|
||||
= ::Azure::Core::Json::_internal::detail::internal_iterator<BasicJsonType>;
|
||||
template <typename BasicJsonType>
|
||||
using iter_impl = ::Azure::Core::_internal::Json::detail::iter_impl<BasicJsonType>;
|
||||
using iter_impl = ::Azure::Core::Json::_internal::detail::iter_impl<BasicJsonType>;
|
||||
template <typename Iterator>
|
||||
using iteration_proxy = ::Azure::Core::_internal::Json::detail::iteration_proxy<Iterator>;
|
||||
using iteration_proxy = ::Azure::Core::Json::_internal::detail::iteration_proxy<Iterator>;
|
||||
template <typename Base>
|
||||
using json_reverse_iterator
|
||||
= ::Azure::Core::_internal::Json::detail::json_reverse_iterator<Base>;
|
||||
= ::Azure::Core::Json::_internal::detail::json_reverse_iterator<Base>;
|
||||
|
||||
template <typename CharType>
|
||||
using output_adapter_t = ::Azure::Core::_internal::Json::detail::output_adapter_t<CharType>;
|
||||
using output_adapter_t = ::Azure::Core::Json::_internal::detail::output_adapter_t<CharType>;
|
||||
|
||||
template <typename InputType>
|
||||
using binary_reader
|
||||
= ::Azure::Core::_internal::Json::detail::binary_reader<basic_json, InputType>;
|
||||
= ::Azure::Core::Json::_internal::detail::binary_reader<basic_json, InputType>;
|
||||
template <typename CharType>
|
||||
using binary_writer
|
||||
= ::Azure::Core::_internal::Json::detail::binary_writer<basic_json, CharType>;
|
||||
= ::Azure::Core::Json::_internal::detail::binary_writer<basic_json, CharType>;
|
||||
|
||||
using serializer = ::Azure::Core::_internal::Json::detail::serializer<basic_json>;
|
||||
using serializer = ::Azure::Core::Json::_internal::detail::serializer<basic_json>;
|
||||
|
||||
public:
|
||||
using value_t = detail::value_t;
|
||||
/// JSON Pointer, see @ref nlohmann::json_pointer
|
||||
using json_pointer = ::Azure::Core::_internal::Json::json_pointer<basic_json>;
|
||||
using json_pointer = ::Azure::Core::Json::_internal::json_pointer<basic_json>;
|
||||
template <typename T, typename SFINAE> using json_serializer = JSONSerializer<T, SFINAE>;
|
||||
/// how to treat decoding errors
|
||||
using error_handler_t = detail::error_handler_t;
|
||||
@ -16013,7 +16013,7 @@ namespace Azure { namespace Core { namespace _internal { namespace Json {
|
||||
using initializer_list_t = std::initializer_list<detail::json_ref<basic_json>>;
|
||||
|
||||
using input_format_t = detail::input_format_t;
|
||||
/// SAX interface type, see @ref Azure::Core::_internal::Json::json_sax
|
||||
/// SAX interface type, see @ref Azure::Core::Json::_internal::json_sax
|
||||
using json_sax_t = json_sax<basic_json>;
|
||||
|
||||
////////////////
|
||||
@ -16684,7 +16684,7 @@ namespace Azure { namespace Core { namespace _internal { namespace Json {
|
||||
|
||||
@since version 3.8.0
|
||||
*/
|
||||
using binary_t = Azure::Core::_internal::Json::byte_container_with_subtype<BinaryType>;
|
||||
using binary_t = Azure::Core::Json::_internal::byte_container_with_subtype<BinaryType>;
|
||||
/// @}
|
||||
|
||||
private:
|
||||
@ -24344,7 +24344,7 @@ namespace Azure { namespace Core { namespace _internal { namespace Json {
|
||||
{
|
||||
return j.dump();
|
||||
}
|
||||
}}}} // namespace Azure::Core::_internal::Json
|
||||
}}}} // namespace Azure::Core::Json::_internal
|
||||
|
||||
///////////////////////
|
||||
// nonmember support //
|
||||
@ -24354,17 +24354,17 @@ namespace Azure { namespace Core { namespace _internal { namespace Json {
|
||||
namespace std {
|
||||
|
||||
/// hash value for JSON objects
|
||||
template <> struct hash<Azure::Core::_internal::Json::json>
|
||||
template <> struct hash<Azure::Core::Json::_internal::json>
|
||||
{
|
||||
/*!
|
||||
@brief return a hash value for a JSON object
|
||||
|
||||
@since version 1.0.0
|
||||
*/
|
||||
std::size_t operator()(const Azure::Core::_internal::Json::json& j) const
|
||||
std::size_t operator()(const Azure::Core::Json::_internal::json& j) const
|
||||
{
|
||||
// a naive hashing via the string representation
|
||||
const auto& h = hash<Azure::Core::_internal::Json::json::string_t>();
|
||||
const auto& h = hash<Azure::Core::Json::_internal::json::string_t>();
|
||||
return h(j.dump());
|
||||
}
|
||||
};
|
||||
@ -24372,17 +24372,17 @@ template <> struct hash<Azure::Core::_internal::Json::json>
|
||||
/// specialization for std::less<value_t>
|
||||
/// @note: do not remove the space after '<',
|
||||
/// see https://github.com/nlohmann/json/pull/679
|
||||
template <> struct less<::Azure::Core::_internal::Json::detail::value_t>
|
||||
template <> struct less<::Azure::Core::Json::_internal::detail::value_t>
|
||||
{
|
||||
/*!
|
||||
@brief compare two value_t enum values
|
||||
@since version 3.0.0
|
||||
*/
|
||||
bool operator()(
|
||||
Azure::Core::_internal::Json::detail::value_t lhs,
|
||||
Azure::Core::_internal::Json::detail::value_t rhs) const noexcept
|
||||
Azure::Core::Json::_internal::detail::value_t lhs,
|
||||
Azure::Core::Json::_internal::detail::value_t rhs) const noexcept
|
||||
{
|
||||
return Azure::Core::_internal::Json::detail::operator<(lhs, rhs);
|
||||
return Azure::Core::Json::_internal::detail::operator<(lhs, rhs);
|
||||
}
|
||||
};
|
||||
|
||||
@ -24392,11 +24392,11 @@ template <> struct less<::Azure::Core::_internal::Json::detail::value_t>
|
||||
@since version 1.0.0
|
||||
*/
|
||||
template <>
|
||||
inline void swap<Azure::Core::_internal::Json::json>(
|
||||
Azure::Core::_internal::Json::json& j1,
|
||||
Azure::Core::_internal::Json::json&
|
||||
j2) noexcept(is_nothrow_move_constructible<Azure::Core::_internal::Json::json>::value&&
|
||||
is_nothrow_move_assignable<Azure::Core::_internal::Json::json>::value)
|
||||
inline void swap<Azure::Core::Json::_internal::json>(
|
||||
Azure::Core::Json::_internal::json& j1,
|
||||
Azure::Core::Json::_internal::json&
|
||||
j2) noexcept(is_nothrow_move_constructible<Azure::Core::Json::_internal::json>::value&&
|
||||
is_nothrow_move_assignable<Azure::Core::Json::_internal::json>::value)
|
||||
{
|
||||
j1.swap(j2);
|
||||
}
|
||||
@ -24417,9 +24417,9 @@ if no parse error occurred.
|
||||
@since version 1.0.0
|
||||
*/
|
||||
// _az_JSON_HEDLEY_NON_NULL(1)
|
||||
// inline Azure::Core::_internal::Json::json operator"" _json(const char* s, std::size_t n)
|
||||
// inline Azure::Core::Json::_internal::json operator"" _json(const char* s, std::size_t n)
|
||||
// {
|
||||
// return Azure::Core::_internal::Json::json::parse(s, s + n);
|
||||
// return Azure::Core::Json::_internal::json::parse(s, s + n);
|
||||
// }
|
||||
|
||||
/*!
|
||||
@ -24436,11 +24436,11 @@ object if no parse error occurred.
|
||||
@since version 2.0.0
|
||||
*/
|
||||
// _az_JSON_HEDLEY_NON_NULL(1)
|
||||
// inline Azure::Core::_internal::Json::json::json_pointer operator"" _json_pointer(
|
||||
// inline Azure::Core::Json::_internal::json::json_pointer operator"" _json_pointer(
|
||||
// const char* s,
|
||||
// std::size_t n)
|
||||
// {
|
||||
// return Azure::Core::_internal::Json::json::json_pointer(std::string(s, n));
|
||||
// return Azure::Core::Json::_internal::json::json_pointer(std::string(s, n));
|
||||
// }
|
||||
|
||||
// #include <nlohmann/detail/macro_unscope.hpp>
|
||||
|
||||
@ -11,7 +11,7 @@
|
||||
|
||||
#include <string>
|
||||
|
||||
namespace Azure { namespace Core { namespace _internal { namespace Json {
|
||||
namespace Azure { namespace Core { namespace Json { namespace _internal {
|
||||
|
||||
/**
|
||||
* @brief Interface for json-serializable components.
|
||||
@ -27,4 +27,4 @@ namespace Azure { namespace Core { namespace _internal { namespace Json {
|
||||
virtual std::string Serialize() const = 0;
|
||||
};
|
||||
|
||||
}}}} // namespace Azure::Core::_internal::Json
|
||||
}}}} // namespace Azure::Core::Json::_internal
|
||||
|
||||
@ -30,7 +30,7 @@ SOFTWARE.
|
||||
#include "doctest_compatibility.h"
|
||||
|
||||
#include <azure/core/internal/json.hpp>
|
||||
using Azure::Core::_internal::Json::json;
|
||||
using Azure::Core::Json::_internal::json;
|
||||
|
||||
TEST_CASE("algorithms")
|
||||
{
|
||||
|
||||
@ -31,7 +31,7 @@ SOFTWARE.
|
||||
|
||||
#define private public
|
||||
#include <azure/core/internal/json.hpp>
|
||||
using Azure::Core::_internal::Json::json;
|
||||
using Azure::Core::Json::_internal::json;
|
||||
#undef private
|
||||
|
||||
namespace {
|
||||
@ -47,7 +47,7 @@ TEST_CASE("bad_alloc")
|
||||
SECTION("bad_alloc")
|
||||
{
|
||||
// create JSON type using the throwing allocator
|
||||
using bad_json = Azure::Core::_internal::Json::basic_json<
|
||||
using bad_json = Azure::Core::Json::_internal::basic_json<
|
||||
std::map,
|
||||
std::vector,
|
||||
std::string,
|
||||
@ -129,7 +129,7 @@ template <class T> void my_allocator_clean_up(T* p)
|
||||
TEST_CASE("controlled bad_alloc")
|
||||
{
|
||||
// create JSON type using the throwing allocator
|
||||
using my_json = Azure::Core::_internal::Json::basic_json<
|
||||
using my_json = Azure::Core::Json::_internal::basic_json<
|
||||
std::map,
|
||||
std::vector,
|
||||
std::string,
|
||||
@ -251,7 +251,7 @@ TEST_CASE("bad my_allocator::construct")
|
||||
{
|
||||
SECTION("my_allocator::construct doesn't forward")
|
||||
{
|
||||
using bad_alloc_json = Azure::Core::_internal::Json::basic_json<
|
||||
using bad_alloc_json = Azure::Core::Json::_internal::basic_json<
|
||||
std::map,
|
||||
std::vector,
|
||||
std::string,
|
||||
|
||||
@ -103,7 +103,7 @@ void int_to_string(alt_string& target, std::size_t value)
|
||||
target = std::to_string(value).c_str();
|
||||
}
|
||||
|
||||
using alt_json = Azure::Core::_internal::Json::basic_json<
|
||||
using alt_json = Azure::Core::Json::_internal::basic_json<
|
||||
std::map,
|
||||
std::vector,
|
||||
alt_string,
|
||||
@ -112,7 +112,7 @@ using alt_json = Azure::Core::_internal::Json::basic_json<
|
||||
std::uint64_t,
|
||||
double,
|
||||
std::allocator,
|
||||
Azure::Core::_internal::Json::adl_serializer>;
|
||||
Azure::Core::Json::_internal::adl_serializer>;
|
||||
|
||||
bool operator<(const char* op1, const alt_string& op2) { return op1 < op2.str_impl; }
|
||||
|
||||
|
||||
@ -30,7 +30,7 @@ SOFTWARE.
|
||||
#include "doctest_compatibility.h"
|
||||
|
||||
#include <azure/core/internal/json.hpp>
|
||||
using Azure::Core::_internal::Json::json;
|
||||
using Azure::Core::Json::_internal::json;
|
||||
|
||||
TEST_CASE("capacity")
|
||||
{
|
||||
|
||||
@ -31,7 +31,7 @@ SOFTWARE.
|
||||
|
||||
#define private public
|
||||
#include <azure/core/internal/json.hpp>
|
||||
using Azure::Core::_internal::Json::json;
|
||||
using Azure::Core::Json::_internal::json;
|
||||
#undef private
|
||||
|
||||
TEST_CASE("const_iterator class")
|
||||
|
||||
@ -31,7 +31,7 @@ SOFTWARE.
|
||||
|
||||
#define private public
|
||||
#include <azure/core/internal/json.hpp>
|
||||
using Azure::Core::_internal::Json::json;
|
||||
using Azure::Core::Json::_internal::json;
|
||||
#undef private
|
||||
|
||||
TEST_CASE("iterator class")
|
||||
|
||||
@ -31,7 +31,7 @@ SOFTWARE.
|
||||
|
||||
#define private public
|
||||
#include <azure/core/internal/json.hpp>
|
||||
using Azure::Core::_internal::Json::json;
|
||||
using Azure::Core::Json::_internal::json;
|
||||
#undef private
|
||||
|
||||
namespace {
|
||||
@ -39,8 +39,8 @@ namespace {
|
||||
json::lexer::token_type scan_string(const char* s);
|
||||
json::lexer::token_type scan_string(const char* s)
|
||||
{
|
||||
auto ia = Azure::Core::_internal::Json::detail::input_adapter(s);
|
||||
return Azure::Core::_internal::Json::detail::lexer<json, decltype(ia)>(std::move(ia)).scan();
|
||||
auto ia = Azure::Core::Json::_internal::detail::input_adapter(s);
|
||||
return Azure::Core::Json::_internal::detail::lexer<json, decltype(ia)>(std::move(ia)).scan();
|
||||
}
|
||||
} // namespace
|
||||
|
||||
|
||||
@ -30,7 +30,7 @@ SOFTWARE.
|
||||
#include "doctest_compatibility.h"
|
||||
|
||||
#include <azure/core/internal/json.hpp>
|
||||
using Azure::Core::_internal::Json::json;
|
||||
using Azure::Core::Json::_internal::json;
|
||||
|
||||
namespace {
|
||||
// helper function to check std::less<json::value_t>
|
||||
|
||||
@ -30,7 +30,7 @@ SOFTWARE.
|
||||
#include "doctest_compatibility.h"
|
||||
|
||||
#include <azure/core/internal/json.hpp>
|
||||
using Azure::Core::_internal::Json::json;
|
||||
using Azure::Core::Json::_internal::json;
|
||||
|
||||
TEST_CASE("concepts")
|
||||
{
|
||||
|
||||
@ -32,7 +32,7 @@ DOCTEST_GCC_SUPPRESS_WARNING("-Wfloat-equal")
|
||||
|
||||
#define private public
|
||||
#include <azure/core/internal/json.hpp>
|
||||
using Azure::Core::_internal::Json::json;
|
||||
using Azure::Core::Json::_internal::json;
|
||||
#undef private
|
||||
|
||||
#include <deque>
|
||||
|
||||
@ -30,7 +30,7 @@ SOFTWARE.
|
||||
#include "doctest_compatibility.h"
|
||||
|
||||
#include <azure/core/internal/json.hpp>
|
||||
using Azure::Core::_internal::Json::json;
|
||||
using Azure::Core::Json::_internal::json;
|
||||
|
||||
TEST_CASE("other constructors and destructor")
|
||||
{
|
||||
|
||||
@ -31,7 +31,7 @@ SOFTWARE.
|
||||
|
||||
#define private public
|
||||
#include <azure/core/internal/json.hpp>
|
||||
using Azure::Core::_internal::Json::json;
|
||||
using Azure::Core::Json::_internal::json;
|
||||
#undef private
|
||||
|
||||
#include <sstream>
|
||||
@ -41,7 +41,7 @@ void check_escaped(const char* original, const char* escaped = "", const bool en
|
||||
void check_escaped(const char* original, const char* escaped, const bool ensure_ascii)
|
||||
{
|
||||
std::stringstream ss;
|
||||
json::serializer s(Azure::Core::_internal::Json::detail::output_adapter<char>(ss), ' ');
|
||||
json::serializer s(Azure::Core::Json::_internal::detail::output_adapter<char>(ss), ' ');
|
||||
s.dump_escaped(original, ensure_ascii);
|
||||
CHECK(ss.str() == escaped);
|
||||
}
|
||||
|
||||
@ -31,7 +31,7 @@ SOFTWARE.
|
||||
|
||||
#define private public
|
||||
#include <azure/core/internal/json.hpp>
|
||||
using Azure::Core::_internal::Json::json;
|
||||
using Azure::Core::Json::_internal::json;
|
||||
#undef private
|
||||
|
||||
#include <deque>
|
||||
|
||||
@ -30,14 +30,14 @@ SOFTWARE.
|
||||
#include "doctest_compatibility.h"
|
||||
|
||||
#include <azure/core/internal/json.hpp>
|
||||
using Azure::Core::_internal::Json::json;
|
||||
using Azure::Core::Json::_internal::json;
|
||||
|
||||
#include <iostream>
|
||||
#include <sstream>
|
||||
#include <valarray>
|
||||
|
||||
namespace {
|
||||
struct SaxEventLogger : public Azure::Core::_internal::Json::json_sax<json>
|
||||
struct SaxEventLogger : public Azure::Core::Json::_internal::json_sax<json>
|
||||
{
|
||||
bool null() override
|
||||
{
|
||||
|
||||
@ -30,7 +30,7 @@ SOFTWARE.
|
||||
#include "doctest_compatibility.h"
|
||||
|
||||
#include <azure/core/internal/json.hpp>
|
||||
using Azure::Core::_internal::Json::json;
|
||||
using Azure::Core::Json::_internal::json;
|
||||
|
||||
TEST_CASE("element access 1")
|
||||
{
|
||||
|
||||
@ -30,7 +30,7 @@ SOFTWARE.
|
||||
#include "doctest_compatibility.h"
|
||||
|
||||
#include <azure/core/internal/json.hpp>
|
||||
using Azure::Core::_internal::Json::json;
|
||||
using Azure::Core::Json::_internal::json;
|
||||
|
||||
TEST_CASE("element access 2")
|
||||
{
|
||||
|
||||
@ -30,7 +30,7 @@ SOFTWARE.
|
||||
#include "doctest_compatibility.h"
|
||||
|
||||
#include <azure/core/internal/json.hpp>
|
||||
using Azure::Core::_internal::Json::json;
|
||||
using Azure::Core::Json::_internal::json;
|
||||
|
||||
#include <fstream>
|
||||
#include <sstream>
|
||||
|
||||
@ -30,7 +30,7 @@ SOFTWARE.
|
||||
#include "doctest_compatibility.h"
|
||||
|
||||
#include <azure/core/internal/json.hpp>
|
||||
using Azure::Core::_internal::Json::json;
|
||||
using Azure::Core::Json::_internal::json;
|
||||
|
||||
#if (defined(__cplusplus) && __cplusplus >= 201703L) \
|
||||
|| (defined(_HAS_CXX17) && _HAS_CXX17 == 1) // fix for issue #464
|
||||
|
||||
@ -31,7 +31,7 @@ SOFTWARE.
|
||||
|
||||
#define private public
|
||||
#include <azure/core/internal/json.hpp>
|
||||
using Azure::Core::_internal::Json::json;
|
||||
using Azure::Core::Json::_internal::json;
|
||||
#undef private
|
||||
|
||||
TEST_CASE("iterators 1")
|
||||
|
||||
@ -30,7 +30,7 @@ SOFTWARE.
|
||||
#include "doctest_compatibility.h"
|
||||
|
||||
#include <azure/core/internal/json.hpp>
|
||||
using Azure::Core::_internal::Json::json;
|
||||
using Azure::Core::Json::_internal::json;
|
||||
|
||||
TEST_CASE("iterators 2")
|
||||
{
|
||||
|
||||
@ -30,7 +30,7 @@ SOFTWARE.
|
||||
#include "doctest_compatibility.h"
|
||||
|
||||
#include <azure/core/internal/json.hpp>
|
||||
using Azure::Core::_internal::Json::json;
|
||||
using Azure::Core::Json::_internal::json;
|
||||
|
||||
#include <algorithm>
|
||||
|
||||
|
||||
@ -30,7 +30,7 @@ SOFTWARE.
|
||||
#include "doctest_compatibility.h"
|
||||
|
||||
#include <azure/core/internal/json.hpp>
|
||||
using Azure::Core::_internal::Json::json;
|
||||
using Azure::Core::Json::_internal::json;
|
||||
|
||||
TEST_CASE("modifiers")
|
||||
{
|
||||
|
||||
@ -30,7 +30,7 @@ SOFTWARE.
|
||||
#include "doctest_compatibility.h"
|
||||
|
||||
#include <azure/core/internal/json.hpp>
|
||||
using Azure::Core::_internal::Json::json;
|
||||
using Azure::Core::Json::_internal::json;
|
||||
|
||||
namespace {
|
||||
enum test
|
||||
@ -56,12 +56,12 @@ void from_json(const json&, pod_bis) {}
|
||||
static json* j = nullptr;
|
||||
|
||||
static_assert(noexcept(json{}), "");
|
||||
static_assert(noexcept(Azure::Core::_internal::Json::to_json(*j, 2)), "");
|
||||
static_assert(noexcept(Azure::Core::_internal::Json::to_json(*j, 2.5)), "");
|
||||
static_assert(noexcept(Azure::Core::_internal::Json::to_json(*j, true)), "");
|
||||
static_assert(noexcept(Azure::Core::_internal::Json::to_json(*j, test{})), "");
|
||||
static_assert(noexcept(Azure::Core::_internal::Json::to_json(*j, pod{})), "");
|
||||
static_assert(not noexcept(Azure::Core::_internal::Json::to_json(*j, pod_bis{})), "");
|
||||
static_assert(noexcept(Azure::Core::Json::_internal::to_json(*j, 2)), "");
|
||||
static_assert(noexcept(Azure::Core::Json::_internal::to_json(*j, 2.5)), "");
|
||||
static_assert(noexcept(Azure::Core::Json::_internal::to_json(*j, true)), "");
|
||||
static_assert(noexcept(Azure::Core::Json::_internal::to_json(*j, test{})), "");
|
||||
static_assert(noexcept(Azure::Core::Json::_internal::to_json(*j, pod{})), "");
|
||||
static_assert(not noexcept(Azure::Core::Json::_internal::to_json(*j, pod_bis{})), "");
|
||||
static_assert(noexcept(json(2)), "");
|
||||
static_assert(noexcept(json(test{})), "");
|
||||
static_assert(noexcept(json(pod{})), "");
|
||||
|
||||
@ -30,7 +30,7 @@ SOFTWARE.
|
||||
#include "doctest_compatibility.h"
|
||||
|
||||
#include <azure/core/internal/json.hpp>
|
||||
using Azure::Core::_internal::Json::json;
|
||||
using Azure::Core::Json::_internal::json;
|
||||
|
||||
TEST_CASE("pointer access")
|
||||
{
|
||||
|
||||
@ -31,7 +31,7 @@ SOFTWARE.
|
||||
DOCTEST_GCC_SUPPRESS_WARNING("-Wfloat-equal")
|
||||
|
||||
#include <azure/core/internal/json.hpp>
|
||||
using Azure::Core::_internal::Json::json;
|
||||
using Azure::Core::Json::_internal::json;
|
||||
|
||||
#include <deque>
|
||||
#include <forward_list>
|
||||
|
||||
@ -31,7 +31,7 @@ SOFTWARE.
|
||||
DOCTEST_GCC_SUPPRESS_WARNING("-Wfloat-equal")
|
||||
|
||||
#include <azure/core/internal/json.hpp>
|
||||
using Azure::Core::_internal::Json::json;
|
||||
using Azure::Core::Json::_internal::json;
|
||||
|
||||
TEST_CASE("reference access")
|
||||
{
|
||||
|
||||
@ -30,7 +30,7 @@ SOFTWARE.
|
||||
#include "doctest_compatibility.h"
|
||||
|
||||
#include <azure/core/internal/json.hpp>
|
||||
using Azure::Core::_internal::Json::json;
|
||||
using Azure::Core::Json::_internal::json;
|
||||
|
||||
#include <iomanip>
|
||||
#include <sstream>
|
||||
|
||||
@ -30,7 +30,7 @@ SOFTWARE.
|
||||
#include "doctest_compatibility.h"
|
||||
|
||||
#include <azure/core/internal/json.hpp>
|
||||
using Azure::Core::_internal::Json::json;
|
||||
using Azure::Core::Json::_internal::json;
|
||||
|
||||
#include <fstream>
|
||||
#include <test_data.hpp>
|
||||
|
||||
@ -34,7 +34,7 @@ SOFTWARE.
|
||||
#include "doctest_compatibility.h"
|
||||
|
||||
#include <azure/core/internal/json.hpp>
|
||||
using Azure::Core::_internal::Json::detail::dtoa_impl::reinterpret_bits;
|
||||
using Azure::Core::Json::_internal::detail::dtoa_impl::reinterpret_bits;
|
||||
|
||||
namespace {
|
||||
static float make_float(uint32_t sign_bit, uint32_t biased_exponent, uint32_t significand)
|
||||
@ -154,7 +154,7 @@ TEST_CASE("digit gen")
|
||||
char buf[32];
|
||||
int len = 0;
|
||||
int exponent = 0;
|
||||
Azure::Core::_internal::Json::detail::dtoa_impl::grisu2(buf, len, exponent, number);
|
||||
Azure::Core::Json::_internal::detail::dtoa_impl::grisu2(buf, len, exponent, number);
|
||||
|
||||
CHECK(digits == std::string(buf, buf + len));
|
||||
CHECK(expected_exponent == exponent);
|
||||
@ -229,7 +229,7 @@ TEST_CASE("digit gen")
|
||||
char buf[32];
|
||||
int len = 0;
|
||||
int exponent = 0;
|
||||
Azure::Core::_internal::Json::detail::dtoa_impl::grisu2(buf, len, exponent, number);
|
||||
Azure::Core::Json::_internal::detail::dtoa_impl::grisu2(buf, len, exponent, number);
|
||||
|
||||
CHECK(digits == std::string(buf, buf + len));
|
||||
CHECK(expected_exponent == exponent);
|
||||
@ -528,7 +528,7 @@ TEST_CASE("formatting")
|
||||
auto check_float = [](float number, const std::string& expected) {
|
||||
std::array<char, 33> buf{};
|
||||
char* end
|
||||
= Azure::Core::_internal::Json::detail::to_chars(buf.data(), buf.data() + 32, number);
|
||||
= Azure::Core::Json::_internal::detail::to_chars(buf.data(), buf.data() + 32, number);
|
||||
std::string actual(buf.data(), end);
|
||||
|
||||
CHECK(actual == expected);
|
||||
@ -588,7 +588,7 @@ TEST_CASE("formatting")
|
||||
auto check_double = [](double number, const std::string& expected) {
|
||||
std::array<char, 33> buf{};
|
||||
char* end
|
||||
= Azure::Core::_internal::Json::detail::to_chars(buf.data(), buf.data() + 32, number);
|
||||
= Azure::Core::Json::_internal::detail::to_chars(buf.data(), buf.data() + 32, number);
|
||||
std::string actual(buf.data(), end);
|
||||
|
||||
CHECK(actual == expected);
|
||||
@ -677,7 +677,7 @@ TEST_CASE("formatting")
|
||||
SECTION("integer")
|
||||
{
|
||||
auto check_integer = [](std::int64_t number, const std::string& expected) {
|
||||
Azure::Core::_internal::Json::json j = number;
|
||||
Azure::Core::Json::_internal::json j = number;
|
||||
CHECK(j.dump() == expected);
|
||||
};
|
||||
|
||||
|
||||
@ -30,7 +30,7 @@ SOFTWARE.
|
||||
#include "doctest_compatibility.h"
|
||||
|
||||
#include <azure/core/internal/json.hpp>
|
||||
using Azure::Core::_internal::Json::json;
|
||||
using Azure::Core::Json::_internal::json;
|
||||
|
||||
#include <array>
|
||||
#include <map>
|
||||
@ -122,14 +122,14 @@ template <typename BasicJsonType> static void to_json(BasicJsonType& j, const pe
|
||||
j = BasicJsonType{{"age", p.m_age}, {"name", p.m_name}, {"country", p.m_country}};
|
||||
}
|
||||
|
||||
static void to_json(Azure::Core::_internal::Json::json& j, const address& a) { j = a.m_val; }
|
||||
static void to_json(Azure::Core::Json::_internal::json& j, const address& a) { j = a.m_val; }
|
||||
|
||||
static void to_json(Azure::Core::_internal::Json::json& j, const contact& c)
|
||||
static void to_json(Azure::Core::Json::_internal::json& j, const contact& c)
|
||||
{
|
||||
j = json{{"person", c.m_person}, {"address", c.m_address}};
|
||||
}
|
||||
|
||||
static void to_json(Azure::Core::_internal::Json::json& j, const contact_book& cb)
|
||||
static void to_json(Azure::Core::Json::_internal::json& j, const contact_book& cb)
|
||||
{
|
||||
j = json{{"name", cb.m_book_name}, {"contacts", cb.m_contacts}};
|
||||
}
|
||||
@ -189,18 +189,18 @@ template <typename BasicJsonType> static void from_json(const BasicJsonType& j,
|
||||
p.m_country = j["country"].template get<country>();
|
||||
}
|
||||
|
||||
static void from_json(const Azure::Core::_internal::Json::json& j, address& a)
|
||||
static void from_json(const Azure::Core::Json::_internal::json& j, address& a)
|
||||
{
|
||||
a.m_val = j.get<std::string>();
|
||||
}
|
||||
|
||||
static void from_json(const Azure::Core::_internal::Json::json& j, contact& c)
|
||||
static void from_json(const Azure::Core::Json::_internal::json& j, contact& c)
|
||||
{
|
||||
c.m_person = j["person"].get<person>();
|
||||
c.m_address = j["address"].get<address>();
|
||||
}
|
||||
|
||||
static void from_json(const Azure::Core::_internal::Json::json& j, contact_book& cb)
|
||||
static void from_json(const Azure::Core::Json::_internal::json& j, contact_book& cb)
|
||||
{
|
||||
cb.m_book_name = j["name"].get<name>();
|
||||
cb.m_contacts = j["contacts"].get<std::vector<contact>>();
|
||||
@ -230,7 +230,7 @@ struct legacy_type
|
||||
};
|
||||
} // namespace udt
|
||||
|
||||
namespace Azure { namespace Core { namespace _internal { namespace Json {
|
||||
namespace Azure { namespace Core { namespace Json { namespace _internal {
|
||||
template <typename T> struct adl_serializer<std::shared_ptr<T>>
|
||||
{
|
||||
static void to_json(json& j, const std::shared_ptr<T>& opt)
|
||||
@ -267,7 +267,7 @@ namespace Azure { namespace Core { namespace _internal { namespace Json {
|
||||
l.number = std::to_string(j.get<int>());
|
||||
}
|
||||
};
|
||||
}}}} // namespace Azure::Core::_internal::Json
|
||||
}}}} // namespace Azure::Core::Json::_internal
|
||||
|
||||
TEST_CASE("adl_serializer specialization" * doctest::test_suite("udt"))
|
||||
{
|
||||
@ -321,7 +321,7 @@ TEST_CASE("adl_serializer specialization" * doctest::test_suite("udt"))
|
||||
}
|
||||
}
|
||||
|
||||
namespace Azure { namespace Core { namespace _internal { namespace Json {
|
||||
namespace Azure { namespace Core { namespace Json { namespace _internal {
|
||||
template <> struct adl_serializer<std::vector<float>>
|
||||
{
|
||||
using type = std::vector<float>;
|
||||
@ -332,7 +332,7 @@ namespace Azure { namespace Core { namespace _internal { namespace Json {
|
||||
// preferred version
|
||||
static type from_json(const json&) { return {4.0, 5.0, 6.0}; }
|
||||
};
|
||||
}}}} // namespace Azure::Core::_internal::Json
|
||||
}}}} // namespace Azure::Core::Json::_internal
|
||||
|
||||
TEST_CASE("even supported types can be specialized" * doctest::test_suite("udt"))
|
||||
{
|
||||
@ -343,7 +343,7 @@ TEST_CASE("even supported types can be specialized" * doctest::test_suite("udt")
|
||||
CHECK((f == std::vector<float>{4.0, 5.0, 6.0}));
|
||||
}
|
||||
|
||||
namespace Azure { namespace Core { namespace _internal { namespace Json {
|
||||
namespace Azure { namespace Core { namespace Json { namespace _internal {
|
||||
template <typename T> struct adl_serializer<std::unique_ptr<T>>
|
||||
{
|
||||
static void to_json(json& j, const std::unique_ptr<T>& opt)
|
||||
@ -371,7 +371,7 @@ namespace Azure { namespace Core { namespace _internal { namespace Json {
|
||||
}
|
||||
}
|
||||
};
|
||||
}}}} // namespace Azure::Core::_internal::Json
|
||||
}}}} // namespace Azure::Core::Json::_internal
|
||||
|
||||
TEST_CASE("Non-copyable types" * doctest::test_suite("udt"))
|
||||
{
|
||||
@ -417,7 +417,7 @@ template <typename T, typename = void> struct pod_serializer
|
||||
= 0>
|
||||
static void from_json(const BasicJsonType& j, U& t)
|
||||
{
|
||||
using Azure::Core::_internal::Json::from_json;
|
||||
using Azure::Core::Json::_internal::from_json;
|
||||
from_json(j, t);
|
||||
}
|
||||
|
||||
@ -436,7 +436,7 @@ template <typename T, typename = void> struct pod_serializer
|
||||
// Why cannot we simply use: j.get<std::uint64_t>() ?
|
||||
// Well, with the current experiment, the get method looks for a from_json
|
||||
// function, which we are currently defining!
|
||||
// This would end up in a stack overflow. Calling Azure::Core::_internal::Json::from_json is a
|
||||
// This would end up in a stack overflow. Calling Azure::Core::Json::_internal::from_json is a
|
||||
// workaround (is it?).
|
||||
// I shall find a good way to avoid this once all constructors are converted
|
||||
// to free methods
|
||||
@ -444,7 +444,7 @@ template <typename T, typename = void> struct pod_serializer
|
||||
// In short, constructing a json by constructor calls to_json
|
||||
// calling get calls from_json, for now, we cannot do this in custom
|
||||
// serializers
|
||||
Azure::Core::_internal::Json::from_json(j, value);
|
||||
Azure::Core::Json::_internal::from_json(j, value);
|
||||
auto bytes = static_cast<char*>(static_cast<void*>(&value));
|
||||
std::memcpy(&t, bytes, sizeof(value));
|
||||
}
|
||||
@ -456,7 +456,7 @@ template <typename T, typename = void> struct pod_serializer
|
||||
= 0>
|
||||
static void to_json(BasicJsonType& j, const T& t)
|
||||
{
|
||||
using Azure::Core::_internal::Json::to_json;
|
||||
using Azure::Core::Json::_internal::to_json;
|
||||
to_json(j, t);
|
||||
}
|
||||
|
||||
@ -469,7 +469,7 @@ template <typename T, typename = void> struct pod_serializer
|
||||
auto bytes = static_cast<const unsigned char*>(static_cast<const void*>(&t));
|
||||
std::uint64_t value;
|
||||
std::memcpy(&value, bytes, sizeof(value));
|
||||
Azure::Core::_internal::Json::to_json(j, value);
|
||||
Azure::Core::Json::_internal::to_json(j, value);
|
||||
}
|
||||
};
|
||||
|
||||
@ -513,7 +513,7 @@ static std::ostream& operator<<(std::ostream& os, small_pod l)
|
||||
|
||||
TEST_CASE("custom serializer for pods" * doctest::test_suite("udt"))
|
||||
{
|
||||
using custom_json = Azure::Core::_internal::Json::basic_json<
|
||||
using custom_json = Azure::Core::Json::_internal::basic_json<
|
||||
std::map,
|
||||
std::vector,
|
||||
std::string,
|
||||
@ -539,7 +539,7 @@ TEST_CASE("custom serializer for pods" * doctest::test_suite("udt"))
|
||||
|
||||
template <typename T, typename> struct another_adl_serializer;
|
||||
|
||||
using custom_json = Azure::Core::_internal::Json::basic_json<
|
||||
using custom_json = Azure::Core::Json::_internal::basic_json<
|
||||
std::map,
|
||||
std::vector,
|
||||
std::string,
|
||||
@ -554,13 +554,13 @@ template <typename T, typename> struct another_adl_serializer
|
||||
{
|
||||
static void from_json(const custom_json& j, T& t)
|
||||
{
|
||||
using Azure::Core::_internal::Json::from_json;
|
||||
using Azure::Core::Json::_internal::from_json;
|
||||
from_json(j, t);
|
||||
}
|
||||
|
||||
static void to_json(custom_json& j, const T& t)
|
||||
{
|
||||
using Azure::Core::_internal::Json::to_json;
|
||||
using Azure::Core::Json::_internal::to_json;
|
||||
to_json(j, t);
|
||||
}
|
||||
};
|
||||
|
||||
@ -30,7 +30,7 @@ SOFTWARE.
|
||||
#include "doctest_compatibility.h"
|
||||
|
||||
#include <azure/core/internal/json.hpp>
|
||||
using Azure::Core::_internal::Json::json;
|
||||
using Azure::Core::Json::_internal::json;
|
||||
|
||||
#include <list>
|
||||
|
||||
|
||||
@ -30,7 +30,7 @@ SOFTWARE.
|
||||
#include "doctest_compatibility.h"
|
||||
|
||||
#include <azure/core/internal/json.hpp>
|
||||
using Azure::Core::_internal::Json::json;
|
||||
using Azure::Core::Json::_internal::json;
|
||||
|
||||
namespace {
|
||||
bool wstring_is_utf16();
|
||||
|
||||
@ -4,7 +4,7 @@
|
||||
#include <azure/core/internal/json.hpp>
|
||||
#include <gtest/gtest.h>
|
||||
|
||||
using json = Azure::Core::_internal::Json::json;
|
||||
using json = Azure::Core::Json::_internal::json;
|
||||
|
||||
// Just a simple test to ensure that Azure Core internal is wrapping nlohmann json
|
||||
TEST(Json, create)
|
||||
|
||||
@ -105,7 +105,7 @@ namespace Azure { namespace Perf {
|
||||
};
|
||||
|
||||
/**
|
||||
* @brief Define a #Azure::Core::_internal::Json::json to
|
||||
* @brief Define a #Azure::Core::Json::_internal::json to
|
||||
* Azure::Perf::GlobalTestOptions convertion.
|
||||
*
|
||||
* @remark The Json library consumes this implementation for parsing
|
||||
@ -114,5 +114,5 @@ namespace Azure { namespace Perf {
|
||||
* @param j A Json reference to be written.
|
||||
* @param p A #Azure::Perf::GlobalTestOptions reference to be parsed.
|
||||
*/
|
||||
void to_json(Azure::Core::_internal::Json::json& j, const GlobalTestOptions& p);
|
||||
void to_json(Azure::Core::Json::_internal::json& j, const GlobalTestOptions& p);
|
||||
}} // namespace Azure::Perf
|
||||
|
||||
@ -5,9 +5,9 @@
|
||||
|
||||
#include <iostream>
|
||||
|
||||
void Azure::Perf::to_json(Azure::Core::_internal::Json::json& j, const GlobalTestOptions& p)
|
||||
void Azure::Perf::to_json(Azure::Core::Json::_internal::json& j, const GlobalTestOptions& p)
|
||||
{
|
||||
j = Azure::Core::_internal::Json::json{
|
||||
j = Azure::Core::Json::_internal::json{
|
||||
{"Duration", p.Duration},
|
||||
{"Host", p.Host},
|
||||
{"Insecure", p.Insecure},
|
||||
|
||||
@ -70,14 +70,14 @@ inline void PrintOptions(
|
||||
{
|
||||
{
|
||||
std::cout << std::endl << "=== Global Options ===" << std::endl;
|
||||
Azure::Core::_internal::Json::json optionsAsJson = options;
|
||||
Azure::Core::Json::_internal::json optionsAsJson = options;
|
||||
std::cout << ReplaceAll(optionsAsJson.dump(), ",", ",\n") << std::endl;
|
||||
}
|
||||
|
||||
if (testOptions.size() > 0)
|
||||
{
|
||||
std::cout << std::endl << "=== Test Options ===" << std::endl;
|
||||
Azure::Core::_internal::Json::json optionsAsJson;
|
||||
Azure::Core::Json::_internal::json optionsAsJson;
|
||||
for (auto option : testOptions)
|
||||
{
|
||||
try
|
||||
|
||||
@ -119,7 +119,7 @@ namespace Azure { namespace Security { namespace KeyVault { namespace Common { n
|
||||
Azure::Response<T> SendRequest(
|
||||
Azure::Core::Context const& context,
|
||||
Azure::Core::Http::HttpMethod method,
|
||||
Azure::Core::_internal::Json::JsonSerializable const& content,
|
||||
Azure::Core::Json::_internal::JsonSerializable const& content,
|
||||
std::function<T(Azure::Core::Http::RawResponse const& rawResponse)> factoryFn,
|
||||
std::vector<std::string> const& path)
|
||||
{
|
||||
|
||||
@ -49,7 +49,7 @@ KeyVaultException KeyVaultException::CreateFromResponse(
|
||||
|
||||
if (contentType.find("json") != std::string::npos)
|
||||
{
|
||||
auto jsonParser = Azure::Core::_internal::Json::json::parse(bodyBuffer);
|
||||
auto jsonParser = Azure::Core::Json::_internal::json::parse(bodyBuffer);
|
||||
auto& error = jsonParser["error"];
|
||||
errorCode = error["code"].get<std::string>();
|
||||
message = error["message"].get<std::string>();
|
||||
|
||||
@ -23,7 +23,7 @@
|
||||
|
||||
namespace Azure { namespace Security { namespace KeyVault { namespace Keys { namespace _detail {
|
||||
|
||||
class KeyRequestParameters : public Azure::Core::_internal::Json::JsonSerializable {
|
||||
class KeyRequestParameters : public Azure::Core::Json::_internal::JsonSerializable {
|
||||
private:
|
||||
JsonWebKeyType m_keyType;
|
||||
CreateKeyOptions const& m_options;
|
||||
|
||||
@ -17,7 +17,7 @@ DeletedKey _detail::DeletedKeyDeserialize(
|
||||
Azure::Core::Http::RawResponse const& rawResponse)
|
||||
{
|
||||
auto body = rawResponse.GetBody();
|
||||
auto jsonParser = Azure::Core::_internal::Json::json::parse(body);
|
||||
auto jsonParser = Azure::Core::Json::_internal::json::parse(body);
|
||||
|
||||
// "Key"
|
||||
DeletedKey deletedKey(name);
|
||||
|
||||
@ -13,7 +13,7 @@ using namespace Azure::Security::KeyVault::Keys::_detail;
|
||||
std::string KeyRequestParameters::Serialize() const
|
||||
{
|
||||
|
||||
Azure::Core::_internal::Json::json payload;
|
||||
Azure::Core::Json::_internal::json payload;
|
||||
/* Mandatory */
|
||||
// kty
|
||||
payload[_detail::KeyTypePropertyName] = KeyTypeToString(m_keyType);
|
||||
|
||||
@ -38,7 +38,7 @@ void _detail::KeyVaultKeyDeserialize(
|
||||
Azure::Core::Http::RawResponse const& rawResponse)
|
||||
{
|
||||
auto body = rawResponse.GetBody();
|
||||
auto jsonParser = Azure::Core::_internal::Json::json::parse(body);
|
||||
auto jsonParser = Azure::Core::Json::_internal::json::parse(body);
|
||||
|
||||
// "Key"
|
||||
auto const& jsonKey = jsonParser[_detail::KeyPropertyName];
|
||||
|
||||
@ -129,7 +129,7 @@ namespace Azure { namespace Storage {
|
||||
response->GetHeaders().at(_detail::HttpHeaderContentType).find("json")
|
||||
!= std::string::npos)
|
||||
{
|
||||
auto jsonParser = Azure::Core::_internal::Json::json::parse(bodyBuffer);
|
||||
auto jsonParser = Azure::Core::Json::_internal::json::parse(bodyBuffer);
|
||||
errorCode = jsonParser["error"]["code"].get<std::string>();
|
||||
message = jsonParser["error"]["message"].get<std::string>();
|
||||
}
|
||||
|
||||
@ -474,7 +474,7 @@ namespace Azure { namespace Storage { namespace Files { namespace DataLake {
|
||||
FileSystemListPathsResult result = bodyBuffer.empty()
|
||||
? FileSystemListPathsResult()
|
||||
: FileSystemListPathsResultFromPathList(
|
||||
PathListFromJson(Azure::Core::_internal::Json::json::parse(bodyBuffer)));
|
||||
PathListFromJson(Azure::Core::Json::_internal::json::parse(bodyBuffer)));
|
||||
result.RequestId = response.GetHeaders().at(_detail::HeaderRequestId);
|
||||
if (response.GetHeaders().find(_detail::HeaderContinuationToken)
|
||||
!= response.GetHeaders().end())
|
||||
@ -491,7 +491,7 @@ namespace Azure { namespace Storage { namespace Files { namespace DataLake {
|
||||
}
|
||||
}
|
||||
|
||||
static PathItem PathItemFromJson(const Azure::Core::_internal::Json::json& node)
|
||||
static PathItem PathItemFromJson(const Azure::Core::Json::_internal::json& node)
|
||||
{
|
||||
PathItem result;
|
||||
result.Name = node["name"].get<std::string>();
|
||||
@ -512,7 +512,7 @@ namespace Azure { namespace Storage { namespace Files { namespace DataLake {
|
||||
return result;
|
||||
}
|
||||
|
||||
static PathList PathListFromJson(const Azure::Core::_internal::Json::json& node)
|
||||
static PathList PathListFromJson(const Azure::Core::Json::_internal::json& node)
|
||||
{
|
||||
PathList result;
|
||||
for (const auto& element : node["paths"])
|
||||
@ -1376,7 +1376,7 @@ namespace Azure { namespace Storage { namespace Files { namespace DataLake {
|
||||
? PathSetAccessControlRecursiveResult()
|
||||
: PathSetAccessControlRecursiveResultFromSetAccessControlRecursiveResponse(
|
||||
SetAccessControlRecursiveResponseFromJson(
|
||||
Azure::Core::_internal::Json::json::parse(bodyBuffer)));
|
||||
Azure::Core::Json::_internal::json::parse(bodyBuffer)));
|
||||
if (response.GetHeaders().find(_detail::HeaderContinuationToken)
|
||||
!= response.GetHeaders().end())
|
||||
{
|
||||
@ -1393,7 +1393,7 @@ namespace Azure { namespace Storage { namespace Files { namespace DataLake {
|
||||
}
|
||||
}
|
||||
|
||||
static AclFailedEntry AclFailedEntryFromJson(const Azure::Core::_internal::Json::json& node)
|
||||
static AclFailedEntry AclFailedEntryFromJson(const Azure::Core::Json::_internal::json& node)
|
||||
{
|
||||
AclFailedEntry result;
|
||||
result.Name = node["name"].get<std::string>();
|
||||
@ -1403,7 +1403,7 @@ namespace Azure { namespace Storage { namespace Files { namespace DataLake {
|
||||
}
|
||||
|
||||
static SetAccessControlRecursiveResponse SetAccessControlRecursiveResponseFromJson(
|
||||
const Azure::Core::_internal::Json::json& node)
|
||||
const Azure::Core::Json::_internal::json& node)
|
||||
{
|
||||
SetAccessControlRecursiveResponse result;
|
||||
result.NumberOfSuccessfulDirectories = node["directoriesSuccessful"].get<int32_t>();
|
||||
|
||||
@ -2921,7 +2921,7 @@ namespace Azure { namespace Storage { namespace Files { namespace Shares {
|
||||
|
||||
std::string json_body;
|
||||
{
|
||||
Azure::Core::_internal::Json::json json;
|
||||
Azure::Core::Json::_internal::json json;
|
||||
SharePermissionToJson(json, createPermissionOptions.Permission);
|
||||
json_body = json.dump();
|
||||
}
|
||||
@ -3508,7 +3508,7 @@ namespace Azure { namespace Storage { namespace Files { namespace Shares {
|
||||
}
|
||||
|
||||
static void SharePermissionToJson(
|
||||
Azure::Core::_internal::Json::json& node,
|
||||
Azure::Core::Json::_internal::json& node,
|
||||
const SharePermission& object)
|
||||
{
|
||||
node["permission"] = object.FilePermission;
|
||||
@ -3526,7 +3526,7 @@ namespace Azure { namespace Storage { namespace Files { namespace Shares {
|
||||
ShareGetPermissionResult result = bodyBuffer.empty()
|
||||
? ShareGetPermissionResult()
|
||||
: ShareGetPermissionResultFromSharePermission(
|
||||
SharePermissionFromJson(Azure::Core::_internal::Json::json::parse(bodyBuffer)));
|
||||
SharePermissionFromJson(Azure::Core::Json::_internal::json::parse(bodyBuffer)));
|
||||
result.RequestId = response.GetHeaders().at(_detail::HeaderRequestId);
|
||||
return Azure::Response<ShareGetPermissionResult>(
|
||||
std::move(result), std::move(responsePtr));
|
||||
@ -3539,7 +3539,7 @@ namespace Azure { namespace Storage { namespace Files { namespace Shares {
|
||||
}
|
||||
|
||||
static SharePermission SharePermissionFromJson(
|
||||
const Azure::Core::_internal::Json::json& node)
|
||||
const Azure::Core::Json::_internal::json& node)
|
||||
{
|
||||
SharePermission result;
|
||||
result.FilePermission = node["permission"].get<std::string>();
|
||||
|
||||
Loading…
Reference in New Issue
Block a user