OFFIS DCMTK  Version 3.6.0
dcvrtm.h
1 /*
2  *
3  * Copyright (C) 1994-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: dcmdata
15  *
16  * Author: Gerd Ehlers, Joerg Riesmeier
17  *
18  * Purpose: Interface of class DcmTime
19  *
20  * Last Update: $Author: joergr $
21  * Update Date: $Date: 2010-11-05 09:34:11 $
22  * CVS/RCS Revision: $Revision: 1.26 $
23  * Status: $State: Exp $
24  *
25  * CVS/RCS Log at end of file
26  *
27  */
28 
29 #ifndef DCVRTM_H
30 #define DCVRTM_H
31 
32 #include "dcmtk/config/osconfig.h" /* make sure OS specific configuration is included first */
33 
34 #include "dcmtk/dcmdata/dctypes.h"
35 #include "dcmtk/dcmdata/dcbytstr.h"
36 #include "dcmtk/ofstd/oftime.h"
37 
38 
41 class DcmTime
42  : public DcmByteString
43 {
44 
45  public:
46 
52  DcmTime(const DcmTag &tag,
53  const Uint32 len = 0);
54 
58  DcmTime(const DcmTime &old);
59 
62  virtual ~DcmTime();
63 
68  DcmTime &operator=(const DcmTime &obj);
69 
73  virtual DcmObject *clone() const
74  {
75  return new DcmTime(*this);
76  }
77 
90  virtual OFCondition copyFrom(const DcmObject& rhs);
91 
95  virtual DcmEVR ident() const;
96 
104  virtual OFCondition checkValue(const OFString &vm = "1-n",
105  const OFBool oldFormat = OFFalse);
106 
113  virtual OFCondition getOFString(OFString &stringValue,
114  const unsigned long pos,
115  OFBool normalize = OFTrue);
116 
127  OFCondition setCurrentTime(const OFBool seconds = OFTrue,
128  const OFBool fraction = OFFalse);
129 
134  OFCondition setOFTime(const OFTime &timeValue);
135 
147  OFCondition getOFTime(OFTime &timeValue,
148  const unsigned long pos = 0,
149  const OFBool supportOldFormat = OFTrue);
150 
172  const unsigned long pos = 0,
173  const OFBool seconds = OFTrue,
174  const OFBool fraction = OFFalse,
175  const OFBool createMissingPart = OFFalse,
176  const OFBool supportOldFormat = OFTrue);
177 
178  /* --- static helper functions --- */
179 
191  static OFCondition getCurrentTime(OFString &dicomTime,
192  const OFBool seconds = OFTrue,
193  const OFBool fraction = OFFalse);
194 
207  static OFCondition getDicomTimeFromOFTime(const OFTime &timeValue,
208  OFString &dicomTime,
209  const OFBool seconds = OFTrue,
210  const OFBool fraction = OFFalse);
211 
223  static OFCondition getOFTimeFromString(const OFString &dicomTime,
224  OFTime &timeValue,
225  const OFBool supportOldFormat = OFTrue);
226 
243  static OFCondition getISOFormattedTimeFromString(const OFString &dicomTime,
244  OFString &formattedTime,
245  const OFBool seconds = OFTrue,
246  const OFBool fraction = OFFalse,
247  const OFBool createMissingPart = OFFalse,
248  const OFBool supportOldFormat = OFTrue);
249 
262  static OFCondition getTimeZoneFromString(const OFString &dicomTimeZone,
263  double &timeZone);
264 
274  static OFCondition checkStringValue(const OFString &value,
275  const OFString &vm = "1-n",
276  const OFBool oldFormat = OFFalse);
277 };
278 
279 
280 #endif // DCVRTM_H
281 
282 
283 /*
284 ** CVS/RCS Log:
285 ** $Log: dcvrtm.h,v $
286 ** Revision 1.26 2010-11-05 09:34:11 joergr
287 ** Added support for checking the value multiplicity "9" (see Supplement 131).
288 **
289 ** Revision 1.25 2010-10-14 13:15:43 joergr
290 ** Updated copyright header. Added reference to COPYRIGHT file.
291 **
292 ** Revision 1.24 2010-04-23 15:26:13 joergr
293 ** Specify an appropriate default value for the "vm" parameter of checkValue().
294 **
295 ** Revision 1.23 2010-04-23 14:25:27 joergr
296 ** Added new method to all VR classes which checks whether the stored value
297 ** conforms to the VR definition and to the specified VM.
298 **
299 ** Revision 1.22 2010-04-22 09:31:30 joergr
300 ** Revised misleading parameter documentation for the checkValue() method.
301 **
302 ** Revision 1.21 2010-04-22 08:59:10 joergr
303 ** Added support for further VM values ("1-8", "1-99", "16", "32") to be checked.
304 **
305 ** Revision 1.20 2009-08-03 09:05:30 joergr
306 ** Added methods that check whether a given string value conforms to the VR and
307 ** VM definitions of the DICOM standards.
308 **
309 ** Revision 1.19 2008-07-17 11:19:49 onken
310 ** Updated copyFrom() documentation.
311 **
312 ** Revision 1.18 2008-07-17 10:30:23 onken
313 ** Implemented copyFrom() method for complete DcmObject class hierarchy, which
314 ** permits setting an instance's value from an existing object. Implemented
315 ** assignment operator where necessary.
316 **
317 ** Revision 1.17 2005-12-08 16:29:11 meichel
318 ** Changed include path schema for all DCMTK header files
319 **
320 ** Revision 1.16 2004/07/01 12:28:25 meichel
321 ** Introduced virtual clone method for DcmObject and derived classes.
322 **
323 ** Revision 1.15 2002/12/06 12:49:19 joergr
324 ** Enhanced "print()" function by re-working the implementation and replacing
325 ** the boolean "showFullData" parameter by a more general integer flag.
326 ** Added doc++ documentation.
327 ** Made source code formatting more consistent with other modules/files.
328 **
329 ** Revision 1.14 2002/04/25 09:58:07 joergr
330 ** Removed getOFStringArray() implementation.
331 **
332 ** Revision 1.13 2002/04/11 12:25:10 joergr
333 ** Enhanced DICOM date, time and date/time classes. Added support for new
334 ** standard date and time functions.
335 **
336 ** Revision 1.12 2001/10/10 15:18:17 joergr
337 ** Added new flag to date/time routines allowing to choose whether the old
338 ** prior V3.0 format for the corresponding DICOM VRs is supported or not.
339 **
340 ** Revision 1.11 2001/10/01 15:01:40 joergr
341 ** Introduced new general purpose functions to get/set person names, date, time
342 ** and date/time.
343 **
344 ** Revision 1.10 2001/09/25 17:19:34 meichel
345 ** Adapted dcmdata to class OFCondition
346 **
347 ** Revision 1.9 2001/06/01 15:48:53 meichel
348 ** Updated copyright header
349 **
350 ** Revision 1.8 2000/03/08 16:26:26 meichel
351 ** Updated copyright header.
352 **
353 ** Revision 1.7 1999/03/31 09:25:08 meichel
354 ** Updated copyright header in module dcmdata
355 **
356 ** Revision 1.6 1998/11/12 16:47:56 meichel
357 ** Implemented operator= for all classes derived from DcmObject.
358 **
359 ** Revision 1.5 1997/09/11 15:13:17 hewett
360 ** Modified getOFString method arguments by removing a default value
361 ** for the pos argument. By requiring the pos argument to be provided
362 ** ensures that callers realise getOFString only gets one component of
363 ** a multi-valued string.
364 **
365 ** Revision 1.4 1997/08/29 08:32:45 andreas
366 ** - Added methods getOFString and getOFStringArray for all
367 ** string VRs. These methods are able to normalise the value, i. e.
368 ** to remove leading and trailing spaces. This will be done only if
369 ** it is described in the standard that these spaces are not relevant.
370 ** These methods do not test the strings for conformance, this means
371 ** especially that they do not delete spaces where they are not allowed!
372 ** getOFStringArray returns the string with all its parts separated by \
373 ** and getOFString returns only one value of the string.
374 ** CAUTION: Currently getString returns a string with trailing
375 ** spaces removed (if dcmEnableAutomaticInputDataCorrection == OFTrue) and
376 ** truncates the original string (since it is not copied!). If you rely on this
377 ** behaviour please change your application now.
378 ** Future changes will ensure that getString returns the original
379 ** string from the DICOM object (NULL terminated) inclusive padding.
380 ** Currently, if you call getOF... before calling getString without
381 ** normalisation, you can get the original string read from the DICOM object.
382 **
383 ** Revision 1.3 1996/01/05 13:23:10 andreas
384 ** - changed to support new streaming facilities
385 ** - more cleanups
386 ** - merged read / write methods for block and file transfer
387 **
388 */


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