Debian Codegraph @

cutl/xml/parser.txx

raw
1 // file : cutl/xml/parser.txx
2 // copyright : Copyright (c) 2009-2013 Code Synthesis Tools CC
3 // license : MIT; see accompanying LICENSE file
4
5 #include <cutl/xml/value-traits.hxx>
6
7 namespace cutl
8 {
9 namespace xml
10 {
11 template <typename T>
12 T parser::
13 attribute (const qname_type& qn, const T& dv) const
14 {
15 if (const element_entry* e = get_element ())
16 {
17 attribute_map_type::const_iterator i (e->attr_map_.find (qn));
18
19 if (i != e->attr_map_.end ())
20 {
21 if (!i->second.handled)
22 {
23 i->second.handled = true;
24 e->attr_unhandled_--;
25 }
26 return value_traits<T>::parse (i->second.value, *this);
27 }
28 }
29
30 return dv;
31 }
32 }
33 }