New URL for NEMO forge!   http://forge.nemo-ocean.eu

Since March 2022 along with NEMO 4.2 release, the code development moved to a self-hosted GitLab.
This present forge is now archived and remained online for history.
date.hpp in vendors/XIOS/current/src – NEMO

source: vendors/XIOS/current/src/date.hpp @ 3428

Last change on this file since 3428 was 3428, checked in by rblod, 12 years ago

importing initial XIOS vendor drop

File size: 2.2 KB
Line 
1#ifndef __XMLIO_CDate__
2#define __XMLIO_CDate__
3
4/// xios headers ///
5#include "xmlioserver_spl.hpp"
6#include "exception.hpp"
7#include "duration.hpp"
8
9namespace xios
10{
11      /// ////////////////////// Déclarations ////////////////////// ///
12      class CCalendar;
13
14      class CDate
15      {
16         public :
17
18            /// Constructeurs ///
19            CDate(void);                      // Not implemented yet
20            CDate(const CCalendar & cal);
21            CDate(const CCalendar & cal,int yr, int mth, int d,
22                                        int hr = 0, int min = 0, int sec = 0);
23            CDate(const CDate & odate);
24            CDate(const CDate * const odate); // Not implemented yet
25
26            /// Destructeur ///
27            ~CDate(void);
28
29            /// Opérateurs ///
30            CDate & operator=(const CDate & date);
31            friend StdOStream & operator<<(StdOStream & out, const CDate & date);
32            friend StdIStream & operator>>(StdIStream & in, CDate & date); // Non testée.
33
34            operator Time(void) const;  // Retourne le nombre de secondes écoulées depuis la date d'origine définie dans le calendrier.
35
36            /// Traitements ///
37            bool checkDate(void); // Vérifie la validité de la date.
38
39            /// Divers accesseurs ///
40            int getYear  (void) const;
41            int getMonth (void) const;
42            int getDay   (void) const;
43            int getHour  (void) const;
44            int getMinute(void) const;
45            int getSecond(void) const;
46
47            const CCalendar & getRelCalendar(void) const;
48
49            /// Mutateurs ///
50            void setYear  (int newyear);
51            void setMonth (int newmonth);
52
53            void addMonth (int value);
54
55            /// Autres ///
56            StdString toString(void) const;
57            StdString getStryyyymmdd(void) const;
58
59         public : /* static */
60
61            static CDate FromString(const StdString & str, const CCalendar & calendar);
62
63         private :
64
65            /// Propriétés privées ///
66            const CCalendar & relCalendar; // Calendrier lié à la Date.
67            int year, month, day, hour, minute, second; // Année, mois, ...
68
69
70      }; // class CDate;
71
72} // namespace xios
73
74#endif // __XMLIO_CDate__
Note: See TracBrowser for help on using the repository browser.