Class for string values.
More...
DSRStringValue::DSRStringValue |
( |
const OFString & |
stringValue, |
|
|
const OFBool |
check = OFTrue |
|
) |
| |
constructor
- Parameters
-
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. |
copy constructor
- Parameters
-
stringValue | string value to be copied (not checked !) |
OFCondition DSRStringValue::checkCurrentValue |
( |
) | |
const |
|
protected |
check the currently stored string value for validity.
See above checkValue() method for details.
- Returns
- status, EC_Normal if value is valid, an error code otherwise
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.
- Parameters
-
stringValue | value to be checked |
- Returns
- status, EC_Normal if current value is valid, an error code otherwise
Reimplemented in DSRDateTreeNode, DSRDateTimeTreeNode, DSRTimeTreeNode, DSRPNameTreeNode, DSRTextTreeNode, and DSRUIDRefTreeNode.
virtual void DSRStringValue::clear |
( |
) | |
|
|
virtual |
const OFString& DSRStringValue::getValue |
( |
) | |
const |
|
inline |
get string value
- Returns
- reference to string value
virtual OFBool DSRStringValue::isValid |
( |
) | |
const |
|
virtual |
assignment operator
- Parameters
-
stringValue | string value to be copied (not checked !) |
- Returns
- reference to this string value after 'stringValue' has been copied
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).
- Parameters
-
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 meachanism off (default), i.e. the full string value is printed. |
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.
- Parameters
-
dataset | DICOM dataset from which the string value should be read |
tagKey | DICOM tag specifying the attribute which should be read |
- Returns
- status, EC_Normal if successful, an error code otherwise
read string value from XML document
- Parameters
-
doc | document containing the XML file content |
cursor | cursor pointing to the starting node |
encoding | use encoding handler if OFTrue, ignore character set otherwise |
- Returns
- status, EC_Normal if successful, an error code otherwise
OFCondition DSRStringValue::renderHTML |
( |
STD_NAMESPACE ostream & |
docStream, |
|
|
const size_t |
flags |
|
) |
| const |
render string value in HTML/XHTML format
- Parameters
-
docStream | output stream to which the main HTML/XHTML document is written |
flags | flag used to customize the output (see DSRTypes::HF_xxx) |
- Returns
- status, EC_Normal if successful, an error code otherwise
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).
- Parameters
-
stringValue | value to be set (various VRs, mandatory) |
check | check 'stringValue' for conformance with VR and VM if enabled. An empty value is never accepted. |
- Returns
- status, EC_Normal if successful, an error code otherwise
write string value to dataset
- Parameters
-
dataset | DICOM dataset to which the string value should be written |
tagKey | DICOM tag specifying the attribute which should be written |
- Returns
- status, EC_Normal if successful, an error code otherwise
The documentation for this class was generated from the following file:
- /tmp/buildd/dcmtk-3.6.1~20121102/dcmsr/include/dcmtk/dcmsr/dsrstrvl.h