aboutsummaryrefslogtreecommitdiff
path: root/src/FbTk/StringUtil.cc
diff options
context:
space:
mode:
Diffstat (limited to 'src/FbTk/StringUtil.cc')
-rw-r--r--src/FbTk/StringUtil.cc9
1 files changed, 8 insertions, 1 deletions
diff --git a/src/FbTk/StringUtil.cc b/src/FbTk/StringUtil.cc
index 63da383..b5f373f 100644
--- a/src/FbTk/StringUtil.cc
+++ b/src/FbTk/StringUtil.cc
@@ -274,9 +274,16 @@ string findExtension(const string &filename) {
274 return filename.substr(start_pos + 1); 274 return filename.substr(start_pos + 1);
275} 275}
276 276
277string::size_type findCharFromAlphabetAfterTrigger(const std::string& in, char trigger, const char alphabet[], size_t len_alphabet, size_t* found) { 277 string::size_type findCharFromAlphabetAfterTrigger(const std::string& in, char trigger, const char alphabet[], size_t len_alphabet, size_t* found, const char ignore_after_trigger[], size_t len_ignore_after_trigger) {
278 for (const char* s = in.c_str(); *s != '\0'; ) { 278 for (const char* s = in.c_str(); *s != '\0'; ) {
279 if (*s++ == trigger && *s != '\0') { 279 if (*s++ == trigger && *s != '\0') {
280 auto end = ignore_after_trigger + len_ignore_after_trigger;
281 while (std::find(ignore_after_trigger, end, *s) != end)
282 s++;
283
284 if (*s == '\0')
285 return string::npos;
286
280 for (const char* a = alphabet; (a - alphabet) < static_cast<ssize_t>(len_alphabet); ++a) { 287 for (const char* a = alphabet; (a - alphabet) < static_cast<ssize_t>(len_alphabet); ++a) {
281 if (*s == *a) { 288 if (*s == *a) {
282 if (found) { 289 if (found) {