Mercurial > hg > orthanc
comparison OrthancServer/Search/WildcardConstraint.cpp @ 1756:03b030680e3d db-changes
refactoring
author | Sebastien Jodogne <s.jodogne@gmail.com> |
---|---|
date | Wed, 28 Oct 2015 12:14:06 +0100 |
parents | fb569ee09a69 |
children | af6840eb23ee |
comparison
equal
deleted
inserted
replaced
1755:39c37a994b2f | 1756:03b030680e3d |
---|---|
43 std::string wildcard_; | 43 std::string wildcard_; |
44 }; | 44 }; |
45 | 45 |
46 | 46 |
47 WildcardConstraint::WildcardConstraint(const WildcardConstraint& other) : | 47 WildcardConstraint::WildcardConstraint(const WildcardConstraint& other) : |
48 IFindConstraint(other.GetTag()), | |
49 pimpl_(new PImpl(*other.pimpl_)) | 48 pimpl_(new PImpl(*other.pimpl_)) |
50 { | 49 { |
51 } | 50 } |
52 | 51 |
53 | 52 |
54 WildcardConstraint::WildcardConstraint(const DicomTag& tag, | 53 WildcardConstraint::WildcardConstraint(const std::string& wildcard, |
55 const std::string& wildcard, | |
56 bool isCaseSensitive) : | 54 bool isCaseSensitive) : |
57 IFindConstraint(tag), | |
58 pimpl_(new PImpl) | 55 pimpl_(new PImpl) |
59 { | 56 { |
60 pimpl_->wildcard_ = wildcard; | 57 pimpl_->wildcard_ = wildcard; |
61 | 58 |
62 std::string re = Toolbox::WildcardToRegularExpression(wildcard); | 59 std::string re = Toolbox::WildcardToRegularExpression(wildcard); |
74 bool WildcardConstraint::Match(const std::string& value) const | 71 bool WildcardConstraint::Match(const std::string& value) const |
75 { | 72 { |
76 return boost::regex_match(value, pimpl_->pattern_); | 73 return boost::regex_match(value, pimpl_->pattern_); |
77 } | 74 } |
78 | 75 |
79 void WildcardConstraint::Setup(LookupIdentifierQuery& lookup) const | 76 void WildcardConstraint::Setup(LookupIdentifierQuery& lookup, |
77 const DicomTag& tag) const | |
80 { | 78 { |
81 lookup.AddConstraint(GetTag(), IdentifierConstraintType_Wildcard, pimpl_->wildcard_); | 79 lookup.AddConstraint(tag, IdentifierConstraintType_Wildcard, pimpl_->wildcard_); |
82 } | 80 } |
83 } | 81 } |