Salome HOME
PR: mergefrom_BR_CCRT_11Nov04
[modules/kernel.git] / src / Batch / Batch_DateType.cxx
1 /*
2  * DateType.cxx : 
3  *
4  * Auteur : Ivan DUTKA-MALEN - EDF R&D
5  * Mail   : mailto:ivan.dutka-malen@der.edf.fr
6  * Date   : Wed Nov 26 11:15:34 2003
7  * Projet : Salome 2
8  *
9  */
10 extern "C" {
11 #include <time.h>
12 }
13 #include "Batch_DateType.hxx"
14 using namespace std;
15
16 namespace Batch {
17
18         // Conversion en chaine
19   string DateType::affiche() const
20   {
21     return _data.str();
22   }
23
24         // Operateur d'affectation
25   DateType & DateType::operator =(const Date & d)
26   {
27     _data = d;
28     return *this;
29   }
30
31         // Conversion en Date
32   DateType::operator Date() const
33   {
34     return _data;
35   }
36
37         // Conversion en long
38   DateType::operator long() const
39   {
40     return _data.epoch();
41   }
42
43         // Clone duplique l'objet et en fabrique un nouveau a l'aide de new
44         // qu'il faudra detruire ensuite manuellement
45   GenericType * DateType::clone() const
46   {
47     DateType * pD = new DateType(this->_data);
48     assert(pD != 0);
49     return pD;
50   }
51
52 }