Ignore:
Timestamp:
07/20/10 16:20:13 (14 years ago)
Author:
hozdoba
Message:

Quelques modifications supplémentaires apportées aux dates et calendriers.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • XMLIO_V2/dev/dev_rv/src/XMLIO/date.hpp

    r118 r119  
    88      public : 
    99 
    10          Date(const AbstractCalendar& cal, int yr = 0, int mth = 0, int d = 0, int hr = 0, int min = 0 , int sec = 0) : relCalendar(cal) 
     10         Date(const AbstractCalendar& cal, int yr = 0, int mth = 1, int d = 1, int hr = 0, int min = 0 , int sec = 0) : relCalendar(cal) 
    1111            , year(yr), month(mth), day(d), hour(hr), minute(min), second(sec) 
    12          {/* Ne rien faire de plus */} 
     12         { 
     13            if(!checkDate()) 
     14               WARNING("La date initialisée a été modifiée car elle était incorrecte par rapport au calendrier souhaité."); 
     15         } 
    1316 
    1417         Date(const Date& d) : relCalendar(d.relCalendar) 
    1518            , year(d.year), month(d.month), day(d.day), hour(d.hour), minute(d.minute), second(d.second) 
    16          {/* Ne rien faire de plus */} 
     19         { 
     20            if(!checkDate()) 
     21               WARNING("La date initialisée a été modifiée car elle était incorrecte par rapport au calendrier souhaité."); 
     22         } 
    1723 
    1824         operator Time(void); // Retourne le nombre de secondes écoulées depuis la date initiale définie dans le calendrier. 
     25         bool checkDate(void); // Vérifie la validité de la date. 
    1926 
    2027         friend std::ostream& operator<<(std::ostream& out, const Date& d) 
     
    3037            in >> d.day  >> c >> d.month  >> c >> d.year   >> c; 
    3138            in >> d.hour >> c >> d.minute >> c >> d.second; 
     39            if(!d.checkDate()) 
     40               WARNING("La date initialisée (depuis une chaîne de caractÚres) a été modifiée car elle était incorrecte par rapport au calendrier souhaité."); 
    3241            return (in); 
    3342         } 
Note: See TracChangeset for help on using the changeset viewer.