diff options
author | Elias Fleckenstein <eliasfleckenstein@web.de> | 2020-11-04 16:19:54 +0100 |
---|---|---|
committer | Elias Fleckenstein <eliasfleckenstein@web.de> | 2020-11-04 16:19:54 +0100 |
commit | ad148587dcf5244c2d2011dba339786c765c54c4 (patch) | |
tree | bdd914121cd326da2ed26679838878e3edffc841 /src/util/strfnd.h | |
parent | 1145b05ea0bda87dc0827821385810eced08f774 (diff) | |
download | dragonfireclient-ad148587dcf5244c2d2011dba339786c765c54c4.tar.xz |
Make Lint Happy
Diffstat (limited to 'src/util/strfnd.h')
-rw-r--r-- | src/util/strfnd.h | 16 |
1 files changed, 11 insertions, 5 deletions
diff --git a/src/util/strfnd.h b/src/util/strfnd.h index 96cf1b458..92fbbaf07 100644 --- a/src/util/strfnd.h +++ b/src/util/strfnd.h @@ -21,14 +21,19 @@ 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(); } @@ -48,8 +53,9 @@ 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(); |