Jpp  18.2.1
the software that should make you happy
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
JDate_t.hh
Go to the documentation of this file.
1 #ifndef __JDB_JDATE_T__
2 #define __JDB_JDATE_T__
3 
4 #include <istream>
5 #include <ostream>
6 
7 #include "Jeep/JDate.hh"
8 #include "Jeep/JTime.hh"
9 
11 
12 
13 /**
14  * \author mdejong
15  */
16 namespace JDATABASE {}
17 namespace JPP { using namespace JDATABASE; }
18 
19 namespace JDATABASE {
20 
22  using JLANG::JTYPELIST;
23 
24  typedef JEEP::JDate<'/'> JDate_t; //!< type defintion of date according database format
25  typedef JEEP::JTime<':'> JTime_t; //!< type defintion of time according database format
26 
27 
28  /**
29  * Date and time.
30  */
31  struct JDateAndTime_t :
32  public JDate_t,
33  public JTime_t,
34  public JMultiComparable<JDateAndTime_t, JTYPELIST<JDate_t, JTime_t>::typelist>
35  {
36  /**
37  * Separation character.
38  */
39  static const char SEPARATOR = '-';
40 
41 
42  /**
43  * Default constructor;
44  */
46  {}
47 
48 
49  /**
50  * Read date and time from input stream.
51  *
52  * \param in input stream
53  * \param object date and time
54  * \return input stream
55  */
56  friend inline std::istream& operator>>(std::istream& in, JDateAndTime_t& object)
57  {
58  in >> static_cast<JDate_t&>(object);
59 
60  if (in.get() == (int) SEPARATOR) {
61  in >> static_cast<JTime_t&>(object);
62  }
63 
64  return in;
65  }
66 
67 
68  /**
69  * Write date and time to output stream.
70  *
71  * \param out output stream
72  * \param object date and time
73  * \return output stream
74  */
75  friend inline std::ostream& operator<<(std::ostream& out, const JDateAndTime_t& object)
76  {
77  out << static_cast<const JDate_t&>(object);
78  out << SEPARATOR;
79  out << static_cast<const JTime_t&>(object);
80 
81  return out;
82  }
83  };
84 }
85 
86 #endif
Date and time.
Definition: JDate_t.hh:31
JDateAndTime_t()
Default constructor;.
Definition: JDate_t.hh:45
Auxiliary class for recursive type list generation.
Definition: JTypeList.hh:351
Auxiliary class for simple date.
Definition: JDate.hh:39
friend std::ostream & operator<<(std::ostream &out, const JDateAndTime_t &object)
Write date and time to output stream.
Definition: JDate_t.hh:75
static const char SEPARATOR
Separation character.
Definition: JDate_t.hh:39
JEEP::JTime<':'> JTime_t
type defintion of time according database format
Definition: JDate_t.hh:25
friend std::istream & operator>>(std::istream &in, JDateAndTime_t &object)
Read date and time from input stream.
Definition: JDate_t.hh:56
Template definition of auxiliary base class for composite data structures composed of base classes wi...
Auxiliary class for simple time.
Definition: Jeep/JTime.hh:39
JEEP::JDate<'/'> JDate_t
type defintion of date according database format
Definition: JDate_t.hh:24
then fatal Wrong number of arguments fi set_variable DETECTOR $argv[1] set_variable INPUT_FILE $argv[2] eval JPrintDetector a $DETECTOR O IDENTIFIER eval JPrintDetector a $DETECTOR O SUMMARY JAcoustics sh $DETECTOR_ID source JAcousticsToolkit sh CHECK_EXIT_CODE typeset A EMITTERS get_tripods $WORKDIR tripod txt EMITTERS get_transmitters $WORKDIR transmitter txt EMITTERS for EMITTER in
Definition: JCanberra.sh:46