From 9c0776b92eb8635afea3f8b40ee91c2c9544bcfb Mon Sep 17 00:00:00 2001 From: Michael Uleysky Date: Thu, 29 Sep 2016 15:02:09 +1000 Subject: [PATCH] Gmt module: Cleanup modgmt_structs.h --- modules/gmt/modgmt_strcomp.h | 19 +++++++++++-------- 1 file changed, 11 insertions(+), 8 deletions(-) diff --git a/modules/gmt/modgmt_strcomp.h b/modules/gmt/modgmt_strcomp.h index 143822c..37eb36a 100644 --- a/modules/gmt/modgmt_strcomp.h +++ b/modules/gmt/modgmt_strcomp.h @@ -1,9 +1,10 @@ -#include +#ifndef MODGMT_STRCOMP_H +#define MODGMT_STRCOMP_H #include #include #include -#include +// 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