source: XMLIO_V2/dev/common/src/xmlio/date.hpp @ 219

Last change on this file since 219 was 219, checked in by hozdoba, 13 years ago

Préparation nouvelle arborescence

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