diff options
author | Karen Arutyunov <karen@codesynthesis.com> | 2020-12-18 18:48:46 +0300 |
---|---|---|
committer | Karen Arutyunov <karen@codesynthesis.com> | 2021-01-13 22:32:43 +0300 |
commit | 2615896faa646e5830abf2c269150e1165c66515 (patch) | |
tree | 7d95978ec0a83094c9462ed4e1f59d42f4ff8ddb /libxsd/libxsd/cxx/tree/date-time-extraction.txx | |
parent | 7420f85ea19b0562ffdd8123442f32bc8bac1267 (diff) |
Switch to build2
Diffstat (limited to 'libxsd/libxsd/cxx/tree/date-time-extraction.txx')
-rw-r--r-- | libxsd/libxsd/cxx/tree/date-time-extraction.txx | 155 |
1 files changed, 155 insertions, 0 deletions
diff --git a/libxsd/libxsd/cxx/tree/date-time-extraction.txx b/libxsd/libxsd/cxx/tree/date-time-extraction.txx new file mode 100644 index 0000000..5e4353b --- /dev/null +++ b/libxsd/libxsd/cxx/tree/date-time-extraction.txx @@ -0,0 +1,155 @@ +// file : libxsd/cxx/tree/date-time-extraction.txx +// 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_; + } + } + } +} |