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

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

Préparation nouvelle arborescence

File size: 1.4 KB
Line 
1#include "julian.hpp"
2
3namespace xmlioserver
4{
5   namespace date
6   {
7      /// ////////////////////// Définitions ////////////////////// ///
8
9      CJulianCalendar::CJulianCalendar(const StdString & dateStr)
10         : CCalendar("Julian", dateStr)
11      { /* Ne rien faire de plus */ }
12
13      CJulianCalendar::CJulianCalendar(int yr, int mth, int d,
14                                       int hr, int min, int sec)
15         : CCalendar("Julian", yr, mth, d, hr, min, sec)
16      { /* Ne rien faire de plus */ }
17
18      CJulianCalendar::~CJulianCalendar(void)
19      { /* Ne rien faire de plus */ }
20
21      ///--------------------------------------------------------------
22
23      int CJulianCalendar::getYearTotalLength(const CDate & date) const
24      { // Retourne la durée d'une année en seconde.
25         if (date.getYear() % 4 == 0) return (366 * 86400);
26         return (365 * 86400);
27      }
28
29      int CJulianCalendar::getMonthLength(const CDate & date) const
30      { // Retourne la durée du mois en jour.
31         if (date.getMonth() == 2)
32         {
33            if (date.getYear()%4 == 0) return 29;
34               return 28;
35         }
36         return (CCalendar::getMonthLength(date));
37      }
38
39      StdString CJulianCalendar::getType(void) const
40      { return (StdString("julian")); }
41
42      ///--------------------------------------------------------------
43   } // namespace date
44} // namespace xmlioserver
Note: See TracBrowser for help on using the repository browser.