45 std::variant<integer_type, float_type, std::string>
m_value;
71 if (std::holds_alternative<integer_type>(
m_value)) {
72 return static_cast<T
>(std::get<integer_type>(
m_value));
73 }
else if (std::holds_alternative<float_type>(
m_value)) {
74 return static_cast<T
>(std::get<float_type>(
m_value));
116 std::variant<std::monostate, bool, Number, std::string>
m_value;
128 Value(std::string_view ta, std::string_view s);
129 Value(std::string_view ta, std::string s);
203 [[nodiscard]]
inline auto begin()
const {
return nodes.begin(); }
205 [[nodiscard]]
inline auto end()
const {
return nodes.end(); }
206 [[nodiscard]]
inline auto end() {
return nodes.end(); }
struct kdl_number kdl_number
struct _kdl_parser kdl_parser
struct kdl_value kdl_value
DocumentResult parse(std::string_view kdl_text)
DocumentResult(std::string error)
DocumentResult(Document doc)
std::optional< Document > document
std::optional< std::string > to_string() const
Document(Document &&)=default
std::optional< std::string > to_string(Version version) const
Document & operator=(Document &&)=default
Document(Document const &)=default
Document & operator=(Document const &)=default
Document(std::vector< Node > nodes)
std::vector< Node > nodes
Document(std::initializer_list< Node > nodes)
void remove_type_annotation()
HasTypeAnnotation(std::string_view t)
bool operator!=(const HasTypeAnnotation &) const =default
std::optional< std::string > type_annotation
bool operator==(const HasTypeAnnotation &) const =default
HasTypeAnnotation()=default
std::map< std::string, Value, std::less<> > properties
Node & operator=(Node &&)=default
Node(std::string_view ta, std::string_view name)
Node & operator=(Node const &)=default
Node(Node const &)=default
std::vector< Node > children
Node(std::string_view name, std::vector< Value > args, std::map< std::string, Value, std::less<> > properties, std::vector< Node > children)
std::vector< Value > args
Node(std::string_view name)
Node(std::string_view ta, std::string_view name, std::vector< Value > args, std::map< std::string, Value, std::less<> > properties, std::vector< Node > children)
Number(const kdl_number &n)
std::optional< T > as() const
std::variant< integer_type, float_type, std::string > m_value
NumberType type() const noexcept
Number & operator=(Number &&)=default
Number(Number &&)=default
Number(Number const &)=default
bool operator!=(const Number &) const =default
Number & operator=(Number const &)=default
bool operator==(const Number &) const =default
Value & operator=(bool b)
Value(into_number_concept auto n)
Value & operator=(Value &&)=default
Value & operator=(Number const &n)
bool operator==(const Value &) const =default
Value & operator=(Value const &)=default
Value(Value const &)=default
Value(std::string_view ta, Number n)
Value(std::string_view ta, bool b)
Value(std::string_view ta, std::string_view s)
Value(kdl_value const &val)
bool operator!=(const Value &) const =default
const Number & as_number() const
Type type() const noexcept
Value & operator=(Number &&n)
Value(std::string_view ta, std::string s)
Value(std::string_view s)
const std::string & as_string() const
Value & operator=(std::string_view s)
Value & operator=(std::string s)
Value & operator=(into_number_concept auto n)
Value(std::string_view type_annotation, into_number_concept auto n)
std::variant< std::monostate, bool, Number, std::string > m_value