23#include <boost/format.hpp>
50 element_type_not_found(std::string
const& aType, std::string
const& aParentElement) :
std::runtime_error{
"Element type '" + aType +
"' not found for element '" + aParentElement +
"'." } {}
55 element_data_not_found(std::string
const& aData, std::string
const& aParentElement) :
std::runtime_error{
"Element data '" + aData +
"' not found for element '" + aParentElement +
"'." } {}
89 std::string
indent(int32_t aLevel)
const
99 do_source_location(location);
126 template <
typename T>
127 const abstract_t<T>&
get(std::string
const& aKey)
const
129 return get_data(aKey).get<abstract_t<T>>();
131 template <
typename T>
132 abstract_t<T>&
get(std::string
const& aKey)
134 return get_data(aKey).get<abstract_t<T>>();
136 template <
typename T>
141 if constexpr (std::is_integral_v<T> && !std::is_same_v<T, bool>)
142 return static_cast<T
>(
get_data(aKey).get<int64_t>());
144 return get_data(aKey).get<abstract_t<T>>();
149 template <
typename T>
157 template <
typename T,
typename U>
158 const abstract_t<T>&
get(std::string
const& aKey,
const U& aDefault)
const
161 return get_data(aKey).get<abstract_t<T>>();
165 template <
typename T,
typename U>
166 abstract_t<T>&
get(std::string
const& aKey, U& aDefault)
169 return get_data(aKey).get<abstract_t<T>>();
174 void emit(std::string
const& aArgument)
const
178 template <
typename T>
179 void emit(std::string
const& aFormat,
const T& aArgument)
const
183 template <
typename T1,
typename T2>
184 void emit(std::string
const& aFormat,
const T1& aArgument1,
const T2& aArgument2)
const
188 template <
typename T1,
typename T2,
typename T3>
189 void emit(std::string
const& aFormat,
const T1& aArgument1,
const T2& aArgument2,
const T3& aArgument3)
const
191 emit(
neolib::string{ (boost::format(aFormat) % aArgument1 % aArgument2 % aArgument3).str() });
193 template <
typename T1,
typename T2,
typename T3,
typename T4>
194 void emit(std::string
const& aFormat,
const T1& aArgument1,
const T2& aArgument2,
const T3& aArgument3,
const T4& aArgument4)
const
196 emit(
neolib::string{ (boost::format(aFormat) % aArgument1 % aArgument2 % aArgument3 % aArgument4).str() });
198 template <
typename T1,
typename T2,
typename T3,
typename T4,
typename T5>
199 void emit(std::string
const& aFormat,
const T1& aArgument1,
const T2& aArgument2,
const T3& aArgument3,
const T4& aArgument4,
const T5& aArgument5)
const
201 emit(
neolib::string{ (boost::format(aFormat) % aArgument1 % aArgument2 % aArgument3 % aArgument4 % aArgument5).str() });
neolib::string generate_anonymous_id() const
neolib::i_simple_variant data_t
const data_t & get_data(std::string const &aKey) const
void emit(std::string const &aFormat, const T1 &aArgument1, const T2 &aArgument2, const T3 &aArgument3) const
const abstract_t< T > & get(std::string const &aKey, const U &aDefault) const
void emit(std::string const &aFormat, const T &aArgument) const
virtual void index(const neolib::i_string &aId, const i_ui_element &aElement) const =0
virtual const neolib::i_string & element_namespace() const =0
virtual void emit(const neolib::i_string &aText) const =0
virtual const neolib::i_string & current_element() const =0
neolib::i_vector< neolib::i_simple_variant > array_data_t
std::string indent(int32_t aLevel) const
neolib::optional< T > get_optional_enum(std::string const &aKey) const
virtual void indent(int32_t aLevel, neolib::i_string &aResult) const =0
abstract_t< T > & get(std::string const &aKey)
data_t & get_data(std::string const &aKey)
bool data_exists(std::string const &aKey) const
const array_data_t & get_array_data(std::string const &aKey) const
std::string source_location() const
const abstract_t< T > & get(std::string const &aKey) const
abstract_t< T > & get(std::string const &aKey, U &aDefault)
virtual const i_ui_element * find(const neolib::i_string &aId) const =0
bool array_data_exists(std::string const &aKey) const
virtual void generate_anonymous_id(neolib::i_string &aNewAnonymousId) const =0
void emit(std::string const &aFormat, const T1 &aArgument1, const T2 &aArgument2) const
void emit(std::string const &aFormat, const T1 &aArgument1, const T2 &aArgument2, const T3 &aArgument3, const T4 &aArgument4) const
virtual const i_ui_element & at(const neolib::i_string &aId) const =0
virtual const neolib::i_string & current_fragment() const =0
neolib::optional< T > get_optional(std::string const &aKey) const
void emit(std::string const &aArgument) const
void emit(std::string const &aFormat, const T1 &aArgument1, const T2 &aArgument2, const T3 &aArgument3, const T4 &aArgument4, const T5 &aArgument5) const
array_data_t & get_array_data(std::string const &aKey)
std::string to_std_string() const
ref_ptr< ConcreteType > make_ref(Args &&... args)
duplicate_element_id(std::string const &aId)
element_data_not_found(std::string const &aData)
element_data_not_found(std::string const &aData, std::string const &aParentElement)
element_not_found(std::string const &aId)
element_type_not_found(std::string const &aType, std::string const &aParentElement)
element_type_not_found(std::string const &aType)