From f0510d2f90467de8e8f260b47d79a9baaf9bef17 Mon Sep 17 00:00:00 2001 From: Boris Kolpackov Date: Thu, 17 Sep 2009 07:15:29 +0200 Subject: Start tracking XSD with git --- libxsd/xsd/cxx/tree/list.hxx | 132 +++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 132 insertions(+) create mode 100644 libxsd/xsd/cxx/tree/list.hxx (limited to 'libxsd/xsd/cxx/tree/list.hxx') diff --git a/libxsd/xsd/cxx/tree/list.hxx b/libxsd/xsd/cxx/tree/list.hxx new file mode 100644 index 0000000..75972c6 --- /dev/null +++ b/libxsd/xsd/cxx/tree/list.hxx @@ -0,0 +1,132 @@ +// file : xsd/cxx/tree/list.hxx +// author : Boris Kolpackov +// copyright : Copyright (c) 2005-2009 Code Synthesis Tools CC +// license : GNU GPL v2 + exceptions; see accompanying LICENSE file + +#ifndef XSD_CXX_TREE_LIST_HXX +#define XSD_CXX_TREE_LIST_HXX + +#include + +#include +#include + +#include // tree::istream +#include // tree::istream +#include // fundamental_p, sequence + +namespace xsd +{ + namespace cxx + { + namespace tree + { + // Class template for xsd:list mapping. Based on the sequence + // template. Note that I cannot get rid of 'fund' because HP + // aCC3 likes it this way. + // + template ::r> + class list; + + + // + // + template + class list: public sequence + { + public: + explicit + list (flags f = 0, container* c = 0) + : sequence (f, c) + { + } + + list (typename sequence::size_type n, const T& x) + : sequence (n, x) + { + } + + template + list (const I& b, const I& e) + : sequence (b, e) + { + } + + template + list (istream&, flags = 0, container* c = 0); + + list (const list& v, flags f = 0, container* c = 0) + : sequence (v, f, c) + { + } + + public: + list (const xercesc::DOMElement&, flags = 0, container* c = 0); + + list (const xercesc::DOMAttr&, flags = 0, container* c = 0); + + list (const std::basic_string&, + const xercesc::DOMElement*, + flags = 0, + container* c = 0); + + private: + void + init (const std::basic_string&, const xercesc::DOMElement*); + }; + + + // + // + template + class list: public sequence + { + public: + explicit + list (flags f = 0, container* c = 0) + : sequence (f, c) + { + } + + explicit + list (typename sequence::size_type n, const T& x) + : sequence (n, x) + { + } + + template + list (const I& b, const I& e) + : sequence (b, e) + { + } + + template + list (istream&, flags = 0, container* c = 0); + + list (const list& s, flags f = 0, container* c = 0) + : sequence (s, f, c) + { + } + + public: + list (const xercesc::DOMElement&, flags = 0, container* c = 0); + + list (const xercesc::DOMAttr&, flags = 0, container* c = 0); + + list (const std::basic_string&, + const xercesc::DOMElement*, + flags = 0, + container* c = 0); + + private: + void + init (const std::basic_string&, const xercesc::DOMElement*); + }; + } + } +} + +#endif // XSD_CXX_TREE_LIST_HXX -- cgit v1.1