comparison OrthancServer/Search/DicomTagConstraint.cpp @ 3029:ea653ec47f31 db-changes

new class: DatabaseConstraint
author Sebastien Jodogne <s.jodogne@gmail.com>
date Tue, 18 Dec 2018 18:56:55 +0100
parents fd587cf51a89
children 71ac4f28176f
comparison
equal deleted inserted replaced
3027:fd587cf51a89 3029:ea653ec47f31
98 ConstraintType type, 98 ConstraintType type,
99 const std::string& value, 99 const std::string& value,
100 bool caseSensitive, 100 bool caseSensitive,
101 bool mandatory) : 101 bool mandatory) :
102 tag_(tag), 102 tag_(tag),
103 tagType_(DicomTagType_Generic),
104 constraintType_(type), 103 constraintType_(type),
105 caseSensitive_(caseSensitive), 104 caseSensitive_(caseSensitive),
106 mandatory_(mandatory) 105 mandatory_(mandatory)
107 { 106 {
108 if (type == ConstraintType_Equal || 107 if (type == ConstraintType_Equal ||
129 DicomTagConstraint::DicomTagConstraint(const DicomTag& tag, 128 DicomTagConstraint::DicomTagConstraint(const DicomTag& tag,
130 ConstraintType type, 129 ConstraintType type,
131 bool caseSensitive, 130 bool caseSensitive,
132 bool mandatory) : 131 bool mandatory) :
133 tag_(tag), 132 tag_(tag),
134 tagType_(DicomTagType_Generic),
135 constraintType_(type), 133 constraintType_(type),
136 caseSensitive_(caseSensitive), 134 caseSensitive_(caseSensitive),
137 mandatory_(mandatory) 135 mandatory_(mandatory)
138 { 136 {
139 if (type != ConstraintType_List) 137 if (type != ConstraintType_List)
140 { 138 {
141 throw OrthancException(ErrorCode_ParameterOutOfRange); 139 throw OrthancException(ErrorCode_ParameterOutOfRange);
142 } 140 }
143 } 141 }
144 142
145
146 DicomTagConstraint* DicomTagConstraint::Clone() const
147 {
148 std::auto_ptr<DicomTagConstraint> clone(new DicomTagConstraint);
149
150 clone->tag_ = tag_;
151 clone->constraintType_ = constraintType_;
152 clone->values_ = values_;
153 clone->caseSensitive_ = caseSensitive_;
154 clone->mandatory_ = mandatory_;
155
156 return clone.release();
157 }
158
159 143
160 void DicomTagConstraint::AddValue(const std::string& value) 144 void DicomTagConstraint::AddValue(const std::string& value)
161 { 145 {
162 if (constraintType_ != ConstraintType_List) 146 if (constraintType_ != ConstraintType_List)
163 { 147 {