dcmdata/include/dcmtk/dcmdata/dcvrsh.h

00001 /*
00002  *
00003  *  Copyright (C) 1994-2010, OFFIS e.V.
00004  *  All rights reserved.  See COPYRIGHT file for details.
00005  *
00006  *  This software and supporting documentation were developed by
00007  *
00008  *    OFFIS e.V.
00009  *    R&D Division Health
00010  *    Escherweg 2
00011  *    D-26121 Oldenburg, Germany
00012  *
00013  *
00014  *  Module:  dcmdata
00015  *
00016  *  Author:  Gerd Ehlers
00017  *
00018  *  Purpose: Interface of class DcmShortString
00019  *
00020  *  Last Update:      $Author: joergr $
00021  *  Update Date:      $Date: 2010-11-05 09:34:11 $
00022  *  CVS/RCS Revision: $Revision: 1.23 $
00023  *  Status:           $State: Exp $
00024  *
00025  *  CVS/RCS Log at end of file
00026  *
00027  */
00028 
00029 
00030 #ifndef DCVRSH_H
00031 #define DCVRSH_H
00032 
00033 #include "dcmtk/config/osconfig.h"    /* make sure OS specific configuration is included first */
00034 
00035 #include "dcmtk/dcmdata/dcchrstr.h"
00036 
00037 
00040 class DcmShortString
00041   : public DcmCharString
00042 {
00043 
00044   public:
00045 
00051     DcmShortString(const DcmTag &tag,
00052                    const Uint32 len = 0);
00053 
00057     DcmShortString(const DcmShortString &old);
00058 
00061     virtual ~DcmShortString();
00062 
00067     DcmShortString &operator=(const DcmShortString &obj);
00068 
00072     virtual DcmObject *clone() const
00073     {
00074       return new DcmShortString(*this);
00075     }
00076 
00089     virtual OFCondition copyFrom(const DcmObject& rhs);
00090 
00094     virtual DcmEVR ident() const;
00095 
00103     virtual OFCondition checkValue(const OFString &vm = "1-n",
00104                                    const OFBool oldFormat = OFFalse);
00105 
00112     virtual OFCondition getOFString(OFString &stringVal,
00113                                     const unsigned long pos,
00114                                     OFBool normalize = OFTrue);
00115 
00116     /* --- static helper functions --- */
00117 
00126     static OFCondition checkStringValue(const OFString &value,
00127                                         const OFString &vm = "1-n");
00128 };
00129 
00130 
00131 #endif // DCVRSH_H
00132 
00133 
00134 /*
00135 ** CVS/RCS Log:
00136 ** $Log: dcvrsh.h,v $
00137 ** Revision 1.23  2010-11-05 09:34:11  joergr
00138 ** Added support for checking the value multiplicity "9" (see Supplement 131).
00139 **
00140 ** Revision 1.22  2010-10-14 13:15:43  joergr
00141 ** Updated copyright header. Added reference to COPYRIGHT file.
00142 **
00143 ** Revision 1.21  2010-04-23 15:26:13  joergr
00144 ** Specify an appropriate default value for the "vm" parameter of checkValue().
00145 **
00146 ** Revision 1.20  2010-04-23 14:25:27  joergr
00147 ** Added new method to all VR classes which checks whether the stored value
00148 ** conforms to the VR definition and to the specified VM.
00149 **
00150 ** Revision 1.19  2010-04-22 09:31:30  joergr
00151 ** Revised misleading parameter documentation for the checkValue() method.
00152 **
00153 ** Revision 1.18  2010-04-22 08:59:10  joergr
00154 ** Added support for further VM values ("1-8", "1-99", "16", "32") to be checked.
00155 **
00156 ** Revision 1.17  2009-08-03 09:05:30  joergr
00157 ** Added methods that check whether a given string value conforms to the VR and
00158 ** VM definitions of the DICOM standards.
00159 **
00160 ** Revision 1.16  2008-07-17 11:19:49  onken
00161 ** Updated copyFrom() documentation.
00162 **
00163 ** Revision 1.15  2008-07-17 10:30:23  onken
00164 ** Implemented copyFrom() method for complete DcmObject class hierarchy, which
00165 ** permits setting an instance's value from an existing object. Implemented
00166 ** assignment operator where necessary.
00167 **
00168 ** Revision 1.14  2005-12-08 16:29:07  meichel
00169 ** Changed include path schema for all DCMTK header files
00170 **
00171 ** Revision 1.13  2004/07/01 12:28:25  meichel
00172 ** Introduced virtual clone method for DcmObject and derived classes.
00173 **
00174 ** Revision 1.12  2002/12/06 12:49:18  joergr
00175 ** Enhanced "print()" function by re-working the implementation and replacing
00176 ** the boolean "showFullData" parameter by a more general integer flag.
00177 ** Added doc++ documentation.
00178 ** Made source code formatting more consistent with other modules/files.
00179 **
00180 ** Revision 1.11  2002/04/25 09:56:48  joergr
00181 ** Removed getOFStringArray() implementation.
00182 **
00183 ** Revision 1.10  2001/09/25 17:19:33  meichel
00184 ** Adapted dcmdata to class OFCondition
00185 **
00186 ** Revision 1.9  2001/06/01 15:48:52  meichel
00187 ** Updated copyright header
00188 **
00189 ** Revision 1.8  2000/03/08 16:26:25  meichel
00190 ** Updated copyright header.
00191 **
00192 ** Revision 1.7  1999/03/31 09:25:05  meichel
00193 ** Updated copyright header in module dcmdata
00194 **
00195 ** Revision 1.6  1998/11/12 16:47:53  meichel
00196 ** Implemented operator= for all classes derived from DcmObject.
00197 **
00198 ** Revision 1.5  1997/09/11 15:13:16  hewett
00199 ** Modified getOFString method arguments by removing a default value
00200 ** for the pos argument.  By requiring the pos argument to be provided
00201 ** ensures that callers realise getOFString only gets one component of
00202 ** a multi-valued string.
00203 **
00204 ** Revision 1.4  1997/08/29 08:32:44  andreas
00205 ** - Added methods getOFString and getOFStringArray for all
00206 **   string VRs. These methods are able to normalise the value, i. e.
00207 **   to remove leading and trailing spaces. This will be done only if
00208 **   it is described in the standard that these spaces are not relevant.
00209 **   These methods do not test the strings for conformance, this means
00210 **   especially that they do not delete spaces where they are not allowed!
00211 **   getOFStringArray returns the string with all its parts separated by \
00212 **   and getOFString returns only one value of the string.
00213 **   CAUTION: Currently getString returns a string with trailing
00214 **   spaces removed (if dcmEnableAutomaticInputDataCorrection == OFTrue) and
00215 **   truncates the original string (since it is not copied!). If you rely on this
00216 **   behaviour please change your application now.
00217 **   Future changes will ensure that getString returns the original
00218 **   string from the DICOM object (NULL terminated) inclusive padding.
00219 **   Currently, if you call getOF... before calling getString without
00220 **   normalisation, you can get the original string read from the DICOM object.
00221 **
00222 ** Revision 1.3  1996/01/05 13:23:08  andreas
00223 ** - changed to support new streaming facilities
00224 ** - more cleanups
00225 ** - merged read / write methods for block and file transfer
00226 **
00227 */


Generated on 6 Jan 2011 for OFFIS DCMTK Version 3.6.0 by Doxygen 1.5.1