From 927b97baaaf69e318ff7a0ce76d096375ec09da2 Mon Sep 17 00:00:00 2001 From: Boris Kolpackov Date: Fri, 15 Mar 2013 08:22:58 +0200 Subject: Add support for returning XML attributes as map --- cutl/xml/parser.ixx | 35 +++++++++++++++++++++++++++++++++++ 1 file changed, 35 insertions(+) (limited to 'cutl/xml/parser.ixx') 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 + namespace cutl { namespace xml { + inline const std::string& parser:: + attribute (const std::string& n) const + { + return attribute (qname_type (n)); + } + + template + inline T parser:: + attribute (const std::string& n) const + { + return attribute (qname_type (n)); + } + + inline std::string parser:: + attribute (const std::string& n, const std::string& dv) const + { + return attribute (qname_type (n), dv); + } + + template + inline T parser:: + attribute (const std::string& n, const T& dv) const + { + return attribute (qname_type (n), dv); + } + + template + inline T parser:: + attribute (const qname_type& qn) const + { + return value_traits::parse (attribute (qn), *this); + } + inline void parser:: next_expect (event_type e, const qname_type& qn) { -- cgit v1.1