StdAir Logo  1.00.19
C++ Standard Airline IT Object Library
Loading...
Searching...
No Matches
BasParserHelperTypes.hpp
Go to the documentation of this file.
1#ifndef __STDAIR_BAS_BASCOMPARSERHELPERTYPES_HPP
2#define __STDAIR_BAS_BASCOMPARSERHELPERTYPES_HPP
3
4// //////////////////////////////////////////////////////////////////////
5// Import section
6// //////////////////////////////////////////////////////////////////////
7// STL
8#include <string>
9#include <sstream>
10// StdAir
13
14namespace stdair {
15
16 // ////////////////////////////////////////////////////////////////////
17 //
18 // Parser structure helper
19 //
20 // ////////////////////////////////////////////////////////////////////
22 template <int MIN = 0, int MAX = 0>
24 unsigned int _value;
25
26 // ////////// Constructors ///////////
32 date_time_element (int i) : _value (i) { }
34 void check () const {
36 std::ostringstream oMessage;
37 oMessage << "The value: " << _value << " is out of range ("
38 << MIN << ", " << MAX << ")";
39 throw stdair::ParserException (oMessage.str());
40 }
41 }
42 };
43
45 template <int MIN, int MAX>
46 inline date_time_element<MIN,
51
53 template <int MIN, int MAX>
54 inline date_time_element<MIN,
59
67
68}
69#endif // __STDAIR_BAS_BASCOMPARSERHELPERTYPES_HPP
Handle on the StdAir library context.
date_time_element< 0, 59 > minute_t
date_time_element< 1900, 2100 > year_t
date_time_element< MIN, MAX > operator+(const date_time_element< MIN, MAX > &o1, const date_time_element< MIN, MAX > &o2)
date_time_element< 0, 59 > second_t
date_time_element< 1, 31 > day_t
date_time_element< MIN, MAX > operator*(const date_time_element< MIN, MAX > &o1, const date_time_element< MIN, MAX > &o2)
date_time_element< 0, 23 > hour_t
date_time_element< 1, 12 > month_t
date_time_element(const date_time_element &t)