Salome HOME
Porting functionality on Win32 Platform
[modules/kernel.git] / src / Batch / Batch_DateType.cxx
1 // Copyright (C) 2005  OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
2 // CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
3 // 
4 // This library is free software; you can redistribute it and/or
5 // modify it under the terms of the GNU Lesser General Public
6 // License as published by the Free Software Foundation; either 
7 // version 2.1 of the License.
8 // 
9 // This library is distributed in the hope that it will be useful 
10 // but WITHOUT ANY WARRANTY; without even the implied warranty of 
11 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU 
12 // Lesser General Public License for more details.
13 //
14 // You should have received a copy of the GNU Lesser General Public  
15 // License along with this library; if not, write to the Free Software 
16 // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
17 //
18 // See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
19 //
20 /*
21  * DateType.cxx : 
22  *
23  * Auteur : Ivan DUTKA-MALEN - EDF R&D
24  * Mail   : mailto:ivan.dutka-malen@der.edf.fr
25  * Date   : Wed Nov 26 11:15:34 2003
26  * Projet : Salome 2
27  *
28  */
29 extern "C" {
30 #include <time.h>
31 }
32 #include <assert.h>
33 #include "Batch_DateType.hxx"
34 using namespace std;
35
36 namespace Batch {
37
38         // Conversion en chaine
39   string DateType::affiche() const
40   {
41     return _data.str();
42   }
43
44         // Operateur d'affectation
45   DateType & DateType::operator =(const Date & d)
46   {
47     _data = d;
48     return *this;
49   }
50
51         // Conversion en Date
52   DateType::operator Date() const
53   {
54     return _data;
55   }
56
57         // Conversion en long
58   DateType::operator long() const
59   {
60     return _data.epoch();
61   }
62
63         // Clone duplique l'objet et en fabrique un nouveau a l'aide de new
64         // qu'il faudra detruire ensuite manuellement
65   GenericType * DateType::clone() const
66   {
67     DateType * pD = new DateType(this->_data);
68     assert(pD != 0);
69     return pD;
70   }
71
72 }