diff options
| author | Maxime Coste <frrrwww@gmail.com> | 2013-07-24 22:37:17 +0200 |
|---|---|---|
| committer | Maxime Coste <frrrwww@gmail.com> | 2013-07-24 22:37:17 +0200 |
| commit | b5db256384f981833f85ad9019be6e212fffcc6b (patch) | |
| tree | fa2f6048c408a7fa885786f236cd3c3f604bea97 /src/string.hh | |
| parent | d6425f1d5090c3225665fff9dcf36e64ff54fb06 (diff) | |
string escaping support functions
the split function now takes an additional escape parameter and
does not split on separators that have the escaper before it.
An utility escape function that adds escape before separators
is also added.
Diffstat (limited to 'src/string.hh')
| -rw-r--r-- | src/string.hh | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/src/string.hh b/src/string.hh index a64bf180..f4a93309 100644 --- a/src/string.hh +++ b/src/string.hh @@ -84,7 +84,8 @@ inline String operator+(Codepoint lhs, const String& rhs) return String(lhs) + rhs; } -std::vector<String> split(const String& str, char separator); +std::vector<String> split(const String& str, char separator, char escape = 0); +String escape(const String& str, char character, char escape); inline String operator"" _str(const char* str, size_t) { |
