diff options
author | Jörg Frings-Fürst <debian@jff.email> | 2025-05-02 07:42:02 +0200 |
---|---|---|
committer | Jörg Frings-Fürst <debian@jff.email> | 2025-05-02 07:42:02 +0200 |
commit | fc486627a4ecbae797fa6856d8a9204ea85f4db8 (patch) | |
tree | ff3dae4c0e5d980d8e2da4fc6256ae839269bbcd /libcutl/cutl/xml/parser.ixx | |
parent | 1c188393cd2e271ed2581471b601fb5960777fd8 (diff) | |
parent | ecba0bbd9947036dd82f16ab95252f8db445e149 (diff) |
Merge tag 'debian/4.0.0-10' into developdevelop
Bugfix release
Diffstat (limited to 'libcutl/cutl/xml/parser.ixx')
-rw-r--r-- | libcutl/cutl/xml/parser.ixx | 74 |
1 files changed, 74 insertions, 0 deletions
diff --git a/libcutl/cutl/xml/parser.ixx b/libcutl/cutl/xml/parser.ixx new file mode 100644 index 0000000..65834b6 --- /dev/null +++ b/libcutl/cutl/xml/parser.ixx @@ -0,0 +1,74 @@ +// file : cutl/xml/parser.ixx +// copyright : Copyright (c) 2009-2013 Code Synthesis Tools CC +// license : MIT; see accompanying LICENSE file + +#include <cutl/xml/value-traits.hxx> + +namespace cutl +{ + namespace xml + { + inline const std::string& parser:: + attribute (const std::string& n) const + { + return attribute (qname_type (n)); + } + + template <typename T> + inline T parser:: + attribute (const std::string& n) const + { + return attribute<T> (qname_type (n)); + } + + inline std::string parser:: + attribute (const std::string& n, const std::string& dv) const + { + return attribute (qname_type (n), dv); + } + + template <typename T> + inline T parser:: + attribute (const std::string& n, const T& dv) const + { + return attribute<T> (qname_type (n), dv); + } + + template <typename T> + inline T parser:: + attribute (const qname_type& qn) const + { + return value_traits<T>::parse (attribute (qn), *this); + } + + inline bool parser:: + attribute_present (const std::string& n) const + { + return attribute_present (qname_type (n)); + } + + inline const parser::attribute_map_type& parser:: + attribute_map () const + { + if (const element_entry* e = get_element ()) + { + e->attr_unhandled_ = 0; // Assume all handled. + return e->attr_map_; + } + + return empty_attr_map_; + } + + inline void parser:: + next_expect (event_type e, const qname_type& qn) + { + return next_expect (e, qn.namespace_ (), qn.name ()); + } + + inline void parser:: + next_expect (event_type e, const std::string& n) + { + return next_expect (e, std::string (), n); + } + } +} |