diff options
author | Boris Kolpackov <boris@codesynthesis.com> | 2013-03-15 08:22:58 +0200 |
---|---|---|
committer | Boris Kolpackov <boris@codesynthesis.com> | 2013-03-15 08:22:58 +0200 |
commit | 927b97baaaf69e318ff7a0ce76d096375ec09da2 (patch) | |
tree | 074d633c92c99ec541e7f0631c2fd2a6c5378689 /cutl/xml/parser.ixx | |
parent | 6664a24b003f3959e2efe2893628f725a5f6746f (diff) |
Add support for returning XML attributes as map
Diffstat (limited to 'cutl/xml/parser.ixx')
-rw-r--r-- | cutl/xml/parser.ixx | 35 |
1 files changed, 35 insertions, 0 deletions
diff --git a/cutl/xml/parser.ixx b/cutl/xml/parser.ixx index 61bb05b..fa5a7b6 100644 --- a/cutl/xml/parser.ixx +++ b/cutl/xml/parser.ixx @@ -2,10 +2,45 @@ // 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 void parser:: next_expect (event_type e, const qname_type& qn) { |