Main Page | Class Hierarchy | Alphabetical List | Class List | File List | Class Members | Related Pages

dcvrtm.h

00001 /*
00002  *
00003  *  Copyright (C) 1994-2002, OFFIS
00004  *
00005  *  This software and supporting documentation were developed by
00006  *
00007  *    Kuratorium OFFIS e.V.
00008  *    Healthcare Information and Communication Systems
00009  *    Escherweg 2
00010  *    D-26121 Oldenburg, Germany
00011  *
00012  *  THIS SOFTWARE IS MADE AVAILABLE,  AS IS,  AND OFFIS MAKES NO  WARRANTY
00013  *  REGARDING  THE  SOFTWARE,  ITS  PERFORMANCE,  ITS  MERCHANTABILITY  OR
00014  *  FITNESS FOR ANY PARTICULAR USE, FREEDOM FROM ANY COMPUTER DISEASES  OR
00015  *  ITS CONFORMITY TO ANY SPECIFICATION. THE ENTIRE RISK AS TO QUALITY AND
00016  *  PERFORMANCE OF THE SOFTWARE IS WITH THE USER.
00017  *
00018  *  Module:  dcmdata
00019  *
00020  *  Author:  Gerd Ehlers, Joerg Riesmeier
00021  *
00022  *  Purpose: Interface of class DcmTime
00023  *
00024  *  Last Update:      $Author: joergr $
00025  *  Update Date:      $Date: 2002/12/06 12:49:19 $
00026  *  Source File:      $Source: /share/dicom/cvs-depot/dcmtk/dcmdata/include/dcvrtm.h,v $
00027  *  CVS/RCS Revision: $Revision: 1.15 $
00028  *  Status:           $State: Exp $
00029  *
00030  *  CVS/RCS Log at end of file
00031  *
00032  */
00033 
00034 #ifndef DCVRTM_H
00035 #define DCVRTM_H
00036 
00037 #include "osconfig.h"    /* make sure OS specific configuration is included first */
00038 
00039 #include "dctypes.h"
00040 #include "dcbytstr.h"
00041 #include "oftime.h"
00042 
00043 
00046 class DcmTime
00047   : public DcmByteString
00048 {
00049 
00050   public:
00051 
00057     DcmTime(const DcmTag &tag,
00058             const Uint32 len = 0);
00059 
00063     DcmTime(const DcmTime &old);
00064 
00067     virtual ~DcmTime();
00068 
00073     DcmTime &operator=(const DcmTime &obj);
00074 
00078     virtual DcmEVR ident() const;
00079 
00086     virtual OFCondition getOFString(OFString &stringValue,
00087                                     const unsigned long pos,
00088                                     OFBool normalize = OFTrue);
00089 
00100     OFCondition setCurrentTime(const OFBool seconds = OFTrue,
00101                                const OFBool fraction = OFFalse);
00102 
00107     OFCondition setOFTime(const OFTime &timeValue);
00108 
00120     OFCondition getOFTime(OFTime &timeValue,
00121                           const unsigned long pos = 0,
00122                           const OFBool supportOldFormat = OFTrue);
00123 
00144     OFCondition getISOFormattedTime(OFString &formattedTime,
00145                                     const unsigned long pos = 0,
00146                                     const OFBool seconds = OFTrue,
00147                                     const OFBool fraction = OFFalse,
00148                                     const OFBool createMissingPart = OFFalse,
00149                                     const OFBool supportOldFormat = OFTrue);
00150 
00151     /* --- static helper functions --- */
00152 
00164     static OFCondition getCurrentTime(OFString &dicomTime,
00165                                       const OFBool seconds = OFTrue,
00166                                       const OFBool fraction = OFFalse);
00167 
00180     static OFCondition getDicomTimeFromOFTime(const OFTime &timeValue,
00181                                               OFString &dicomTime,
00182                                               const OFBool seconds = OFTrue,
00183                                               const OFBool fraction = OFFalse);
00184 
00196     static OFCondition getOFTimeFromString(const OFString &dicomTime,
00197                                            OFTime &timeValue,
00198                                            const OFBool supportOldFormat = OFTrue);
00199 
00216     static OFCondition getISOFormattedTimeFromString(const OFString &dicomTime,
00217                                                      OFString &formattedTime,
00218                                                      const OFBool seconds = OFTrue,
00219                                                      const OFBool fraction = OFFalse,
00220                                                      const OFBool createMissingPart = OFFalse,
00221                                                      const OFBool supportOldFormat = OFTrue);
00222 
00235     static OFCondition getTimeZoneFromString(const OFString &dicomTimeZone,
00236                                              double &timeZone);
00237 };
00238 
00239 
00240 #endif // DCVRTM_H
00241 
00242 
00243 /*
00244 ** CVS/RCS Log:
00245 ** $Log: dcvrtm.h,v $
00246 ** Revision 1.15  2002/12/06 12:49:19  joergr
00247 ** Enhanced "print()" function by re-working the implementation and replacing
00248 ** the boolean "showFullData" parameter by a more general integer flag.
00249 ** Added doc++ documentation.
00250 ** Made source code formatting more consistent with other modules/files.
00251 **
00252 ** Revision 1.14  2002/04/25 09:58:07  joergr
00253 ** Removed getOFStringArray() implementation.
00254 **
00255 ** Revision 1.13  2002/04/11 12:25:10  joergr
00256 ** Enhanced DICOM date, time and date/time classes. Added support for new
00257 ** standard date and time functions.
00258 **
00259 ** Revision 1.12  2001/10/10 15:18:17  joergr
00260 ** Added new flag to date/time routines allowing to choose whether the old
00261 ** prior V3.0 format for the corresponding DICOM VRs is supported or not.
00262 **
00263 ** Revision 1.11  2001/10/01 15:01:40  joergr
00264 ** Introduced new general purpose functions to get/set person names, date, time
00265 ** and date/time.
00266 **
00267 ** Revision 1.10  2001/09/25 17:19:34  meichel
00268 ** Adapted dcmdata to class OFCondition
00269 **
00270 ** Revision 1.9  2001/06/01 15:48:53  meichel
00271 ** Updated copyright header
00272 **
00273 ** Revision 1.8  2000/03/08 16:26:26  meichel
00274 ** Updated copyright header.
00275 **
00276 ** Revision 1.7  1999/03/31 09:25:08  meichel
00277 ** Updated copyright header in module dcmdata
00278 **
00279 ** Revision 1.6  1998/11/12 16:47:56  meichel
00280 ** Implemented operator= for all classes derived from DcmObject.
00281 **
00282 ** Revision 1.5  1997/09/11 15:13:17  hewett
00283 ** Modified getOFString method arguments by removing a default value
00284 ** for the pos argument.  By requiring the pos argument to be provided
00285 ** ensures that callers realise getOFString only gets one component of
00286 ** a multi-valued string.
00287 **
00288 ** Revision 1.4  1997/08/29 08:32:45  andreas
00289 ** - Added methods getOFString and getOFStringArray for all
00290 **   string VRs. These methods are able to normalise the value, i. e.
00291 **   to remove leading and trailing spaces. This will be done only if
00292 **   it is described in the standard that these spaces are not relevant.
00293 **   These methods do not test the strings for conformance, this means
00294 **   especially that they do not delete spaces where they are not allowed!
00295 **   getOFStringArray returns the string with all its parts separated by \
00296 **   and getOFString returns only one value of the string.
00297 **   CAUTION: Currently getString returns a string with trailing
00298 **   spaces removed (if dcmEnableAutomaticInputDataCorrection == OFTrue) and
00299 **   truncates the original string (since it is not copied!). If you rely on this
00300 **   behaviour please change your application now.
00301 **   Future changes will ensure that getString returns the original
00302 **   string from the DICOM object (NULL terminated) inclusive padding.
00303 **   Currently, if you call getOF... before calling getString without
00304 **   normalisation, you can get the original string read from the DICOM object.
00305 **
00306 ** Revision 1.3  1996/01/05 13:23:10  andreas
00307 ** - changed to support new streaming facilities
00308 ** - more cleanups
00309 ** - merged read / write methods for block and file transfer
00310 **
00311 */


Generated on 8 Dec 2004 for OFFIS DCMTK Version 3.5.3 by Doxygen 1.3.9.1