|
|
|
@ -1,9 +1,10 @@
|
|
|
|
|
#include <iostream> |
|
|
|
|
#ifndef MODGMT_STRCOMP_H |
|
|
|
|
#define MODGMT_STRCOMP_H |
|
|
|
|
#include <memory> |
|
|
|
|
#include <set> |
|
|
|
|
#include <string> |
|
|
|
|
#include <vector> |
|
|
|
|
|
|
|
|
|
// Compare string with template
|
|
|
|
|
class TemplateComparator |
|
|
|
|
{ |
|
|
|
|
TemplateComparator() = delete; |
|
|
|
@ -47,6 +48,12 @@ class TemplateComparator
|
|
|
|
|
Cursors cursors; |
|
|
|
|
const std::string s; |
|
|
|
|
|
|
|
|
|
void Reset() |
|
|
|
|
{ |
|
|
|
|
cursors.clear(); |
|
|
|
|
InitCursors(root.get()); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
public: |
|
|
|
|
TemplateComparator(const char* str):s(str) {root=Parse();} |
|
|
|
|
TemplateComparator(const std::string& str):s(str) {root=Parse();} |
|
|
|
@ -58,10 +65,6 @@ class TemplateComparator
|
|
|
|
|
for(size_t pos=0; pos<str.length(); ++pos) if(!CmpSmb(str[pos])) return false; |
|
|
|
|
return true; |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
void Reset() |
|
|
|
|
{ |
|
|
|
|
cursors.clear(); |
|
|
|
|
InitCursors(root.get()); |
|
|
|
|
} |
|
|
|
|
}; |
|
|
|
|
|
|
|
|
|
#endif |
|
|
|
|