![]() |
zeep::json::element
// In header: <zeep/json/element.hpp> class element { public: // types typedef unspecified value_type; typedef std::nullptr_t nullptr_type; typedef std::map< std::string, element > object_type; typedef std::vector< element > array_type; typedef std::string string_type; typedef int64_t int_type; typedef double float_type; typedef bool boolean_type; typedef element * pointer; typedef const element * const_pointer; typedef std::ptrdiff_t difference_type; typedef std::size_t size_type; typedef unspecified initializer_list_t; typedef element & reference; typedef const element & const_reference; typedef unspecified iterator; typedef unspecified const_iterator; typedef unspecified iteration_proxy; // member classes/structs/unions union element_data { // construct/copy/destruct element_data() = default; element_data(bool) noexcept; element_data(int64_t) noexcept; element_data(double) noexcept; element_data(value_type); element_data(const object_type &); element_data(object_type &&); element_data(const string_type &); element_data(string_type &&); element_data(const array_type &); element_data(array_type &&); // public member functions void destroy(value_type) noexcept; // public data members object_type * m_object; array_type * m_array; string_type * m_string; int64_t m_int; double m_float; bool m_boolean; }; // construct/copy/destruct element(value_type); element(std::nullptr_t = nullptr); element(const element &); element(element &&); template<typename ElementRef, unspecified = 0> element(const ElementRef &); template<typename T, typename U = typename std::remove_cv_t<typename std::remove_reference_t<T>>, unspecified = 0> element(T &&) noexcept(noexcept(element_serializer< U, void >::to_element(std::declval< element & >(), std::forward< T >(v))))); element(initializer_list_t); element(size_t, const element &); element & operator=(element) noexcept(std::is_nothrow_move_constructible_v< value_type > and std::is_nothrow_move_assignable_v< value_type > and std::is_nothrow_move_constructible_v< element_data > and std::is_nothrow_move_assignable_v< element_data >)); ~element(); // private static functions template<typename T, typename... Args> static T * create(Args &&...); // public member functions constexpr bool is_null() const noexcept; constexpr bool is_object() const noexcept; constexpr bool is_array() const noexcept; constexpr bool is_string() const noexcept; constexpr bool is_number() const noexcept; constexpr bool is_number_int() const noexcept; constexpr bool is_number_float() const noexcept; constexpr bool is_true() const noexcept; constexpr bool is_false() const noexcept; constexpr bool is_boolean() const noexcept; constexpr value_type type() const; std::string type_name() const; explicit operator bool() const noexcept; reference at(const typename object_type::key_type &); const_reference at(const typename object_type::key_type &) const; reference operator[](const typename object_type::key_type &); const_reference operator[](const typename object_type::key_type &) const; reference at(size_t); const_reference at(size_t) const; reference operator[](size_t); const_reference operator[](size_t) const; iterator begin() noexcept; iterator end() noexcept; const_iterator begin() const noexcept; const_iterator end() const noexcept; const_iterator cbegin() const noexcept; const_iterator cend() const noexcept; reference front(); const_reference front() const; reference back(); const_reference back() const; void clear() noexcept; iterator insert(const_iterator, const element &); iterator insert(const_iterator, element &&); iterator insert(const_iterator, size_type, const element &); iterator insert(const_iterator, const_iterator, const_iterator); iterator insert(const_iterator, initializer_list_t); void insert(const_iterator, const_iterator); void push_back(element &&); void push_back(const element &); template<typename... Args> std::pair< iterator, bool > emplace(Args &&...); template<typename... Args> void emplace_back(Args &&...); template<typename Iterator, typename std::enable_if_t< std::is_same_v< Iterator, iterator > or std::is_same_v< Iterator, const_iterator >, int > = 0> Iterator erase(Iterator); template<typename Iterator, typename std::enable_if_t< std::is_same_v< Iterator, iterator > or std::is_same_v< Iterator, const_iterator >, int > = 0> Iterator erase(Iterator, Iterator); size_type erase(const typename object_type::key_type &); void erase(const size_type); void swap(reference) noexcept(std::is_nothrow_move_constructible_v< value_type > and std::is_nothrow_move_assignable_v< value_type > and std::is_nothrow_move_constructible_v< element_data > and std::is_nothrow_move_assignable_v< element_data >)); template<typename T> const_iterator find(T &&) const; bool contains(element) const; iteration_proxy< iterator > items() noexcept; iteration_proxy< const_iterator > items() const noexcept; bool empty() const; size_t size() const; size_t max_size() const noexcept; element & operator-(); template<typename P, typename std::enable_if_t< std::is_pointer_v< P >, int > = 0> auto get_ptr() noexcept; template<typename P, typename std::enable_if_t< std::is_pointer_v< P > and std::is_const_v< typename std::remove_pointer_t< P >>, int > = 0> constexpr auto get_ptr() const noexcept; template<typename T, typename U = typename std::remove_cv_t<typename std::remove_reference_t<T>>, unspecified = 0> T as() const noexcept(noexcept(element_serializer< U >::from_element(std::declval< const element & >(), std::declval< U & >())))); template<> bool as() const; // public static functions static element object(); static element array(); static element object(initializer_list_t); static element array(initializer_list_t); // private member functions template<typename... Args> iterator insert_iterator(const_iterator, Args...); object_type * get_impl_ptr(object_type *) noexcept; constexpr const object_type * get_impl_ptr(const object_type *) const noexcept; array_type * get_impl_ptr(array_type *) noexcept; constexpr const array_type * get_impl_ptr(const array_type *) const noexcept; string_type * get_impl_ptr(string_type *) noexcept; constexpr const string_type * get_impl_ptr(const string_type *) const noexcept; int_type * get_impl_ptr(int_type *) noexcept; constexpr const int_type * get_impl_ptr(const int_type *) const noexcept; float_type * get_impl_ptr(float_type *) noexcept; constexpr const float_type * get_impl_ptr(const float_type *) const noexcept; boolean_type * get_impl_ptr(boolean_type *) noexcept; constexpr const boolean_type * get_impl_ptr(const boolean_type *) const noexcept; void validate() const; // public data members value_type m_type; element_data m_data; };
element
public
construct/copy/destructelement(value_type t);empty constructor with a certain type
element(std::nullptr_t = nullptr);default constructor
element(const element & j);
element(element && j);
template<typename ElementRef, unspecified = 0> element(const ElementRef & r);
template<typename T, typename U = typename std::remove_cv_t<typename std::remove_reference_t<T>>, unspecified = 0> element(T && v) noexcept(noexcept(element_serializer< U, void >::to_element(std::declval< element & >(), std::forward< T >(v)))));
element(initializer_list_t init);
element(size_t cnt, const element & v);
element & operator=(element j) noexcept(std::is_nothrow_move_constructible_v< value_type > and std::is_nothrow_move_assignable_v< value_type > and std::is_nothrow_move_constructible_v< element_data > and std::is_nothrow_move_assignable_v< element_data >));
~element();
element
public member functionsconstexpr bool is_null() const noexcept;
constexpr bool is_object() const noexcept;
constexpr bool is_array() const noexcept;
constexpr bool is_string() const noexcept;
constexpr bool is_number() const noexcept;
constexpr bool is_number_int() const noexcept;
constexpr bool is_number_float() const noexcept;
constexpr bool is_true() const noexcept;
constexpr bool is_false() const noexcept;
constexpr bool is_boolean() const noexcept;
constexpr value_type type() const;
std::string type_name() const;
explicit operator bool() const noexcept;
reference at(const typename object_type::key_type & key);
const_reference at(const typename object_type::key_type & key) const;
reference operator[](const typename object_type::key_type & key);
const_reference operator[](const typename object_type::key_type & key) const;
reference at(size_t index);
const_reference at(size_t index) const;
reference operator[](size_t index);
const_reference operator[](size_t index) const;
iterator begin() noexcept;
iterator end() noexcept;
const_iterator begin() const noexcept;
const_iterator end() const noexcept;
const_iterator cbegin() const noexcept;
const_iterator cend() const noexcept;
reference front();
const_reference front() const;
reference back();
const_reference back() const;
void clear() noexcept;
iterator insert(const_iterator pos, const element & val);
iterator insert(const_iterator pos, element && val);
iterator insert(const_iterator pos, size_type cnt, const element & val);
iterator insert(const_iterator pos, const_iterator first, const_iterator last);
iterator insert(const_iterator pos, initializer_list_t lst);
void insert(const_iterator first, const_iterator last);
void push_back(element && val);
void push_back(const element & val);
template<typename... Args> std::pair< iterator, bool > emplace(Args &&... args);
template<typename... Args> void emplace_back(Args &&... args);
template<typename Iterator, typename std::enable_if_t< std::is_same_v< Iterator, iterator > or std::is_same_v< Iterator, const_iterator >, int > = 0> Iterator erase(Iterator pos);
template<typename Iterator, typename std::enable_if_t< std::is_same_v< Iterator, iterator > or std::is_same_v< Iterator, const_iterator >, int > = 0> Iterator erase(Iterator first, Iterator last);
size_type erase(const typename object_type::key_type & key);
void erase(const size_type index);
void swap(reference other) noexcept(std::is_nothrow_move_constructible_v< value_type > and std::is_nothrow_move_assignable_v< value_type > and std::is_nothrow_move_constructible_v< element_data > and std::is_nothrow_move_assignable_v< element_data >));
template<typename T> const_iterator find(T && key) const;
bool contains(element test) const;
iteration_proxy< iterator > items() noexcept;
iteration_proxy< const_iterator > items() const noexcept;
bool empty() const;
size_t size() const;
size_t max_size() const noexcept;
element & operator-();
template<typename P, typename std::enable_if_t< std::is_pointer_v< P >, int > = 0> auto get_ptr() noexcept;
template<typename P, typename std::enable_if_t< std::is_pointer_v< P > and std::is_const_v< typename std::remove_pointer_t< P >>, int > = 0> constexpr auto get_ptr() const noexcept;
template<typename T, typename U = typename std::remove_cv_t<typename std::remove_reference_t<T>>, unspecified = 0> T as() const noexcept(noexcept(element_serializer< U >::from_element(std::declval< const element & >(), std::declval< U & >()))));
template<> bool as() const;
element
private member functionstemplate<typename... Args> iterator insert_iterator(const_iterator pos, Args... args);
object_type * get_impl_ptr(object_type *) noexcept;
constexpr const object_type * get_impl_ptr(const object_type *) const noexcept;
array_type * get_impl_ptr(array_type *) noexcept;
constexpr const array_type * get_impl_ptr(const array_type *) const noexcept;
string_type * get_impl_ptr(string_type *) noexcept;
constexpr const string_type * get_impl_ptr(const string_type *) const noexcept;
int_type * get_impl_ptr(int_type *) noexcept;
constexpr const int_type * get_impl_ptr(const int_type *) const noexcept;
float_type * get_impl_ptr(float_type *) noexcept;
constexpr const float_type * get_impl_ptr(const float_type *) const noexcept;
boolean_type * get_impl_ptr(boolean_type *) noexcept;
constexpr const boolean_type * get_impl_ptr(const boolean_type *) const noexcept;
void validate() const;