Inheritance diagram for DcmDate:
Public Member Functions | |
DcmDate (const DcmTag &tag, const Uint32 len=0) | |
constructor. | |
DcmDate (const DcmDate &old) | |
copy constructor | |
virtual | ~DcmDate () |
destructor | |
DcmDate & | operator= (const DcmDate &obj) |
assignment operator | |
virtual DcmObject * | clone () const |
clone method | |
virtual OFCondition | copyFrom (const DcmObject &rhs) |
Virtual object copying. | |
virtual DcmEVR | ident () const |
get element type identifier | |
virtual OFCondition | checkValue (const OFString &vm="1-n", const OFBool oldFormat=OFFalse) |
check whether stored value conforms to the VR and to the specified VM | |
virtual OFCondition | getOFString (OFString &stringVal, const unsigned long pos, OFBool normalize=OFTrue) |
get a copy of a particular string component | |
OFCondition | setCurrentDate () |
set the element value to the current system date. | |
OFCondition | setOFDate (const OFDate &dateValue) |
set the element value to the given date | |
OFCondition | getOFDate (OFDate &dateValue, const unsigned long pos=0, const OFBool supportOldFormat=OFTrue) |
get the current element value in OFDate format. | |
OFCondition | getISOFormattedDate (OFString &formattedDate, const unsigned long pos=0, const OFBool supportOldFormat=OFTrue) |
get the current element value in ISO date format. | |
Static Public Member Functions | |
static OFCondition | getCurrentDate (OFString &dicomDate) |
get the current system date. | |
static OFCondition | getDicomDateFromOFDate (const OFDate &dateValue, OFString &dicomDate) |
get the specified OFDate value in DICOM format. | |
static OFCondition | getOFDateFromString (const OFString &dicomDate, OFDate &dateValue, const OFBool supportOldFormat=OFTrue) |
get the specified DICOM date value in OFDate format. | |
static OFCondition | getISOFormattedDateFromString (const OFString &dicomDate, OFString &formattedDate, const OFBool supportOldFormat=OFTrue) |
get the specified DICOM date value in ISO format. | |
static OFCondition | checkStringValue (const OFString &value, const OFString &vm="1-n", const OFBool oldFormat=OFFalse) |
check whether given string value conforms to the VR "DA" (Date) and to the specified VM. |
Definition at line 40 of file dcvrda.h.
DcmDate::DcmDate | ( | const DcmTag & | tag, | |
const Uint32 | len = 0 | |||
) |
constructor.
Create new element from given tag and length.
tag | DICOM tag for the new element | |
len | value length for the new element |
Referenced by clone().
DcmDate::DcmDate | ( | const DcmDate & | old | ) |
copy constructor
old | element to be copied |
assignment operator
obj | element to be assigned/copied |
virtual DcmObject* DcmDate::clone | ( | ) | const [inline, virtual] |
clone method
Reimplemented from DcmByteString.
Definition at line 72 of file dcvrda.h.
References DcmDate().
virtual OFCondition DcmDate::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.
rhs | - [in] The instance to copy from. Has to be of the same class type as "this" object |
Reimplemented from DcmByteString.
virtual DcmEVR DcmDate::ident | ( | ) | const [virtual] |
get element type identifier
Reimplemented from DcmByteString.
virtual OFCondition DcmDate::checkValue | ( | const OFString & | vm = "1-n" , |
|
const OFBool | oldFormat = OFFalse | |||
) | [virtual] |
check whether stored value conforms to the VR and to the specified VM
vm | value multiplicity (according to the data dictionary) to be checked for. (valid values: "1", "1-2", "1-3", "1-8", "1-99", "1-n", "2", "2-n", "2-2n", "3", "3-n", "3-3n", "4", "6", "9", "16", "32") | |
oldFormat | support old ACR/NEMA format if OFTrue ('.' as a separator) |
Reimplemented from DcmElement.
virtual OFCondition DcmDate::getOFString | ( | OFString & | stringVal, | |
const unsigned long | pos, | |||
OFBool | normalize = OFTrue | |||
) | [virtual] |
get a copy of a particular string component
stringVal | variable in which the result value is stored | |
pos | index of the value in case of multi-valued elements (0..vm-1) | |
normalize | delete trailing spaces if OFTrue |
Reimplemented from DcmByteString.
OFCondition DcmDate::setCurrentDate | ( | ) |
set the element value to the current system date.
The DICOM DA format supported by this function is "YYYYMMDD". If the current system date is unavailable the date is set to "19000101" and an error code is returned.
OFCondition DcmDate::setOFDate | ( | const OFDate & | dateValue | ) |
set the element value to the given date
dateValue | date to be set (should be a valid date) |
OFCondition DcmDate::getOFDate | ( | OFDate & | dateValue, | |
const unsigned long | pos = 0 , |
|||
const OFBool | supportOldFormat = OFTrue | |||
) |
get the current element value in OFDate format.
Please note that the element value is expected to be in valid DICOM DA format ("YYYYMMDD", "YYYY.MM.DD" is also supported for reasons of backward compatibility). If this function fails the result variable 'dateValue' is cleared automatically.
dateValue | reference to OFDate variable where the result is stored | |
pos | index of the element component in case of value multiplicity (0..vm-1) | |
supportOldFormat | if OFTrue support old (prior V3.0) date format (see above) |
OFCondition DcmDate::getISOFormattedDate | ( | OFString & | formattedDate, | |
const unsigned long | pos = 0 , |
|||
const OFBool | supportOldFormat = OFTrue | |||
) |
get the current element value in ISO date format.
The ISO date format supported by this function is "YYYY-MM-DD". Please note that the element value is expected to be in valid DICOM DA format ("YYYYMMDD", "YYYY.MM.DD" is also supported for reasons of backward compatibility). If this function fails the result variable 'formattedDate' is cleared automatically.
formattedDate | reference to string variable where the result is stored | |
pos | index of the element component in case of value multiplicity (0..vm-1) | |
supportOldFormat | if OFTrue support old (prior V3.0) date format (see above) |
static OFCondition DcmDate::getCurrentDate | ( | OFString & | dicomDate | ) | [static] |
get the current system date.
The DICOM DA format supported by this function is "YYYYMMDD". If the current system date is unavailable the date is set to "19000101" and an error code is returned.
dicomDate | reference to string variable where the result is stored |
static OFCondition DcmDate::getDicomDateFromOFDate | ( | const OFDate & | dateValue, | |
OFString & | dicomDate | |||
) | [static] |
get the specified OFDate value in DICOM format.
The DICOM DA format supported by this function is "YYYYMMDD". If the specified date is invalid the date is set to "19000101" and an error code is returned.
dateValue | date to be converted to DICOM format | |
dicomDate | reference to string variable where the result is stored |
static OFCondition DcmDate::getOFDateFromString | ( | const OFString & | dicomDate, | |
OFDate & | dateValue, | |||
const OFBool | supportOldFormat = OFTrue | |||
) | [static] |
get the specified DICOM date value in OFDate format.
Please note that the specified value is expected to be in valid DICOM DA format ("YYYYMMDD", "YYYY.MM.DD" is also supported for reasons of backward compatibility). If this function fails the result variable 'dateValue' is cleared automatically.
dicomDate | string value in DICOM DA format to be converted to ISO format | |
dateValue | reference to OFDate variable where the result is stored | |
supportOldFormat | if OFTrue support old (prior V3.0) date format (see above) |
static OFCondition DcmDate::getISOFormattedDateFromString | ( | const OFString & | dicomDate, | |
OFString & | formattedDate, | |||
const OFBool | supportOldFormat = OFTrue | |||
) | [static] |
get the specified DICOM date value in ISO format.
The ISO date format supported by this function is "YYYY-MM-DD". Please note that the specified value is expected to be in valid DICOM DA format ("YYYYMMDD", "YYYY.MM.DD" is also supported for reasons of backward compatibility). If this function fails the result variable 'formattedDate' is cleared automatically.
dicomDate | string value in DICOM DA format to be converted to ISO format | |
formattedDate | reference to string variable where the result is stored | |
supportOldFormat | if OFTrue support old (prior V3.0) date format (see above) |
static OFCondition DcmDate::checkStringValue | ( | const OFString & | value, | |
const OFString & | vm = "1-n" , |
|||
const OFBool | oldFormat = OFFalse | |||
) | [static] |
check whether given string value conforms to the VR "DA" (Date) and to the specified VM.
value | string value to be checked (possibly multi-valued) | |
vm | value multiplicity (according to the data dictionary) to be checked for. (valid values: "1", "1-2", "1-3", "1-8", "1-99", "1-n", "2", "2-n", "2-2n", "3", "3-n", "3-3n", "4", "6", "9", "16", "32") | |
oldFormat | support old ACR/NEMA date format if OFTrue (i.e. with "." delimiters) |