OFFIS DCMTK  Version 3.6.0
ofdatime.h
1 /*
2  *
3  * Copyright (C) 2002-2010, OFFIS e.V.
4  * All rights reserved. See COPYRIGHT file for details.
5  *
6  * This software and supporting documentation were developed by
7  *
8  * OFFIS e.V.
9  * R&D Division Health
10  * Escherweg 2
11  * D-26121 Oldenburg, Germany
12  *
13  *
14  * Module: ofstd
15  *
16  * Author: Joerg Riesmeier
17  *
18  * Purpose: Combined class for date and time functions
19  *
20  * Last Update: $Author: joergr $
21  * Update Date: $Date: 2010-10-14 13:15:50 $
22  * CVS/RCS Revision: $Revision: 1.10 $
23  * Status: $State: Exp $
24  *
25  * CVS/RCS Log at end of file
26  *
27  */
28 
29 
30 #ifndef OFDATIME_H
31 #define OFDATIME_H
32 
33 #include "dcmtk/config/osconfig.h"
34 
35 #include "dcmtk/ofstd/ofstring.h" /* for class OFString */
36 #include "dcmtk/ofstd/ofdate.h" /* for class OFDate */
37 #include "dcmtk/ofstd/oftime.h" /* for class OFTime */
38 
39 
40 /*---------------------*
41  * class declaration *
42  *---------------------*/
43 
47 {
48 
49  public:
50 
54  OFDateTime();
55 
59  OFDateTime(const OFDateTime &dateTime);
60 
65  OFDateTime(const OFDate &dateVal,
66  const OFTime &timeVal);
67 
77  OFDateTime(const unsigned int year,
78  const unsigned int month,
79  const unsigned int day,
80  const unsigned int hour,
81  const unsigned int minute,
82  const double second,
83  const double timeZone = 0);
84 
87  virtual ~OFDateTime();
88 
93  virtual OFDateTime &operator=(const OFDateTime &dateTime);
94 
102  virtual OFBool operator==(const OFDateTime &dateTime) const;
103 
111  virtual OFBool operator!=(const OFDateTime &dateTime) const;
112 
116  virtual void clear();
117 
122  virtual OFBool isValid() const;
123 
135  OFBool setDateTime(const unsigned int year,
136  const unsigned int month,
137  const unsigned int day,
138  const unsigned int hour,
139  const unsigned int minute,
140  const double second,
141  const double timeZone = 0);
142 
148  OFBool setDate(const OFDate &dateVal);
149 
155  OFBool setTime(const OFTime &timeVal);
156 
163  OFBool setDateTime(const OFDate &dateVal,
164  const OFTime &timeVal);
165 
171  OFBool setCurrentDateTime();
172 
181  OFBool setISOFormattedDateTime(const OFString &formattedDateTime);
182 
186  const OFDate &getDate() const;
187 
191  const OFTime &getTime() const;
192 
208  OFBool getISOFormattedDateTime(OFString &formattedDateTime,
209  const OFBool showSeconds = OFTrue,
210  const OFBool showFraction = OFFalse,
211  const OFBool showTimeZone = OFFalse,
212  const OFBool showDelimiter = OFTrue) const;
213 
230  OFBool getISOFormattedDateTime(OFString &formattedDateTime,
231  const OFBool showSeconds /*= OFTrue*/,
232  const OFBool showFraction /*= OFFalse*/,
233  const OFBool showTimeZone /*= OFFalse*/,
234  const OFBool showDelimiter /*= OFTrue*/,
235  const OFString &dateTimeSeparator /*= " "*/) const;
236 
237  /* --- static helper functions --- */
238 
243 
244 
245  private:
246 
249 
252 };
253 
254 
261 STD_NAMESPACE ostream& operator<<(STD_NAMESPACE ostream& stream, const OFDateTime &dateTime);
262 
263 
264 #endif
265 
266 
267 /*
268  *
269  * CVS/RCS Log:
270  * $Log: ofdatime.h,v $
271  * Revision 1.10 2010-10-14 13:15:50 joergr
272  * Updated copyright header. Added reference to COPYRIGHT file.
273  *
274  * Revision 1.9 2008-05-21 16:31:22 joergr
275  * Added new constructor and new setDateTime() method.
276  *
277  * Revision 1.8 2006/08/14 16:42:26 meichel
278  * Updated all code in module ofstd to correctly compile if the standard
279  * namespace has not included into the global one with a "using" directive.
280  *
281  * Revision 1.7 2005/12/08 16:05:55 meichel
282  * Changed include path schema for all DCMTK header files
283  *
284  * Revision 1.6 2004/04/16 12:43:26 joergr
285  * Restructured code to avoid default parameter values for "complex types" like
286  * OFString. Required for Sun CC 2.0.1.
287  *
288  * Revision 1.5 2004/01/16 10:30:39 joergr
289  * Added setISOFormattedXXX() methods for Date, Time and DateTime.
290  *
291  * Revision 1.4 2003/12/17 15:16:20 joergr
292  * Added note to the comparison operators that the "day overflow" is not yet
293  * handled correctly.
294  *
295  * Revision 1.3 2003/09/15 12:12:56 joergr
296  * Fixed incorrect/improper comments of the comparision operators. Enhanced
297  * comment of the default constructor. Made comparison operators const.
298  *
299  * Revision 1.2 2002/05/24 09:43:04 joergr
300  * Renamed some parameters/variables to avoid ambiguities.
301  *
302  * Revision 1.1 2002/04/11 12:12:23 joergr
303  * Introduced new standard classes providing date and time functions.
304  *
305  *
306  */


Generated on Thu Dec 20 2012 for OFFIS DCMTK Version 3.6.0 by Doxygen 1.8.2