WPILibC++ 2024.1.1-beta-4
from_json.h File Reference
#include <algorithm>
#include <array>
#include <forward_list>
#include <iterator>
#include <map>
#include <string>
#include <tuple>
#include <type_traits>
#include <unordered_map>
#include <utility>
#include <valarray>
#include <wpi/detail/exceptions.h>
#include <wpi/detail/macro_scope.h>
#include <wpi/detail/meta/cpp_future.h>
#include <wpi/detail/meta/identity_tag.h>
#include <wpi/detail/meta/std_fs.h>
#include <wpi/detail/meta/type_traits.h>
#include <wpi/detail/string_concat.h>
#include <wpi/detail/value_t.h>

Go to the source code of this file.

Classes

struct  detail::from_json_fn
 

Namespaces

namespace  detail
 detail namespace with internal helper functions
 

Functions

template<typename BasicJsonType >
void detail::from_json (const BasicJsonType &j, typename std::nullptr_t &n)
 
template<typename BasicJsonType , typename ArithmeticType , enable_if_t< std::is_arithmetic< ArithmeticType >::value &&!std::is_same< ArithmeticType, typename BasicJsonType::boolean_t >::value, int > = 0>
void detail::get_arithmetic_value (const BasicJsonType &j, ArithmeticType &val)
 
template<typename BasicJsonType >
void detail::from_json (const BasicJsonType &j, typename BasicJsonType::boolean_t &b)
 
template<typename BasicJsonType >
void detail::from_json (const BasicJsonType &j, typename BasicJsonType::string_t &s)
 
template<typename BasicJsonType , typename StringType , enable_if_t< std::is_assignable< StringType &, const typename BasicJsonType::string_t >::value &&is_detected_exact< typename BasicJsonType::string_t::value_type, value_type_t, StringType >::value &&!std::is_same< typename BasicJsonType::string_t, StringType >::value &&!is_json_ref< StringType >::value, int > = 0>
void detail::from_json (const BasicJsonType &j, StringType &s)
 
template<typename BasicJsonType >
void detail::from_json (const BasicJsonType &j, typename BasicJsonType::number_float_t &val)
 
template<typename BasicJsonType >
void detail::from_json (const BasicJsonType &j, typename BasicJsonType::number_unsigned_t &val)
 
template<typename BasicJsonType >
void detail::from_json (const BasicJsonType &j, typename BasicJsonType::number_integer_t &val)
 
template<typename BasicJsonType , typename EnumType , enable_if_t< std::is_enum< EnumType >::value, int > = 0>
void detail::from_json (const BasicJsonType &j, EnumType &e)
 
template<typename BasicJsonType , typename T , typename Allocator , enable_if_t< is_getable< BasicJsonType, T >::value, int > = 0>
void detail::from_json (const BasicJsonType &j, std::forward_list< T, Allocator > &l)
 
template<typename BasicJsonType , typename T , enable_if_t< is_getable< BasicJsonType, T >::value, int > = 0>
void detail::from_json (const BasicJsonType &j, std::valarray< T > &l)
 
template<typename BasicJsonType , typename T , std::size_t N>
auto detail::from_json (const BasicJsonType &j, T(&arr)[N]) -> decltype(j.template get< T >(), void())
 
template<typename BasicJsonType >
void detail::from_json_array_impl (const BasicJsonType &j, typename BasicJsonType::array_t &arr, priority_tag< 3 >)
 
template<typename BasicJsonType , typename T , std::size_t N>
auto detail::from_json_array_impl (const BasicJsonType &j, std::array< T, N > &arr, priority_tag< 2 >) -> decltype(j.template get< T >(), void())
 
template<typename BasicJsonType , typename ConstructibleArrayType , enable_if_t< std::is_assignable< ConstructibleArrayType &, ConstructibleArrayType >::value, int > = 0>
auto detail::from_json_array_impl (const BasicJsonType &j, ConstructibleArrayType &arr, priority_tag< 1 >) -> decltype(arr.reserve(std::declval< typename ConstructibleArrayType::size_type >()), j.template get< typename ConstructibleArrayType::value_type >(), void())
 
template<typename BasicJsonType , typename ConstructibleArrayType , enable_if_t< std::is_assignable< ConstructibleArrayType &, ConstructibleArrayType >::value, int > = 0>
void detail::from_json_array_impl (const BasicJsonType &j, ConstructibleArrayType &arr, priority_tag< 0 >)
 
template<typename BasicJsonType , typename ConstructibleArrayType , enable_if_t< is_constructible_array_type< BasicJsonType, ConstructibleArrayType >::value &&!is_constructible_object_type< BasicJsonType, ConstructibleArrayType >::value &&!is_constructible_string_type< BasicJsonType, ConstructibleArrayType >::value &&!std::is_same< ConstructibleArrayType, typename BasicJsonType::binary_t >::value &&!is_basic_json< ConstructibleArrayType >::value, int > = 0>
auto detail::from_json (const BasicJsonType &j, ConstructibleArrayType &arr) -> decltype(from_json_array_impl(j, arr, priority_tag< 3 > {}), j.template get< typename ConstructibleArrayType::value_type >(), void())
 
template<typename BasicJsonType , typename T , std::size_t... Idx>
std::array< T, sizeof...(Idx)> detail::from_json_inplace_array_impl (BasicJsonType &&j, identity_tag< std::array< T, sizeof...(Idx)> >, index_sequence< Idx... >)
 
template<typename BasicJsonType , typename T , std::size_t N>
auto detail::from_json (BasicJsonType &&j, identity_tag< std::array< T, N > > tag) -> decltype(from_json_inplace_array_impl(std::forward< BasicJsonType >(j), tag, make_index_sequence< N > {}))
 
template<typename BasicJsonType >
void detail::from_json (const BasicJsonType &j, typename BasicJsonType::binary_t &bin)
 
template<typename BasicJsonType , typename ConstructibleObjectType , enable_if_t< is_constructible_object_type< BasicJsonType, ConstructibleObjectType >::value, int > = 0>
void detail::from_json (const BasicJsonType &j, ConstructibleObjectType &obj)
 
template<typename BasicJsonType , typename ArithmeticType , enable_if_t< std::is_arithmetic< ArithmeticType >::value &&!std::is_same< ArithmeticType, typename BasicJsonType::number_unsigned_t >::value &&!std::is_same< ArithmeticType, typename BasicJsonType::number_integer_t >::value &&!std::is_same< ArithmeticType, typename BasicJsonType::number_float_t >::value &&!std::is_same< ArithmeticType, typename BasicJsonType::boolean_t >::value, int > = 0>
void detail::from_json (const BasicJsonType &j, ArithmeticType &val)
 
template<typename BasicJsonType , typename... Args, std::size_t... Idx>
std::tuple< Args... > detail::from_json_tuple_impl_base (BasicJsonType &&j, index_sequence< Idx... >)
 
template<typename BasicJsonType , class A1 , class A2 >
std::pair< A1, A2 > detail::from_json_tuple_impl (BasicJsonType &&j, identity_tag< std::pair< A1, A2 > >, priority_tag< 0 >)
 
template<typename BasicJsonType , typename A1 , typename A2 >
void detail::from_json_tuple_impl (BasicJsonType &&j, std::pair< A1, A2 > &p, priority_tag< 1 >)
 
template<typename BasicJsonType , typename... Args>
std::tuple< Args... > detail::from_json_tuple_impl (BasicJsonType &&j, identity_tag< std::tuple< Args... > >, priority_tag< 2 >)
 
template<typename BasicJsonType , typename... Args>
void detail::from_json_tuple_impl (BasicJsonType &&j, std::tuple< Args... > &t, priority_tag< 3 >)
 
template<typename BasicJsonType , typename TupleRelated >
auto detail::from_json (BasicJsonType &&j, TupleRelated &&t) -> decltype(from_json_tuple_impl(std::forward< BasicJsonType >(j), std::forward< TupleRelated >(t), priority_tag< 3 > {}))
 
template<typename BasicJsonType , typename Key , typename Value , typename Compare , typename Allocator , typename = enable_if_t < !std::is_constructible < typename BasicJsonType::string_t, Key >::value >>
void detail::from_json (const BasicJsonType &j, std::map< Key, Value, Compare, Allocator > &m)
 
template<typename BasicJsonType , typename Key , typename Value , typename Hash , typename KeyEqual , typename Allocator , typename = enable_if_t < !std::is_constructible < typename BasicJsonType::string_t, Key >::value >>
void detail::from_json (const BasicJsonType &j, std::unordered_map< Key, Value, Hash, KeyEqual, Allocator > &m)