/src/dcmtk/dcmdata/libsrc/dcvras.cc
Line | Count | Source |
1 | | /* |
2 | | * |
3 | | * Copyright (C) 1994-2010, OFFIS e.V. |
4 | | * All rights reserved. See COPYRIGHT file for details. |
5 | | * |
6 | | * This software and supporting documentation were developed by |
7 | | * |
8 | | * OFFIS e.V. |
9 | | * R&D Division Health |
10 | | * Escherweg 2 |
11 | | * D-26121 Oldenburg, Germany |
12 | | * |
13 | | * |
14 | | * Module: dcmdata |
15 | | * |
16 | | * Author: Gerd Ehlers, Andreas Barth |
17 | | * |
18 | | * Purpose: Implementation of class DcmAgeString |
19 | | * |
20 | | */ |
21 | | |
22 | | |
23 | | #include "dcmtk/config/osconfig.h" /* make sure OS specific configuration is included first */ |
24 | | |
25 | | #include "dcmtk/dcmdata/dcvras.h" |
26 | | |
27 | | |
28 | | // ******************************** |
29 | | |
30 | | |
31 | | DcmAgeString::DcmAgeString(const DcmTag &tag, |
32 | | const Uint32 len) |
33 | 0 | : DcmByteString(tag, len) |
34 | 0 | { |
35 | 0 | setMaxLength(4); |
36 | 0 | } |
37 | | |
38 | | |
39 | | DcmAgeString::DcmAgeString(const DcmAgeString &old) |
40 | 0 | : DcmByteString(old) |
41 | 0 | { |
42 | 0 | } |
43 | | |
44 | | |
45 | | DcmAgeString::~DcmAgeString() |
46 | 0 | { |
47 | 0 | } |
48 | | |
49 | | DcmAgeString &DcmAgeString::operator=(const DcmAgeString &obj) |
50 | 0 | { |
51 | 0 | DcmByteString::operator=(obj); |
52 | 0 | return *this; |
53 | 0 | } |
54 | | |
55 | | |
56 | | OFCondition DcmAgeString::copyFrom(const DcmObject& rhs) |
57 | 0 | { |
58 | 0 | if (this != &rhs) |
59 | 0 | { |
60 | 0 | if (rhs.ident() != ident()) return EC_IllegalCall; |
61 | 0 | *this = OFstatic_cast(const DcmAgeString &, rhs); |
62 | 0 | } |
63 | 0 | return EC_Normal; |
64 | 0 | } |
65 | | |
66 | | |
67 | | // ******************************** |
68 | | |
69 | | |
70 | | DcmEVR DcmAgeString::ident() const |
71 | 0 | { |
72 | 0 | return EVR_AS; |
73 | 0 | } |
74 | | |
75 | | |
76 | | OFCondition DcmAgeString::checkValue(const OFString &vm, |
77 | | const OFBool /*oldFormat*/) |
78 | 0 | { |
79 | 0 | OFString strVal; |
80 | | /* get "raw value" without any modifications (if possible) */ |
81 | 0 | OFCondition l_error = getStringValue(strVal); |
82 | 0 | if (l_error.good()) |
83 | 0 | l_error = DcmAgeString::checkStringValue(strVal, vm); |
84 | 0 | return l_error; |
85 | 0 | } |
86 | | |
87 | | |
88 | | // ******************************** |
89 | | |
90 | | |
91 | | OFCondition DcmAgeString::checkStringValue(const OFString &value, |
92 | | const OFString &vm) |
93 | 0 | { |
94 | 0 | return DcmByteString::checkStringValue(value, vm, "as", 1); |
95 | 0 | } |