|
DCMTK Version 3.7.1
OFFIS DICOM Toolkit
|
Class for string values. More...
Public Member Functions | |
| DSRStringValue () | |
| default constructor | |
| DSRStringValue (const OFString &stringValue, const OFBool check=OFTrue) | |
| constructor | |
| DSRStringValue (const DSRStringValue &stringValue) | |
| copy constructor | |
| virtual | ~DSRStringValue () |
| destructor | |
| DSRStringValue & | operator= (const DSRStringValue &stringValue) |
| assignment operator | |
| virtual void | clear () |
| clear all internal variables. | |
| OFBool | isEqual (const DSRStringValue &stringValue) const |
| check whether values are "equal". | |
| OFBool | isNotEqual (const DSRStringValue &stringValue) const |
| check whether values are "not equal". | |
| virtual OFBool | isValid () const |
| check whether the current code is valid. | |
| void | print (STD_NAMESPACE ostream &stream, const size_t maxLength=0) const |
| print string value. | |
| OFCondition | read (DcmItem &dataset, const DcmTagKey &tagKey, const size_t flags) |
| read string value from dataset. | |
| OFCondition | write (DcmItem &dataset, const DcmTagKey &tagKey) const |
| write string value to dataset | |
| OFCondition | readXML (const DSRXMLDocument &doc, DSRXMLCursor cursor, const size_t flags, const OFBool encoding=OFFalse) |
| read string value from XML document | |
| OFCondition | renderHTML (STD_NAMESPACE ostream &docStream, const size_t flags) const |
| render string value in HTML/XHTML format | |
| const OFString & | getValue () const |
| get string value | |
| OFCondition | setValue (const OFString &stringValue, const OFBool check=OFTrue) |
| set string value. | |
| OFCondition | setValue (const DcmElement &delem, const unsigned long pos=0, const OFBool check=OFTrue) |
| set string value from element. | |
| OFCondition | setValue (DcmItem &dataset, const DcmTagKey &tagKey, const unsigned long pos=0, const OFBool check=OFTrue) |
| set string value from dataset. | |
Protected Member Functions | |
| virtual OFCondition | checkValue (const OFString &stringValue) const |
| check the specified string value for validity. | |
| OFCondition | checkCurrentValue () const |
| check the currently stored string value for validity. | |
Private Attributes | |
| OFString | Value |
| string value (various VRs, type 1) | |
Class for string values.
| DSRStringValue::DSRStringValue | ( | const OFString & | stringValue, |
| const OFBool | check = OFTrue ) |
constructor
| stringValue | initial value to be set |
| check | if enabled, check 'stringValue' for validity before setting it. See checkValue() for details. An empty value is never accepted. |
| DSRStringValue::DSRStringValue | ( | const DSRStringValue & | stringValue | ) |
copy constructor
| stringValue | string value to be copied (not checked !) |
References DSRStringValue().
|
protected |
check the currently stored string value for validity.
See above checkValue() method for details.
|
protectedvirtual |
check the specified string value for validity.
This base class just checks that the string value is not empty (since all corresponding DICOM attributes are type 1). Derived classes should overwrite this method to perform more sophisticated tests.
| stringValue | value to be checked |
Reimplemented in DSRDateTimeTreeNode, DSRDateTreeNode, DSRPNameTreeNode, DSRTextTreeNode, DSRTimeTreeNode, and DSRUIDRefTreeNode.
|
virtual |
clear all internal variables.
Please note that the string value might become invalid afterwards.
Reimplemented in DSRDateTimeTreeNode, DSRDateTreeNode, DSRPNameTreeNode, DSRTextTreeNode, DSRTimeTreeNode, and DSRUIDRefTreeNode.
|
inline |
| OFBool DSRStringValue::isEqual | ( | const DSRStringValue & | stringValue | ) | const |
check whether values are "equal".
Please note that padding or other non-significant characters are not removed before comparing the two values, i.e. a simple character-by-character comparison is used.
| stringValue | string value that should be compared to the current one |
References DSRStringValue().
| OFBool DSRStringValue::isNotEqual | ( | const DSRStringValue & | stringValue | ) | const |
check whether values are "not equal".
Please note that padding or other non-significant characters are not removed before comparing the two values, i.e. a simple character-by-character comparison is used.
| stringValue | string value that should be compared to the current one |
References DSRStringValue().
|
virtual |
check whether the current code is valid.
See checkValue() for details.
Reimplemented in DSRDateTimeTreeNode, DSRDateTreeNode, DSRPNameTreeNode, DSRTextTreeNode, DSRTimeTreeNode, and DSRUIDRefTreeNode.
| DSRStringValue & DSRStringValue::operator= | ( | const DSRStringValue & | stringValue | ) |
assignment operator
| stringValue | string value to be copied (not checked !) |
References DSRStringValue().
| void DSRStringValue::print | ( | STD_NAMESPACE ostream & | stream, |
| const size_t | maxLength = 0 ) const |
print string value.
The output of a typical string value looks like this: "Short text" or "Very long t..." (incl. the quotation marks).
| stream | output stream to which the string value should be printed |
| maxLength | maximum number of characters to be printed. If the string value is longer the output is shortened automatically and three dots "..." are added. The value of 'maxLength' includes these three trailing char's. A value of 0 turns this mechanism off (default), i.e. the full string value is printed. |
| OFCondition DSRStringValue::read | ( | DcmItem & | dataset, |
| const DcmTagKey & | tagKey, | ||
| const size_t | flags ) |
read string value from dataset.
If error/warning output is enabled, a warning message is printed if the string value does not conform with the type (1), value multiplicity (1) and/or value representation.
| dataset | DICOM dataset from which the string value should be read |
| tagKey | DICOM tag specifying the attribute that should be read |
| flags | flag used to customize the reading process (see DSRTypes::RF_xxx) |
| OFCondition DSRStringValue::readXML | ( | const DSRXMLDocument & | doc, |
| DSRXMLCursor | cursor, | ||
| const size_t | flags, | ||
| const OFBool | encoding = OFFalse ) |
read string value from XML document
| doc | document containing the XML file content |
| cursor | cursor pointing to the starting node |
| flags | flag used to customize the reading process (see DSRTypes::XF_xxx) |
| encoding | use encoding handler if OFTrue, ignore character set otherwise |
| OFCondition DSRStringValue::renderHTML | ( | STD_NAMESPACE ostream & | docStream, |
| const size_t | flags ) const |
render string value in HTML/XHTML format
| docStream | output stream to which the main HTML/XHTML document is written |
| flags | flag used to customize the output (see DSRTypes::HF_xxx) |
| OFCondition DSRStringValue::setValue | ( | const DcmElement & | delem, |
| const unsigned long | pos = 0, | ||
| const OFBool | check = OFTrue ) |
set string value from element.
Before setting the string value, it is usually checked. If the value is invalid, the current value is not replaced and remains unchanged.
| delem | DICOM element from which the string value should be retrieved |
| pos | index of the value in case of multi-valued elements (0..vm-1) |
| check | if enabled, check string value for validity before setting it. See checkValue() method for details. An empty value is never accepted. |
| OFCondition DSRStringValue::setValue | ( | const OFString & | stringValue, |
| const OFBool | check = OFTrue ) |
set string value.
Before setting the string value, it is usually checked. If the value is invalid, the current value is not replaced and remains unchanged. Use the clear() method to empty the string value (which becomes invalid afterwards).
| stringValue | value to be set (various VRs, mandatory) |
| check | if enabled, check value for validity before setting it. See checkValue() method for details. An empty value is never accepted. |
| OFCondition DSRStringValue::setValue | ( | DcmItem & | dataset, |
| const DcmTagKey & | tagKey, | ||
| const unsigned long | pos = 0, | ||
| const OFBool | check = OFTrue ) |
set string value from dataset.
Before setting the string value, it is usually checked. If the value is invalid, the current value is not replaced and remains unchanged.
| dataset | DICOM dataset from which the string value should be retrieved |
| tagKey | DICOM tag specifying the attribute from which the value should be retrieved. The search is limited to the top-level of the dataset. |
| pos | index of the value in case of multi-valued elements (0..vm-1) |
| check | if enabled, check string value for validity before setting it. See checkValue() method for details. An empty value is never accepted. |
| OFCondition DSRStringValue::write | ( | DcmItem & | dataset, |
| const DcmTagKey & | tagKey ) const |
write string value to dataset
| dataset | DICOM dataset to which the string value should be written |
| tagKey | DICOM tag specifying the attribute that should be written |