summaryrefslogtreecommitdiff
path: root/libxsd/xsd/cxx/tree/date-time-extraction.txx
diff options
context:
space:
mode:
authorBoris Kolpackov <boris@codesynthesis.com>2009-09-17 07:15:29 +0200
committerBoris Kolpackov <boris@codesynthesis.com>2009-09-17 07:15:29 +0200
commitf0510d2f90467de8e8f260b47d79a9baaf9bef17 (patch)
tree0b9929946f06a9cbe9b9e8f2a7600dae4e048f79 /libxsd/xsd/cxx/tree/date-time-extraction.txx
Start tracking XSD with git
Diffstat (limited to 'libxsd/xsd/cxx/tree/date-time-extraction.txx')
-rw-r--r--libxsd/xsd/cxx/tree/date-time-extraction.txx157
1 files changed, 157 insertions, 0 deletions
diff --git a/libxsd/xsd/cxx/tree/date-time-extraction.txx b/libxsd/xsd/cxx/tree/date-time-extraction.txx
new file mode 100644
index 0000000..7803175
--- /dev/null
+++ b/libxsd/xsd/cxx/tree/date-time-extraction.txx
@@ -0,0 +1,157 @@
+// file : xsd/cxx/tree/date-time-extraction.txx
+// author : Boris Kolpackov <boris@codesynthesis.com>
+// copyright : Copyright (c) 2005-2009 Code Synthesis Tools CC
+// license : GNU GPL v2 + exceptions; see accompanying LICENSE file
+
+namespace xsd
+{
+ namespace cxx
+ {
+ namespace tree
+ {
+ // time_zone
+ //
+ template <typename S>
+ inline void time_zone::
+ zone_extract (istream<S>& s)
+ {
+ s >> hours_ >> minutes_;
+ present_ = true;
+ }
+
+ // gday
+ //
+ template <typename C, typename B>
+ template <typename S>
+ gday<C, B>::
+ gday (istream<S>& s, flags f, container* c)
+ : B (s, f, c)
+ {
+ bool zp;
+ s >> day_ >> zp;
+
+ if (zp)
+ zone_extract (s);
+ }
+
+ // gmonth
+ //
+ template <typename C, typename B>
+ template <typename S>
+ gmonth<C, B>::
+ gmonth (istream<S>& s, flags f, container* c)
+ : B (s, f, c)
+ {
+ bool zp;
+ s >> month_ >> zp;
+
+ if (zp)
+ zone_extract (s);
+ }
+
+ // gyear
+ //
+ template <typename C, typename B>
+ template <typename S>
+ gyear<C, B>::
+ gyear (istream<S>& s, flags f, container* c)
+ : B (s, f, c)
+ {
+ bool zp;
+ s >> year_ >> zp;
+
+ if (zp)
+ zone_extract (s);
+ }
+
+ // gmonth_day
+ //
+ template <typename C, typename B>
+ template <typename S>
+ gmonth_day<C, B>::
+ gmonth_day (istream<S>& s, flags f, container* c)
+ : B (s, f, c)
+ {
+ bool zp;
+ s >> month_ >> day_ >> zp;
+
+ if (zp)
+ zone_extract (s);
+ }
+
+ // gyear_month
+ //
+ template <typename C, typename B>
+ template <typename S>
+ gyear_month<C, B>::
+ gyear_month (istream<S>& s, flags f, container* c)
+ : B (s, f, c)
+ {
+ bool zp;
+ s >> year_ >> month_ >> zp;
+
+ if (zp)
+ zone_extract (s);
+ }
+
+ // date
+ //
+ template <typename C, typename B>
+ template <typename S>
+ date<C, B>::
+ date (istream<S>& s, flags f, container* c)
+ : B (s, f, c)
+ {
+ bool zp;
+ s >> year_ >> month_ >> day_ >> zp;
+
+ if (zp)
+ zone_extract (s);
+ }
+
+ // time
+ //
+ template <typename C, typename B>
+ template <typename S>
+ time<C, B>::
+ time (istream<S>& s, flags f, container* c)
+ : B (s, f, c)
+ {
+ bool zp;
+ s >> hours_ >> minutes_ >> seconds_ >> zp;
+
+ if (zp)
+ zone_extract (s);
+ }
+
+ // date_time
+ //
+ template <typename C, typename B>
+ template <typename S>
+ date_time<C, B>::
+ date_time (istream<S>& s, flags f, container* c)
+ : B (s, f, c)
+ {
+ bool zp;
+ s >> year_ >> month_ >> day_
+ >> hours_ >> minutes_ >> seconds_ >> zp;
+
+ if (zp)
+ zone_extract (s);
+ }
+
+ // duration
+ //
+ template <typename C, typename B>
+ template <typename S>
+ duration<C, B>::
+ duration (istream<S>& s, flags f, container* c)
+ : B (s, f, c)
+ {
+ s >> negative_
+ >> years_ >> months_ >> days_
+ >> hours_ >> minutes_ >> seconds_;
+ }
+ }
+ }
+}