Mercurial > hg > orthanc
comparison OrthancFramework/Sources/HttpServer/StringMatcher.cpp @ 4300:b30a8de92ad9
abi continued
author | Sebastien Jodogne <s.jodogne@gmail.com> |
---|---|
date | Thu, 05 Nov 2020 19:33:18 +0100 |
parents | 2d5209153b32 |
children | d9473bd5ed43 |
comparison
equal
deleted
inserted
replaced
4299:3f85db78c441 | 4300:b30a8de92ad9 |
---|---|
67 // destroyed once exiting the constructor) but "pattern_" | 67 // destroyed once exiting the constructor) but "pattern_" |
68 // (variable member, will last as long as the algorithm), | 68 // (variable member, will last as long as the algorithm), |
69 // otherwise lifetime is bad! (*) | 69 // otherwise lifetime is bad! (*) |
70 search_.reset(new Search(pattern_)); | 70 search_.reset(new Search(pattern_)); |
71 } | 71 } |
72 | |
73 const std::string &StringMatcher::GetPattern() const | |
74 { | |
75 return pattern_; | |
76 } | |
77 | |
78 bool StringMatcher::IsValid() const | |
79 { | |
80 return valid_; | |
81 } | |
72 | 82 |
73 | 83 |
74 bool StringMatcher::Apply(Iterator start, | 84 bool StringMatcher::Apply(Iterator start, |
75 Iterator end) | 85 Iterator end) |
76 { | 86 { |
87 assert(matchEnd_ <= end); | 97 assert(matchEnd_ <= end); |
88 valid_ = true; | 98 valid_ = true; |
89 } | 99 } |
90 | 100 |
91 return valid_; | 101 return valid_; |
102 } | |
103 | |
104 bool StringMatcher::Apply(const std::string &corpus) | |
105 { | |
106 return Apply(corpus.begin(), corpus.end()); | |
92 } | 107 } |
93 | 108 |
94 | 109 |
95 StringMatcher::Iterator StringMatcher::GetMatchBegin() const | 110 StringMatcher::Iterator StringMatcher::GetMatchBegin() const |
96 { | 111 { |