diff options
Diffstat (limited to 'libxsd/xsd/cxx/tree/parsing')
-rw-r--r-- | libxsd/xsd/cxx/tree/parsing/boolean.hxx | 74 | ||||
-rw-r--r-- | libxsd/xsd/cxx/tree/parsing/byte.hxx | 78 | ||||
-rw-r--r-- | libxsd/xsd/cxx/tree/parsing/date-time.txx | 700 | ||||
-rw-r--r-- | libxsd/xsd/cxx/tree/parsing/decimal.hxx | 83 | ||||
-rw-r--r-- | libxsd/xsd/cxx/tree/parsing/double.hxx | 92 | ||||
-rw-r--r-- | libxsd/xsd/cxx/tree/parsing/element-map.txx | 40 | ||||
-rw-r--r-- | libxsd/xsd/cxx/tree/parsing/float.hxx | 92 | ||||
-rw-r--r-- | libxsd/xsd/cxx/tree/parsing/int.hxx | 78 | ||||
-rw-r--r-- | libxsd/xsd/cxx/tree/parsing/long.hxx | 78 | ||||
-rw-r--r-- | libxsd/xsd/cxx/tree/parsing/short.hxx | 78 | ||||
-rw-r--r-- | libxsd/xsd/cxx/tree/parsing/unsigned-byte.hxx | 78 | ||||
-rw-r--r-- | libxsd/xsd/cxx/tree/parsing/unsigned-int.hxx | 78 | ||||
-rw-r--r-- | libxsd/xsd/cxx/tree/parsing/unsigned-long.hxx | 78 | ||||
-rw-r--r-- | libxsd/xsd/cxx/tree/parsing/unsigned-short.hxx | 78 |
14 files changed, 0 insertions, 1705 deletions
diff --git a/libxsd/xsd/cxx/tree/parsing/boolean.hxx b/libxsd/xsd/cxx/tree/parsing/boolean.hxx deleted file mode 100644 index 64cf5bf..0000000 --- a/libxsd/xsd/cxx/tree/parsing/boolean.hxx +++ /dev/null @@ -1,74 +0,0 @@ -// file : xsd/cxx/tree/parsing/boolean.hxx -// license : GNU GPL v2 + exceptions; see accompanying LICENSE file - -#ifndef XSD_CXX_TREE_PARSING_BOOLEAN_HXX -#define XSD_CXX_TREE_PARSING_BOOLEAN_HXX - -#include <xsd/cxx/ro-string.hxx> -#include <xsd/cxx/zc-istream.hxx> - -#include <xsd/cxx/xml/string.hxx> // xml::transcode - -#include <xsd/cxx/tree/text.hxx> // text_content -#include <xsd/cxx/tree/bits/literals.hxx> - -namespace xsd -{ - namespace cxx - { - namespace tree - { - template <typename C> - struct traits<bool, C, schema_type::other> - { - typedef bool type; - - static type - create (const xercesc::DOMElement& e, flags f, container* c); - - static type - create (const xercesc::DOMAttr& a, flags f, container* c); - - static type - create (const std::basic_string<C>& s, - const xercesc::DOMElement*, - flags, - container*); - }; - - template <typename C> - bool traits<bool, C, schema_type::other>:: - create (const xercesc::DOMElement& e, flags f, container* c) - { - return create (tree::text_content<C> (e), 0, f, c); - } - - template <typename C> - bool traits<bool, C, schema_type::other>:: - create (const xercesc::DOMAttr& a, flags f, container* c) - { - return create (xml::transcode<C> (a.getValue ()), 0, f, c); - } - - template <typename C> - bool traits<bool, C, schema_type::other>:: - create (const std::basic_string<C>& s, - const xercesc::DOMElement*, - flags, - container*) - { - // This type cannot have whitespaces in its values. As result we - // don't need to waste time collapsing whitespaces. All we need to - // do is trim the string representation which can be done without - // copying. - // - ro_string<C> tmp (s); - trim (tmp); - - return tmp == bits::true_<C> () || tmp == bits::one<C> (); - } - } - } -} - -#endif // XSD_CXX_TREE_PARSING_BOOLEAN_HXX diff --git a/libxsd/xsd/cxx/tree/parsing/byte.hxx b/libxsd/xsd/cxx/tree/parsing/byte.hxx deleted file mode 100644 index 8fc4d8f..0000000 --- a/libxsd/xsd/cxx/tree/parsing/byte.hxx +++ /dev/null @@ -1,78 +0,0 @@ -// file : xsd/cxx/tree/parsing/byte.hxx -// license : GNU GPL v2 + exceptions; see accompanying LICENSE file - -#ifndef XSD_CXX_TREE_PARSING_BYTE_HXX -#define XSD_CXX_TREE_PARSING_BYTE_HXX - -#include <xsd/cxx/ro-string.hxx> -#include <xsd/cxx/zc-istream.hxx> - -#include <xsd/cxx/xml/string.hxx> // xml::transcode - -#include <xsd/cxx/tree/text.hxx> // text_content - -namespace xsd -{ - namespace cxx - { - namespace tree - { - template <typename C> - struct traits<signed char, C, schema_type::other> - { - typedef signed char type; - - static type - create (const xercesc::DOMElement& e, flags f, container* c); - - static type - create (const xercesc::DOMAttr& a, flags f, container* c); - - static type - create (const std::basic_string<C>& s, - const xercesc::DOMElement*, - flags, - container*); - }; - - template <typename C> - signed char traits<signed char, C, schema_type::other>:: - create (const xercesc::DOMElement& e, flags f, container* c) - { - return create (tree::text_content<C> (e), 0, f, c); - } - - template <typename C> - signed char traits<signed char, C, schema_type::other>:: - create (const xercesc::DOMAttr& a, flags f, container* c) - { - return create (xml::transcode<C> (a.getValue ()), 0, f, c); - } - - template <typename C> - signed char traits<signed char, C, schema_type::other>:: - create (const std::basic_string<C>& s, - const xercesc::DOMElement*, - flags, - container*) - { - // This type cannot have whitespaces in its values. As result we - // don't need to waste time collapsing whitespaces. All we need to - // do is trim the string representation which can be done without - // copying. - // - ro_string<C> tmp (s); - trim (tmp); - - zc_istream<C> is (tmp); - - short t; - is >> t; - - return static_cast<type> (t); - } - } - } -} - -#endif // XSD_CXX_TREE_PARSING_BYTE_HXX diff --git a/libxsd/xsd/cxx/tree/parsing/date-time.txx b/libxsd/xsd/cxx/tree/parsing/date-time.txx deleted file mode 100644 index 04f8f48..0000000 --- a/libxsd/xsd/cxx/tree/parsing/date-time.txx +++ /dev/null @@ -1,700 +0,0 @@ -// file : xsd/cxx/tree/parsing/date-time.txx -// license : GNU GPL v2 + exceptions; see accompanying LICENSE file - -#include <xsd/cxx/ro-string.hxx> -#include <xsd/cxx/zc-istream.hxx> - -#include <xsd/cxx/xml/string.hxx> // xml::transcode - -#include <xsd/cxx/tree/text.hxx> // text_content - -namespace xsd -{ - namespace cxx - { - namespace tree - { - // time_zone - // - template <typename C> - void time_zone:: - zone_parse (const C* s, std::size_t n) - { - // time_zone := Z|(+|-)HH:MM - // - if (n == 0) - { - return; - } - else if (s[0] == C ('Z')) - { - hours_ = 0; - minutes_ = 0; - present_ = true; - } - else if (n == 6) - { - // Parse hours. - // - hours_ = 10 * (s[1] - C ('0')) + (s[2] - C ('0')); - - // Parse minutes. - // - minutes_ = 10 * (s[4] - C ('0')) + (s[5] - C ('0')); - - if (s[0] == C ('-')) - { - hours_ = -hours_; - minutes_ = -minutes_; - } - present_ = true; - } - } - - // gday - // - template <typename C, typename B> - gday<C, B>:: - gday (const xercesc::DOMElement& e, flags f, container* c) - : B (e, f, c) - { - parse (tree::text_content<C> (e)); - } - - template <typename C, typename B> - gday<C, B>:: - gday (const xercesc::DOMAttr& a, flags f, container* c) - : B (a, f, c) - { - parse (xml::transcode<C> (a.getValue ())); - } - - template <typename C, typename B> - gday<C, B>:: - gday (const std::basic_string<C>& s, - const xercesc::DOMElement* e, - flags f, - container* c) - : B (s, e, f, c) - { - parse (s); - } - - template <typename C, typename B> - void gday<C, B>:: - parse (const std::basic_string<C>& str) - { - typedef typename ro_string<C>::size_type size_type; - - ro_string<C> tmp (str); - size_type n (trim (tmp)); - const C* s (tmp.data ()); - - // gday := ---DD[Z|(+|-)HH:MM] - // - if (n >= 5) - { - day_ = 10 * (s[3] - C ('0')) + (s[4] - C ('0')); - - if (n > 5) - zone_parse (s + 5, n - 5); - } - } - - // gmonth - // - template <typename C, typename B> - gmonth<C, B>:: - gmonth (const xercesc::DOMElement& e, flags f, container* c) - : B (e, f, c) - { - parse (tree::text_content<C> (e)); - } - - template <typename C, typename B> - gmonth<C, B>:: - gmonth (const xercesc::DOMAttr& a, flags f, container* c) - : B (a, f, c) - { - parse (xml::transcode<C> (a.getValue ())); - } - - template <typename C, typename B> - gmonth<C, B>:: - gmonth (const std::basic_string<C>& s, - const xercesc::DOMElement* e, - flags f, - container* c) - : B (s, e, f, c) - { - parse (s); - } - - template <typename C, typename B> - void gmonth<C, B>:: - parse (const std::basic_string<C>& str) - { - typedef typename ro_string<C>::size_type size_type; - - ro_string<C> tmp (str); - size_type n (trim (tmp)); - const C* s (tmp.data ()); - - // gmonth := --MM[Z|(+|-)HH:MM] - // - if (n >= 4) - { - month_ = 10 * (s[2] - C ('0')) + (s[3] - C ('0')); - - if (n > 4) - zone_parse (s + 4, n - 4); - } - } - - // gyear - // - template <typename C, typename B> - gyear<C, B>:: - gyear (const xercesc::DOMElement& e, flags f, container* c) - : B (e, f, c) - { - parse (tree::text_content<C> (e)); - } - - template <typename C, typename B> - gyear<C, B>:: - gyear (const xercesc::DOMAttr& a, flags f, container* c) - : B (a, f, c) - { - parse (xml::transcode<C> (a.getValue ())); - } - - template <typename C, typename B> - gyear<C, B>:: - gyear (const std::basic_string<C>& s, - const xercesc::DOMElement* e, - flags f, - container* c) - : B (s, e, f, c) - { - parse (s); - } - - template <typename C, typename B> - void gyear<C, B>:: - parse (const std::basic_string<C>& str) - { - typedef typename ro_string<C>::size_type size_type; - - ro_string<C> tmp (str); - size_type n (trim (tmp)); - const C* s (tmp.data ()); - - // gyear := [-]CCYY[N]*[Z|(+|-)HH:MM] - // - if (n >= 4) - { - // Find the end of the year token. - // - size_type pos (4); - for (; pos < n; ++pos) - { - C c (s[pos]); - - if (c == C ('Z') || c == C ('+') || c == C ('-')) - break; - } - - ro_string<C> year_fragment (s, pos); - zc_istream<C> is (year_fragment); - is >> year_; - - if (pos < n) - zone_parse (s + pos, n - pos); - } - } - - // gmonth_day - // - template <typename C, typename B> - gmonth_day<C, B>:: - gmonth_day (const xercesc::DOMElement& e, flags f, container* c) - : B (e, f, c) - { - parse (tree::text_content<C> (e)); - } - - template <typename C, typename B> - gmonth_day<C, B>:: - gmonth_day (const xercesc::DOMAttr& a, flags f, container* c) - : B (a, f, c) - { - parse (xml::transcode<C> (a.getValue ())); - } - - template <typename C, typename B> - gmonth_day<C, B>:: - gmonth_day (const std::basic_string<C>& s, - const xercesc::DOMElement* e, - flags f, - container* c) - : B (s, e, f, c) - { - parse (s); - } - - template <typename C, typename B> - void gmonth_day<C, B>:: - parse (const std::basic_string<C>& str) - { - typedef typename ro_string<C>::size_type size_type; - - ro_string<C> tmp (str); - size_type n (trim (tmp)); - const C* s (tmp.data ()); - - // gmonth_day := --MM-DD[Z|(+|-)HH:MM] - // - if (n >= 7) - { - month_ = 10 * (s[2] - C ('0')) + (s[3] - C ('0')); - day_ = 10 * (s[5] - C ('0')) + (s[6] - C ('0')); - - if (n > 7) - zone_parse (s + 7, n - 7); - } - } - - // gyear_month - // - template <typename C, typename B> - gyear_month<C, B>:: - gyear_month (const xercesc::DOMElement& e, flags f, container* c) - : B (e, f, c) - { - parse (tree::text_content<C> (e)); - } - - template <typename C, typename B> - gyear_month<C, B>:: - gyear_month (const xercesc::DOMAttr& a, flags f, container* c) - : B (a, f, c) - { - parse (xml::transcode<C> (a.getValue ())); - } - - template <typename C, typename B> - gyear_month<C, B>:: - gyear_month (const std::basic_string<C>& s, - const xercesc::DOMElement* e, - flags f, - container* c) - : B (s, e, f, c) - { - parse (s); - } - - template <typename C, typename B> - void gyear_month<C, B>:: - parse (const std::basic_string<C>& str) - { - typedef typename ro_string<C>::size_type size_type; - - ro_string<C> tmp (str); - size_type n (trim (tmp)); - const C* s (tmp.data ()); - - // gyear_month := [-]CCYY[N]*-MM[Z|(+|-)HH:MM] - // - - if (n >= 7) - { - // Find the end of the year token. - // - size_type pos (tmp.find (C ('-'), 4)); - - if (pos != ro_string<C>::npos && (n - pos - 1) >= 2) - { - ro_string<C> year_fragment (s, pos); - zc_istream<C> is (year_fragment); - is >> year_; - - month_ = 10 * (s[pos + 1] - C ('0')) + (s[pos + 2] - C ('0')); - - pos += 3; - - if (pos < n) - zone_parse (s + pos, n - pos); - } - } - } - - // date - // - template <typename C, typename B> - date<C, B>:: - date (const xercesc::DOMElement& e, flags f, container* c) - : B (e, f, c) - { - parse (tree::text_content<C> (e)); - } - - template <typename C, typename B> - date<C, B>:: - date (const xercesc::DOMAttr& a, flags f, container* c) - : B (a, f, c) - { - parse (xml::transcode<C> (a.getValue ())); - } - - template <typename C, typename B> - date<C, B>:: - date (const std::basic_string<C>& s, - const xercesc::DOMElement* e, - flags f, - container* c) - : B (s, e, f, c) - { - parse (s); - } - - template <typename C, typename B> - void date<C, B>:: - parse (const std::basic_string<C>& str) - { - typedef typename ro_string<C>::size_type size_type; - - ro_string<C> tmp (str); - size_type n (trim (tmp)); - const C* s (tmp.data ()); - - // date := [-]CCYY[N]*-MM-DD[Z|(+|-)HH:MM] - // - - if (n >= 10) - { - // Find the end of the year token. - // - size_type pos (tmp.find (C ('-'), 4)); - - if (pos != ro_string<C>::npos && (n - pos - 1) >= 5) - { - ro_string<C> year_fragment (s, pos); - zc_istream<C> is (year_fragment); - is >> year_; - - month_ = 10 * (s[pos + 1] - C ('0')) + (s[pos + 2] - C ('0')); - day_ = 10 * (s[pos + 4] - C ('0')) + (s[pos + 5] - C ('0')); - - pos += 6; - - if (pos < n) - zone_parse (s + pos, n - pos); - } - } - } - - // time - // - template <typename C, typename B> - time<C, B>:: - time (const xercesc::DOMElement& e, flags f, container* c) - : B (e, f, c) - { - parse (tree::text_content<C> (e)); - } - - template <typename C, typename B> - time<C, B>:: - time (const xercesc::DOMAttr& a, flags f, container* c) - : B (a, f, c) - { - parse (xml::transcode<C> (a.getValue ())); - } - - template <typename C, typename B> - time<C, B>:: - time (const std::basic_string<C>& s, - const xercesc::DOMElement* e, - flags f, - container* c) - : B (s, e, f, c) - { - parse (s); - } - - template <typename C, typename B> - void time<C, B>:: - parse (const std::basic_string<C>& str) - { - typedef typename ro_string<C>::size_type size_type; - - ro_string<C> tmp (str); - size_type n (trim (tmp)); - const C* s (tmp.data ()); - - // time := HH:MM:SS[.S+][Z|(+|-)HH:MM] - // - - if (n >= 8) - { - hours_ = 10 * (s[0] - '0') + (s[1] - '0'); - minutes_ = 10 * (s[3] - '0') + (s[4] - '0'); - - // Find the end of the seconds fragment. - // - size_type pos (8); - for (; pos < n; ++pos) - { - C c (s[pos]); - - if (c == C ('Z') || c == C ('+') || c == C ('-')) - break; - } - - ro_string<C> seconds_fragment (s + 6, pos - 6); - zc_istream<C> is (seconds_fragment); - is >> seconds_; - - if (pos < n) - zone_parse (s + pos, n - pos); - } - } - - // date_time - // - template <typename C, typename B> - date_time<C, B>:: - date_time (const xercesc::DOMElement& e, flags f, container* c) - : B (e, f, c) - { - parse (tree::text_content<C> (e)); - } - - template <typename C, typename B> - date_time<C, B>:: - date_time (const xercesc::DOMAttr& a, flags f, container* c) - : B (a, f, c) - { - parse (xml::transcode<C> (a.getValue ())); - } - - template <typename C, typename B> - date_time<C, B>:: - date_time (const std::basic_string<C>& s, - const xercesc::DOMElement* e, - flags f, - container* c) - : B (s, e, f, c) - { - parse (s); - } - - template <typename C, typename B> - void date_time<C, B>:: - parse (const std::basic_string<C>& str) - { - typedef typename ro_string<C>::size_type size_type; - - ro_string<C> tmp (str); - size_type n (trim (tmp)); - const C* s (tmp.data ()); - - // date_time := [-]CCYY[N]*-MM-DDTHH:MM:SS[.S+][Z|(+|-)HH:MM] - // - - if (n >= 19) - { - // Find the end of the year token. - // - size_type pos (tmp.find (C ('-'), 4)); - - if (pos != ro_string<C>::npos && (n - pos - 1) >= 14) - { - ro_string<C> year_fragment (s, pos); - zc_istream<C> yis (year_fragment); - yis >> year_; - - month_ = 10 * (s[pos + 1] - C ('0')) + (s[pos + 2] - C ('0')); - pos += 3; - - day_ = 10 * (s[pos + 1] - C ('0')) + (s[pos + 2] - C ('0')); - pos += 3; - - hours_ = 10 * (s[pos + 1] - C ('0')) + (s[pos + 2] - C ('0')); - pos += 3; - - minutes_ = 10 * (s[pos + 1] - C ('0')) + (s[pos + 2] - C ('0')); - pos += 4; // Point to the first S. - - // Find the end of the seconds fragment. - // - size_type sec_end (pos + 2); - for (; sec_end < n; ++sec_end) - { - C c (s[sec_end]); - - if (c == C ('Z') || c == C ('+') || c == C ('-')) - break; - } - - ro_string<C> seconds_fragment (s + pos, sec_end - pos); - zc_istream<C> sis (seconds_fragment); - sis >> seconds_; - - if (sec_end < n) - zone_parse (s + sec_end, n - sec_end); - } - } - } - - // duration - // - template <typename C, typename B> - duration<C, B>:: - duration (const xercesc::DOMElement& e, flags f, container* c) - : B (e, f, c) - { - parse (tree::text_content<C> (e)); - } - - template <typename C, typename B> - duration<C, B>:: - duration (const xercesc::DOMAttr& a, flags f, container* c) - : B (a, f, c) - { - parse (xml::transcode<C> (a.getValue ())); - } - - template <typename C, typename B> - duration<C, B>:: - duration (const std::basic_string<C>& s, - const xercesc::DOMElement* e, - flags f, - container* c) - : B (s, e, f, c) - { - parse (s); - } - - namespace bits - { - template <typename C> - inline typename ro_string<C>::size_type - duration_delim (const C* s, - typename ro_string<C>::size_type pos, - typename ro_string<C>::size_type size) - { - const C* p (s + pos); - for (; p < (s + size); ++p) - { - if (*p == C ('Y') || *p == C ('D') || *p == C ('M') || - *p == C ('H') || *p == C ('M') || *p == C ('S') || - *p == C ('T')) - break; - } - - return p - s; - } - } - - template <typename C, typename B> - void duration<C, B>:: - parse (const std::basic_string<C>& str) - { - typedef typename ro_string<C>::size_type size_type; - - ro_string<C> tmp (str); - size_type n (trim (tmp)); - const C* s (tmp.data ()); - - // Set all the fields since some of them may not be specified. - // - years_ = months_ = days_ = hours_ = minutes_ = 0; - seconds_ = 0.0; - - // duration := [-]P[nY][nM][nD][TnHnMn[.n+]S] - // - if (n >= 3) - { - size_type pos (0); - - if (s[0] == C ('-')) - { - negative_ = true; - pos++; - } - else - negative_ = false; - - pos++; // Skip 'P'. - - size_type del (bits::duration_delim (s, pos, n)); - - if (del != n && s[del] == C ('Y')) - { - ro_string<C> fragment (s + pos, del - pos); - zc_istream<C> is (fragment); - is >> years_; - - pos = del + 1; - del = bits::duration_delim (s, pos, n); - } - - if (del != n && s[del] == C ('M')) - { - ro_string<C> fragment (s + pos, del - pos); - zc_istream<C> is (fragment); - is >> months_; - - pos = del + 1; - del = bits::duration_delim (s, pos, n); - } - - if (del != n && s[del] == C ('D')) - { - ro_string<C> fragment (s + pos, del - pos); - zc_istream<C> is (fragment); - is >> days_; - - pos = del + 1; - del = bits::duration_delim (s, pos, n); - } - - if (del != n && s[del] == C ('T')) - { - pos = del + 1; - del = bits::duration_delim (s, pos, n); - - if (del != n && s[del] == C ('H')) - { - ro_string<C> fragment (s + pos, del - pos); - zc_istream<C> is (fragment); - is >> hours_; - - pos = del + 1; - del = bits::duration_delim (s, pos, n); - } - - if (del != n && s[del] == C ('M')) - { - ro_string<C> fragment (s + pos, del - pos); - zc_istream<C> is (fragment); - is >> minutes_; - - pos = del + 1; - del = bits::duration_delim (s, pos, n); - } - - if (del != n && s[del] == C ('S')) - { - ro_string<C> fragment (s + pos, del - pos); - zc_istream<C> is (fragment); - is >> seconds_; - } - } - } - } - } - } -} diff --git a/libxsd/xsd/cxx/tree/parsing/decimal.hxx b/libxsd/xsd/cxx/tree/parsing/decimal.hxx deleted file mode 100644 index 07128f9..0000000 --- a/libxsd/xsd/cxx/tree/parsing/decimal.hxx +++ /dev/null @@ -1,83 +0,0 @@ -// file : xsd/cxx/tree/parsing/decimal.hxx -// license : GNU GPL v2 + exceptions; see accompanying LICENSE file - -#ifndef XSD_CXX_TREE_PARSING_DECIMAL_HXX -#define XSD_CXX_TREE_PARSING_DECIMAL_HXX - -#include <limits> -#include <locale> - -#include <xsd/cxx/ro-string.hxx> -#include <xsd/cxx/zc-istream.hxx> - -#include <xsd/cxx/xml/string.hxx> // xml::transcode - -#include <xsd/cxx/tree/text.hxx> // text_content -#include <xsd/cxx/tree/bits/literals.hxx> - -namespace xsd -{ - namespace cxx - { - namespace tree - { - template <typename C> - struct traits<double, C, schema_type::decimal> - { - typedef double type; - - static type - create (const xercesc::DOMElement& e, flags f, container* c); - - static type - create (const xercesc::DOMAttr& a, flags f, container* c); - - static type - create (const std::basic_string<C>& s, - const xercesc::DOMElement*, - flags, - container*); - }; - - template <typename C> - double traits<double, C, schema_type::decimal>:: - create (const xercesc::DOMElement& e, flags f, container* c) - { - return create (tree::text_content<C> (e), 0, f, c); - } - - template <typename C> - double traits<double, C, schema_type::decimal>:: - create (const xercesc::DOMAttr& a, flags f, container* c) - { - return create (xml::transcode<C> (a.getValue ()), 0, f, c); - } - - template <typename C> - double traits<double, C, schema_type::decimal>:: - create (const std::basic_string<C>& s, - const xercesc::DOMElement*, - flags, - container*) - { - // This type cannot have whitespaces in its values. As result we - // don't need to waste time collapsing whitespaces. All we need to - // do is trim the string representation which can be done without - // copying. - // - ro_string<C> tmp (s); - trim (tmp); - - zc_istream<C> is (tmp); - is.imbue (std::locale::classic ()); - - type t; - is >> t; - - return t; - } - } - } -} - -#endif // XSD_CXX_TREE_PARSING_DECIMAL_HXX diff --git a/libxsd/xsd/cxx/tree/parsing/double.hxx b/libxsd/xsd/cxx/tree/parsing/double.hxx deleted file mode 100644 index 7e1a7cc..0000000 --- a/libxsd/xsd/cxx/tree/parsing/double.hxx +++ /dev/null @@ -1,92 +0,0 @@ -// file : xsd/cxx/tree/parsing/double.hxx -// license : GNU GPL v2 + exceptions; see accompanying LICENSE file - -#ifndef XSD_CXX_TREE_PARSING_DOUBLE_HXX -#define XSD_CXX_TREE_PARSING_DOUBLE_HXX - -#include <limits> -#include <locale> - -#include <xsd/cxx/ro-string.hxx> -#include <xsd/cxx/zc-istream.hxx> - -#include <xsd/cxx/xml/string.hxx> // xml::transcode - -#include <xsd/cxx/tree/text.hxx> // text_content -#include <xsd/cxx/tree/bits/literals.hxx> - -namespace xsd -{ - namespace cxx - { - namespace tree - { - template <typename C> - struct traits<double, C, schema_type::double_> - { - typedef double type; - - static type - create (const xercesc::DOMElement& e, flags f, container* c); - - static type - create (const xercesc::DOMAttr& a, flags f, container* c); - - static type - create (const std::basic_string<C>& s, - const xercesc::DOMElement*, - flags, - container*); - }; - - template <typename C> - double traits<double, C, schema_type::double_>:: - create (const xercesc::DOMElement& e, flags f, container* c) - { - return create (tree::text_content<C> (e), 0, f, c); - } - - template <typename C> - double traits<double, C, schema_type::double_>:: - create (const xercesc::DOMAttr& a, flags f, container* c) - { - return create (xml::transcode<C> (a.getValue ()), 0, f, c); - } - - template <typename C> - double traits<double, C, schema_type::double_>:: - create (const std::basic_string<C>& s, - const xercesc::DOMElement*, - flags, - container*) - { - // This type cannot have whitespaces in its values. As result we - // don't need to waste time collapsing whitespaces. All we need to - // do is trim the string representation which can be done without - // copying. - // - ro_string<C> tmp (s); - trim (tmp); - - if (tmp == bits::positive_inf<C> ()) - return std::numeric_limits<double>::infinity (); - - if (tmp == bits::negative_inf<C> ()) - return -std::numeric_limits<double>::infinity (); - - if (tmp == bits::nan<C> ()) - return std::numeric_limits<double>::quiet_NaN (); - - zc_istream<C> is (tmp); - is.imbue (std::locale::classic ()); - - type t; - is >> t; - - return t; - } - } - } -} - -#endif // XSD_CXX_TREE_PARSING_DOUBLE_HXX diff --git a/libxsd/xsd/cxx/tree/parsing/element-map.txx b/libxsd/xsd/cxx/tree/parsing/element-map.txx deleted file mode 100644 index a6b1e31..0000000 --- a/libxsd/xsd/cxx/tree/parsing/element-map.txx +++ /dev/null @@ -1,40 +0,0 @@ -// file : xsd/cxx/tree/parsing/element-map.txx -// license : GNU GPL v2 + exceptions; see accompanying LICENSE file - -#ifndef XSD_CXX_TREE_PARSING_ELEMENT_MAP_TXX -#define XSD_CXX_TREE_PARSING_ELEMENT_MAP_TXX - -#include <xsd/cxx/xml/dom/elements.hxx> - -#include <xsd/cxx/tree/exceptions.hxx> - -namespace xsd -{ - namespace cxx - { - namespace tree - { - template <typename C, typename T> - XSD_AUTO_PTR<element_type<C, T> > element_map<C, T>:: - parse (const xercesc::DOMElement& e, flags f) - { - const qualified_name n (xml::dom::name<C> (e)); - typename map::const_iterator i (map_->find (n)); - - if (i != map_->end () && i->second.parser_ != 0) - return (i->second.parser_) (e, f); - else - throw no_element_info<C> (n.name (), n.namespace_ ()); - } - - template<typename T, typename C, typename B> - XSD_AUTO_PTR<element_type<C, B> > - parser_impl (const xercesc::DOMElement& e, flags f) - { - return XSD_AUTO_PTR<element_type<C, B> > (new T (e, f)); - } - } - } -} - -#endif // XSD_CXX_TREE_PARSING_ELEMENT_MAP_TXX diff --git a/libxsd/xsd/cxx/tree/parsing/float.hxx b/libxsd/xsd/cxx/tree/parsing/float.hxx deleted file mode 100644 index bbeab2c..0000000 --- a/libxsd/xsd/cxx/tree/parsing/float.hxx +++ /dev/null @@ -1,92 +0,0 @@ -// file : xsd/cxx/tree/parsing/float.hxx -// license : GNU GPL v2 + exceptions; see accompanying LICENSE file - -#ifndef XSD_CXX_TREE_PARSING_FLOAT_HXX -#define XSD_CXX_TREE_PARSING_FLOAT_HXX - -#include <limits> -#include <locale> - -#include <xsd/cxx/ro-string.hxx> -#include <xsd/cxx/zc-istream.hxx> - -#include <xsd/cxx/xml/string.hxx> // xml::transcode - -#include <xsd/cxx/tree/text.hxx> // text_content -#include <xsd/cxx/tree/bits/literals.hxx> - -namespace xsd -{ - namespace cxx - { - namespace tree - { - template <typename C> - struct traits<float, C, schema_type::other> - { - typedef float type; - - static type - create (const xercesc::DOMElement& e, flags f, container* c); - - static type - create (const xercesc::DOMAttr& a, flags f, container* c); - - static type - create (const std::basic_string<C>& s, - const xercesc::DOMElement*, - flags, - container*); - }; - - template <typename C> - float traits<float, C, schema_type::other>:: - create (const xercesc::DOMElement& e, flags f, container* c) - { - return create (tree::text_content<C> (e), 0, f, c); - } - - template <typename C> - float traits<float, C, schema_type::other>:: - create (const xercesc::DOMAttr& a, flags f, container* c) - { - return create (xml::transcode<C> (a.getValue ()), 0, f, c); - } - - template <typename C> - float traits<float, C, schema_type::other>:: - create (const std::basic_string<C>& s, - const xercesc::DOMElement*, - flags, - container*) - { - // This type cannot have whitespaces in its values. As result we - // don't need to waste time collapsing whitespaces. All we need to - // do is trim the string representation which can be done without - // copying. - // - ro_string<C> tmp (s); - trim (tmp); - - if (tmp == bits::positive_inf<C> ()) - return std::numeric_limits<float>::infinity (); - - if (tmp == bits::negative_inf<C> ()) - return -std::numeric_limits<float>::infinity (); - - if (tmp == bits::nan<C> ()) - return std::numeric_limits<float>::quiet_NaN (); - - zc_istream<C> is (tmp); - is.imbue (std::locale::classic ()); - - type t; - is >> t; - - return t; - } - } - } -} - -#endif // XSD_CXX_TREE_PARSING_FLOAT_HXX diff --git a/libxsd/xsd/cxx/tree/parsing/int.hxx b/libxsd/xsd/cxx/tree/parsing/int.hxx deleted file mode 100644 index 566edef..0000000 --- a/libxsd/xsd/cxx/tree/parsing/int.hxx +++ /dev/null @@ -1,78 +0,0 @@ -// file : xsd/cxx/tree/parsing/int.hxx -// license : GNU GPL v2 + exceptions; see accompanying LICENSE file - -#ifndef XSD_CXX_TREE_PARSING_INT_HXX -#define XSD_CXX_TREE_PARSING_INT_HXX - -#include <xsd/cxx/ro-string.hxx> -#include <xsd/cxx/zc-istream.hxx> - -#include <xsd/cxx/xml/string.hxx> // xml::transcode - -#include <xsd/cxx/tree/text.hxx> // text_content - -namespace xsd -{ - namespace cxx - { - namespace tree - { - template <typename C> - struct traits<int, C, schema_type::other> - { - typedef int type; - - static type - create (const xercesc::DOMElement& e, flags f, container* c); - - static type - create (const xercesc::DOMAttr& a, flags f, container* c); - - static type - create (const std::basic_string<C>& s, - const xercesc::DOMElement*, - flags, - container*); - }; - - template <typename C> - int traits<int, C, schema_type::other>:: - create (const xercesc::DOMElement& e, flags f, container* c) - { - return create (tree::text_content<C> (e), 0, f, c); - } - - template <typename C> - int traits<int, C, schema_type::other>:: - create (const xercesc::DOMAttr& a, flags f, container* c) - { - return create (xml::transcode<C> (a.getValue ()), 0, f, c); - } - - template <typename C> - int traits<int, C, schema_type::other>:: - create (const std::basic_string<C>& s, - const xercesc::DOMElement*, - flags, - container*) - { - // This type cannot have whitespaces in its values. As result we - // don't need to waste time collapsing whitespaces. All we need to - // do is trim the string representation which can be done without - // copying. - // - ro_string<C> tmp (s); - trim (tmp); - - zc_istream<C> is (tmp); - - type t; - is >> t; - - return t; - } - } - } -} - -#endif // XSD_CXX_TREE_PARSING_INT_HXX diff --git a/libxsd/xsd/cxx/tree/parsing/long.hxx b/libxsd/xsd/cxx/tree/parsing/long.hxx deleted file mode 100644 index 97b81d6..0000000 --- a/libxsd/xsd/cxx/tree/parsing/long.hxx +++ /dev/null @@ -1,78 +0,0 @@ -// file : xsd/cxx/tree/parsing/long.hxx -// license : GNU GPL v2 + exceptions; see accompanying LICENSE file - -#ifndef XSD_CXX_TREE_PARSING_LONG_HXX -#define XSD_CXX_TREE_PARSING_LONG_HXX - -#include <xsd/cxx/ro-string.hxx> -#include <xsd/cxx/zc-istream.hxx> - -#include <xsd/cxx/xml/string.hxx> // xml::transcode - -#include <xsd/cxx/tree/text.hxx> // text_content - -namespace xsd -{ - namespace cxx - { - namespace tree - { - template <typename C> - struct traits<long long, C, schema_type::other> - { - typedef long long type; - - static type - create (const xercesc::DOMElement& e, flags f, container* c); - - static type - create (const xercesc::DOMAttr& a, flags f, container* c); - - static type - create (const std::basic_string<C>& s, - const xercesc::DOMElement*, - flags, - container*); - }; - - template <typename C> - long long traits<long long, C, schema_type::other>:: - create (const xercesc::DOMElement& e, flags f, container* c) - { - return create (tree::text_content<C> (e), 0, f, c); - } - - template <typename C> - long long traits<long long, C, schema_type::other>:: - create (const xercesc::DOMAttr& a, flags f, container* c) - { - return create (xml::transcode<C> (a.getValue ()), 0, f, c); - } - - template <typename C> - long long traits<long long, C, schema_type::other>:: - create (const std::basic_string<C>& s, - const xercesc::DOMElement*, - flags, - container*) - { - // This type cannot have whitespaces in its values. As result we - // don't need to waste time collapsing whitespaces. All we need to - // do is trim the string representation which can be done without - // copying. - // - ro_string<C> tmp (s); - trim (tmp); - - zc_istream<C> is (tmp); - - type t; - is >> t; - - return t; - } - } - } -} - -#endif // XSD_CXX_TREE_PARSING_LONG_HXX diff --git a/libxsd/xsd/cxx/tree/parsing/short.hxx b/libxsd/xsd/cxx/tree/parsing/short.hxx deleted file mode 100644 index 8b97f80..0000000 --- a/libxsd/xsd/cxx/tree/parsing/short.hxx +++ /dev/null @@ -1,78 +0,0 @@ -// file : xsd/cxx/tree/parsing/short.hxx -// license : GNU GPL v2 + exceptions; see accompanying LICENSE file - -#ifndef XSD_CXX_TREE_PARSING_SHORT_HXX -#define XSD_CXX_TREE_PARSING_SHORT_HXX - -#include <xsd/cxx/ro-string.hxx> -#include <xsd/cxx/zc-istream.hxx> - -#include <xsd/cxx/xml/string.hxx> // xml::transcode - -#include <xsd/cxx/tree/text.hxx> // text_content - -namespace xsd -{ - namespace cxx - { - namespace tree - { - template <typename C> - struct traits<short, C, schema_type::other> - { - typedef short type; - - static type - create (const xercesc::DOMElement& e, flags f, container* c); - - static type - create (const xercesc::DOMAttr& a, flags f, container* c); - - static type - create (const std::basic_string<C>& s, - const xercesc::DOMElement*, - flags, - container*); - }; - - template <typename C> - short traits<short, C, schema_type::other>:: - create (const xercesc::DOMElement& e, flags f, container* c) - { - return create (tree::text_content<C> (e), 0, f, c); - } - - template <typename C> - short traits<short, C, schema_type::other>:: - create (const xercesc::DOMAttr& a, flags f, container* c) - { - return create (xml::transcode<C> (a.getValue ()), 0, f, c); - } - - template <typename C> - short traits<short, C, schema_type::other>:: - create (const std::basic_string<C>& s, - const xercesc::DOMElement*, - flags, - container*) - { - // This type cannot have whitespaces in its values. As result we - // don't need to waste time collapsing whitespaces. All we need to - // do is trim the string representation which can be done without - // copying. - // - ro_string<C> tmp (s); - trim (tmp); - - zc_istream<C> is (tmp); - - type t; - is >> t; - - return t; - } - } - } -} - -#endif // XSD_CXX_TREE_PARSING_SHORT_HXX diff --git a/libxsd/xsd/cxx/tree/parsing/unsigned-byte.hxx b/libxsd/xsd/cxx/tree/parsing/unsigned-byte.hxx deleted file mode 100644 index 6a8b606..0000000 --- a/libxsd/xsd/cxx/tree/parsing/unsigned-byte.hxx +++ /dev/null @@ -1,78 +0,0 @@ -// file : xsd/cxx/tree/parsing/unsigned-byte.hxx -// license : GNU GPL v2 + exceptions; see accompanying LICENSE file - -#ifndef XSD_CXX_TREE_PARSING_UNSIGNED_BYTE_HXX -#define XSD_CXX_TREE_PARSING_UNSIGNED_BYTE_HXX - -#include <xsd/cxx/ro-string.hxx> -#include <xsd/cxx/zc-istream.hxx> - -#include <xsd/cxx/xml/string.hxx> // xml::transcode - -#include <xsd/cxx/tree/text.hxx> // text_content - -namespace xsd -{ - namespace cxx - { - namespace tree - { - template <typename C> - struct traits<unsigned char, C, schema_type::other> - { - typedef unsigned char type; - - static type - create (const xercesc::DOMElement& e, flags f, container* c); - - static type - create (const xercesc::DOMAttr& a, flags f, container* c); - - static type - create (const std::basic_string<C>& s, - const xercesc::DOMElement*, - flags, - container*); - }; - - template <typename C> - unsigned char traits<unsigned char, C, schema_type::other>:: - create (const xercesc::DOMElement& e, flags f, container* c) - { - return create (tree::text_content<C> (e), 0, f, c); - } - - template <typename C> - unsigned char traits<unsigned char, C, schema_type::other>:: - create (const xercesc::DOMAttr& a, flags f, container* c) - { - return create (xml::transcode<C> (a.getValue ()), 0, f, c); - } - - template <typename C> - unsigned char traits<unsigned char, C, schema_type::other>:: - create (const std::basic_string<C>& s, - const xercesc::DOMElement*, - flags, - container*) - { - // This type cannot have whitespaces in its values. As result we - // don't need to waste time collapsing whitespaces. All we need to - // do is trim the string representation which can be done without - // copying. - // - ro_string<C> tmp (s); - trim (tmp); - - zc_istream<C> is (tmp); - - unsigned short t; - is >> t; - - return static_cast<type> (t); - } - } - } -} - -#endif // XSD_CXX_TREE_PARSING_UNSIGNED_BYTE_HXX diff --git a/libxsd/xsd/cxx/tree/parsing/unsigned-int.hxx b/libxsd/xsd/cxx/tree/parsing/unsigned-int.hxx deleted file mode 100644 index c9f1f64..0000000 --- a/libxsd/xsd/cxx/tree/parsing/unsigned-int.hxx +++ /dev/null @@ -1,78 +0,0 @@ -// file : xsd/cxx/tree/parsing/unsigned-int.hxx -// license : GNU GPL v2 + exceptions; see accompanying LICENSE file - -#ifndef XSD_CXX_TREE_PARSING_UNSIGNED_INT_HXX -#define XSD_CXX_TREE_PARSING_UNSIGNED_INT_HXX - -#include <xsd/cxx/ro-string.hxx> -#include <xsd/cxx/zc-istream.hxx> - -#include <xsd/cxx/xml/string.hxx> // xml::transcode - -#include <xsd/cxx/tree/text.hxx> // text_content - -namespace xsd -{ - namespace cxx - { - namespace tree - { - template <typename C> - struct traits<unsigned int, C, schema_type::other> - { - typedef unsigned int type; - - static type - create (const xercesc::DOMElement& e, flags f, container* c); - - static type - create (const xercesc::DOMAttr& a, flags f, container* c); - - static type - create (const std::basic_string<C>& s, - const xercesc::DOMElement*, - flags, - container*); - }; - - template <typename C> - unsigned int traits<unsigned int, C, schema_type::other>:: - create (const xercesc::DOMElement& e, flags f, container* c) - { - return create (tree::text_content<C> (e), 0, f, c); - } - - template <typename C> - unsigned int traits<unsigned int, C, schema_type::other>:: - create (const xercesc::DOMAttr& a, flags f, container* c) - { - return create (xml::transcode<C> (a.getValue ()), 0, f, c); - } - - template <typename C> - unsigned int traits<unsigned int, C, schema_type::other>:: - create (const std::basic_string<C>& s, - const xercesc::DOMElement*, - flags, - container*) - { - // This type cannot have whitespaces in its values. As result we - // don't need to waste time collapsing whitespaces. All we need to - // do is trim the string representation which can be done without - // copying. - // - ro_string<C> tmp (s); - trim (tmp); - - zc_istream<C> is (tmp); - - type t; - is >> t; - - return t; - } - } - } -} - -#endif // XSD_CXX_TREE_PARSING_UNSIGNED_INT_HXX diff --git a/libxsd/xsd/cxx/tree/parsing/unsigned-long.hxx b/libxsd/xsd/cxx/tree/parsing/unsigned-long.hxx deleted file mode 100644 index 4c77484..0000000 --- a/libxsd/xsd/cxx/tree/parsing/unsigned-long.hxx +++ /dev/null @@ -1,78 +0,0 @@ -// file : xsd/cxx/tree/parsing/unsigned-long.hxx -// license : GNU GPL v2 + exceptions; see accompanying LICENSE file - -#ifndef XSD_CXX_TREE_PARSING_UNSIGNED_LONG_HXX -#define XSD_CXX_TREE_PARSING_UNSIGNED_LONG_HXX - -#include <xsd/cxx/ro-string.hxx> -#include <xsd/cxx/zc-istream.hxx> - -#include <xsd/cxx/xml/string.hxx> // xml::transcode - -#include <xsd/cxx/tree/text.hxx> // text_content - -namespace xsd -{ - namespace cxx - { - namespace tree - { - template <typename C> - struct traits<unsigned long long, C, schema_type::other> - { - typedef unsigned long long type; - - static type - create (const xercesc::DOMElement& e, flags f, container* c); - - static type - create (const xercesc::DOMAttr& a, flags f, container* c); - - static type - create (const std::basic_string<C>& s, - const xercesc::DOMElement*, - flags, - container*); - }; - - template <typename C> - unsigned long long traits<unsigned long long, C, schema_type::other>:: - create (const xercesc::DOMElement& e, flags f, container* c) - { - return create (tree::text_content<C> (e), 0, f, c); - } - - template <typename C> - unsigned long long traits<unsigned long long, C, schema_type::other>:: - create (const xercesc::DOMAttr& a, flags f, container* c) - { - return create (xml::transcode<C> (a.getValue ()), 0, f, c); - } - - template <typename C> - unsigned long long traits<unsigned long long, C, schema_type::other>:: - create (const std::basic_string<C>& s, - const xercesc::DOMElement*, - flags, - container*) - { - // This type cannot have whitespaces in its values. As result we - // don't need to waste time collapsing whitespaces. All we need to - // do is trim the string representation which can be done without - // copying. - // - ro_string<C> tmp (s); - trim (tmp); - - zc_istream<C> is (tmp); - - type t; - is >> t; - - return t; - } - } - } -} - -#endif // XSD_CXX_TREE_PARSING_UNSIGNED_LONG_HXX diff --git a/libxsd/xsd/cxx/tree/parsing/unsigned-short.hxx b/libxsd/xsd/cxx/tree/parsing/unsigned-short.hxx deleted file mode 100644 index 5491bcd..0000000 --- a/libxsd/xsd/cxx/tree/parsing/unsigned-short.hxx +++ /dev/null @@ -1,78 +0,0 @@ -// file : xsd/cxx/tree/parsing/unsigned-short.hxx -// license : GNU GPL v2 + exceptions; see accompanying LICENSE file - -#ifndef XSD_CXX_TREE_PARSING_UNSIGNED_SHORT_HXX -#define XSD_CXX_TREE_PARSING_UNSIGNED_SHORT_HXX - -#include <xsd/cxx/ro-string.hxx> -#include <xsd/cxx/zc-istream.hxx> - -#include <xsd/cxx/xml/string.hxx> // xml::transcode - -#include <xsd/cxx/tree/text.hxx> // text_content - -namespace xsd -{ - namespace cxx - { - namespace tree - { - template <typename C> - struct traits<unsigned short, C, schema_type::other> - { - typedef unsigned short type; - - static type - create (const xercesc::DOMElement& e, flags f, container* c); - - static type - create (const xercesc::DOMAttr& a, flags f, container* c); - - static type - create (const std::basic_string<C>& s, - const xercesc::DOMElement*, - flags, - container*); - }; - - template <typename C> - unsigned short traits<unsigned short, C, schema_type::other>:: - create (const xercesc::DOMElement& e, flags f, container* c) - { - return create (tree::text_content<C> (e), 0, f, c); - } - - template <typename C> - unsigned short traits<unsigned short, C, schema_type::other>:: - create (const xercesc::DOMAttr& a, flags f, container* c) - { - return create (xml::transcode<C> (a.getValue ()), 0, f, c); - } - - template <typename C> - unsigned short traits<unsigned short, C, schema_type::other>:: - create (const std::basic_string<C>& s, - const xercesc::DOMElement*, - flags, - container*) - { - // This type cannot have whitespaces in its values. As result we - // don't need to waste time collapsing whitespaces. All we need to - // do is trim the string representation which can be done without - // copying. - // - ro_string<C> tmp (s); - trim (tmp); - - zc_istream<C> is (tmp); - - type t; - is >> t; - - return t; - } - } - } -} - -#endif // XSD_CXX_TREE_PARSING_UNSIGNED_SHORT_HXX |