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/date-time-extraction.txx | 157 +++++++++++++++++++++++++++ 1 file changed, 157 insertions(+) create mode 100644 libxsd/xsd/cxx/tree/date-time-extraction.txx (limited to 'libxsd/xsd/cxx/tree/date-time-extraction.txx') 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 +// 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 + inline void time_zone:: + zone_extract (istream& s) + { + s >> hours_ >> minutes_; + present_ = true; + } + + // gday + // + template + template + gday:: + gday (istream& s, flags f, container* c) + : B (s, f, c) + { + bool zp; + s >> day_ >> zp; + + if (zp) + zone_extract (s); + } + + // gmonth + // + template + template + gmonth:: + gmonth (istream& s, flags f, container* c) + : B (s, f, c) + { + bool zp; + s >> month_ >> zp; + + if (zp) + zone_extract (s); + } + + // gyear + // + template + template + gyear:: + gyear (istream& s, flags f, container* c) + : B (s, f, c) + { + bool zp; + s >> year_ >> zp; + + if (zp) + zone_extract (s); + } + + // gmonth_day + // + template + template + gmonth_day:: + gmonth_day (istream& s, flags f, container* c) + : B (s, f, c) + { + bool zp; + s >> month_ >> day_ >> zp; + + if (zp) + zone_extract (s); + } + + // gyear_month + // + template + template + gyear_month:: + gyear_month (istream& s, flags f, container* c) + : B (s, f, c) + { + bool zp; + s >> year_ >> month_ >> zp; + + if (zp) + zone_extract (s); + } + + // date + // + template + template + date:: + date (istream& s, flags f, container* c) + : B (s, f, c) + { + bool zp; + s >> year_ >> month_ >> day_ >> zp; + + if (zp) + zone_extract (s); + } + + // time + // + template + template + time:: + time (istream& s, flags f, container* c) + : B (s, f, c) + { + bool zp; + s >> hours_ >> minutes_ >> seconds_ >> zp; + + if (zp) + zone_extract (s); + } + + // date_time + // + template + template + date_time:: + date_time (istream& 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 + template + duration:: + duration (istream& s, flags f, container* c) + : B (s, f, c) + { + s >> negative_ + >> years_ >> months_ >> days_ + >> hours_ >> minutes_ >> seconds_; + } + } + } +} -- cgit v1.1