OSSIM - Open Source Software Image Map  Version 1.9.0 (20180803)
CivilDateTime.h
Go to the documentation of this file.
1 //----------------------------------------------------------------------------
2 //
3 // "Copyright Centre National d'Etudes Spatiales"
4 //
5 // License: LGPL
6 //
7 // See LICENSE.txt file in the top level directory for more details.
8 //
9 //----------------------------------------------------------------------------
10 // $Id$
11 
12 
13 #ifndef CivilDateTime_h
14 #define CivilDateTime_h
15 
17 #include <iosfwd>
18 
19 namespace ossimplugins
20 {
21 
22 
23 class JulianDate;
24 class JSDDateTime;
25 class GMSTDateTime;
26 
31 {
32 public:
33 
37  CivilDateTime();
38 
42  CivilDateTime(int year, int month, int day, int second, double decimal);
43 
47  CivilDateTime(char* Utc);
48 
49  CivilDateTime(const char* Utc);
50 
54  ~CivilDateTime();
55 
59  CivilDateTime(const CivilDateTime& rhs);
60 
64  CivilDateTime& operator=(const CivilDateTime& rhs);
65 
71  int AsJulianDate(JulianDate* julianDate);
72 
78  int AsJSDDateTime(JSDDateTime* JSDdate);
79 
85  int AsGMSTDateTime(GMSTDateTime* GMSTdate);
86 
87  int get_year()
88  {
89  return _year;
90  };
91 
92  int get_month()
93  {
94  return _month;
95  };
96 
97  int get_day()
98  {
99  return _day;
100  };
101 
103  {
104  return _second;
105  };
106 
107  double get_decimal()
108  {
109  return _decimal;
110  };
111 
112  void set_year(int year)
113  {
114  _year = year;
115  };
116 
117  void set_month(int month)
118  {
119  _month = month;
120  };
121 
122  void set_day(int day)
123  {
124  _day = day;
125  };
126 
127  void set_second(int second)
128  {
129  _second = second;
130  };
131 
132  void set_decimal(double decimal)
133  {
134  _decimal = decimal;
135  };
136 
142  int SetUtcDateTime(char* Utc);
143 
144  int SetUtcDateTime(const char* Utc);
145 
146 
147  operator JulianDate() ;
148 
149  operator JSDDateTime() ;
150 
151  operator GMSTDateTime() ;
152 
153  std::ostream& print(std::ostream& out) const;
154 
155  friend std::ostream& operator<<(std::ostream& out,
156  const CivilDateTime& obj);
157 
158 
159  static const double JOURCIVIL_LENGTH;
160 protected:
164  int _year;
168  int _month;
172  int _day;
176  int _second;
180  double _decimal;
181 
182 
183 private:
184 };
185 }
186 
187 #endif
This class represents a date.
Definition: GMSTDateTime.h:29
This class represents a date and time in the civil format.
Definition: CivilDateTime.h:30
static const double JOURCIVIL_LENGTH
void set_second(int second)
std::ostream & print(H5::H5File *file, std::ostream &out)
Print method.
Definition: ossimH5Util.cpp:41
This class represents a date in the julian referential.
Definition: JulianDate.h:27
void set_decimal(double decimal)
std::ostream & operator<<(std::ostream &os, const AlosPalsarData &data)
#define OSSIM_PLUGINS_DLL
int _second
Number of secondes since the beginning of the day.
This class represents a date.
Definition: JSDDateTime.h:30
std::basic_ostream< char > ostream
Base class for char output streams.
Definition: ossimIosFwd.h:23