DCMTK  Version 3.6.1 20120515
OFFIS DICOM Toolkit
Public Member Functions | Protected Member Functions | Private Attributes
DcmCharString Class Reference

base class for DICOM elements with value representation LO, LT, PN, SH, ST, UT More...

+ Inheritance diagram for DcmCharString:

List of all members.

Public Member Functions

 DcmCharString (const DcmTag &tag, const Uint32 len)
 constructor.
 DcmCharString (const DcmCharString &old)
 copy constructor
virtual ~DcmCharString ()
 destructor
DcmCharStringoperator= (const DcmCharString &obj)
 assignment operator
virtual DcmObjectclone () const
 clone method
virtual OFCondition copyFrom (const DcmObject &rhs)
 Virtual object copying.
virtual OFCondition verify (const OFBool autocorrect=OFFalse)
 check the currently stored string value.
virtual OFBool containsExtendedCharacters (const OFBool checkAllStrings=OFFalse)
 check if this element contains non-ASCII characters.
virtual OFBool isAffectedBySpecificCharacterSet () const
 check if this element is affected by SpecificCharacterSet
virtual OFCondition convertCharacterSet (DcmSpecificCharacterSet &converter)
 convert this element value from the currently selected source character set to the currently selected destination character set

Protected Member Functions

void setDelimiterChars (const OFString &characters)
 delimiter characters specifying when to switch back to the default character set (in case code extension techniques like ISO 2022 are used)

Private Attributes

OFString delimiterChars
 delimiter characters specifying when to switch back to the default character set (in case code extension techniques like ISO 2022 are used)

Detailed Description

base class for DICOM elements with value representation LO, LT, PN, SH, ST, UT


Constructor & Destructor Documentation

DcmCharString::DcmCharString ( const DcmTag tag,
const Uint32  len 
)

constructor.

Create new element from given tag and length.

Parameters:
tagDICOM tag for the new element
lenvalue length for the new element

copy constructor

Parameters:
oldelement to be copied

Member Function Documentation

virtual DcmObject* DcmCharString::clone ( ) const [inline, virtual]

clone method

Returns:
deep copy of this object

Reimplemented from DcmByteString.

Reimplemented in DcmLongString, DcmPersonName, DcmShortString, DcmShortText, DcmUnlimitedText, and DcmLongText.

virtual OFBool DcmCharString::containsExtendedCharacters ( const OFBool  checkAllStrings = OFFalse) [virtual]

check if this element contains non-ASCII characters.

Please note that this check is pretty simple and only works for single-byte character sets that do include the 7-bit ASCII codes, e.g. for the ISO 8859 family. In other words: All character codes below 128 are considered to be ASCII codes and all others are considered to be non-ASCII.

Parameters:
checkAllStringsnot used in this class
Returns:
true if element contains non-ASCII characters, false otherwise

Reimplemented from DcmByteString.

convert this element value from the currently selected source character set to the currently selected destination character set

Parameters:
convertercharacter set converter to be used to convert the element value
Returns:
always returns EC_Normal, since nothing to do in this base class

Reimplemented from DcmObject.

virtual OFCondition DcmCharString::copyFrom ( const DcmObject rhs) [virtual]

Virtual object copying.

This method can be used for DcmObject and derived classes to get a deep copy of an object. Internally the assignment operator is called if the given DcmObject parameter is of the same type as "this" object instance. If not, an error is returned. This function permits copying an object by value in a virtual way which therefore is different to just calling the assignment operator of DcmElement which could result in slicing the object.

Parameters:
rhs- [in] The instance to copy from. Has to be of the same class type as "this" object
Returns:
EC_Normal if copying was successful, error otherwise

Reimplemented from DcmByteString.

Reimplemented in DcmLongString, DcmPersonName, DcmShortString, DcmShortText, DcmUnlimitedText, and DcmLongText.

virtual OFBool DcmCharString::isAffectedBySpecificCharacterSet ( ) const [virtual]

check if this element is affected by SpecificCharacterSet

Returns:
always returns true since all derived VR classes are affected by the SpecificCharacterSet (0008,0005) element

Reimplemented from DcmByteString.

DcmCharString& DcmCharString::operator= ( const DcmCharString obj)

assignment operator

Parameters:
objelement to be assigned/copied
Returns:
reference to this object
void DcmCharString::setDelimiterChars ( const OFString characters) [inline, protected]

delimiter characters specifying when to switch back to the default character set (in case code extension techniques like ISO 2022 are used)

Parameters:
charactersdelimiter characters to be used for character set conversion
virtual OFCondition DcmCharString::verify ( const OFBool  autocorrect = OFFalse) [virtual]

check the currently stored string value.

Checks every string component for the maximum length specified for the particular value representation.

Parameters:
autocorrectcorrect value and value component length if OFTrue. NB: This parameter does currently nothing since it is unknown to this class whether a character consists of one or more bytes. To be fixed in a future version when multi-byte character sets are (hopefully) supported.
Returns:
status, EC_Normal if value length is correct, an error code otherwise

Reimplemented from DcmByteString.


The documentation for this class was generated from the following file:


Generated on Tue May 15 2012 for DCMTK Version 3.6.1 20120515 by Doxygen 1.7.5.1-20111027