Browse Source

Gmt module: Cleanup modgmt_structs.h

gmtdatadir
Michael Uleysky 8 years ago
parent
commit
9c0776b92e
  1. 19
      modules/gmt/modgmt_strcomp.h

19
modules/gmt/modgmt_strcomp.h

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

Loading…
Cancel
Save