diff options
Diffstat (limited to 'src/util/strfnd.h')
-rw-r--r-- | src/util/strfnd.h | 16 |
1 files changed, 5 insertions, 11 deletions
diff --git a/src/util/strfnd.h b/src/util/strfnd.h index 92fbbaf07..96cf1b458 100644 --- a/src/util/strfnd.h +++ b/src/util/strfnd.h @@ -21,19 +21,14 @@ with this program; if not, write to the Free Software Foundation, Inc., #include <string> -template <typename T> class BasicStrfnd -{ +template <typename T> +class BasicStrfnd { typedef std::basic_string<T> String; String str; size_t pos; - public: BasicStrfnd(const String &s) : str(s), pos(0) {} - void start(const String &s) - { - str = s; - pos = 0; - } + void start(const String &s) { str = s; pos = 0; } size_t where() { return pos; } void to(size_t i) { pos = i; } bool at_end() { return pos >= str.size(); } @@ -53,9 +48,8 @@ public: return ret; } - // Returns substr up to the next occurence of sep that isn't escaped with esc - // ('\\') - String next_esc(const String &sep, T esc = static_cast<T>('\\')) + // Returns substr up to the next occurence of sep that isn't escaped with esc ('\\') + String next_esc(const String &sep, T esc=static_cast<T>('\\')) { if (pos >= str.size()) return String(); |