Salome HOME
Porting to Mandrake 10.1 and new products:
[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 <assert.h>
14 #include "Batch_DateType.hxx"
15 using namespace std;
16
17 namespace Batch {
18
19         // Conversion en chaine
20   string DateType::affiche() const
21   {
22     return _data.str();
23   }
24
25         // Operateur d'affectation
26   DateType & DateType::operator =(const Date & d)
27   {
28     _data = d;
29     return *this;
30   }
31
32         // Conversion en Date
33   DateType::operator Date() const
34   {
35     return _data;
36   }
37
38         // Conversion en long
39   DateType::operator long() const
40   {
41     return _data.epoch();
42   }
43
44         // Clone duplique l'objet et en fabrique un nouveau a l'aide de new
45         // qu'il faudra detruire ensuite manuellement
46   GenericType * DateType::clone() const
47   {
48     DateType * pD = new DateType(this->_data);
49     assert(pD != 0);
50     return pD;
51   }
52
53 }