2 |
* * |
* * |
3 |
* libgig - C++ cross-platform Gigasampler format file access library * |
* libgig - C++ cross-platform Gigasampler format file access library * |
4 |
* * |
* * |
5 |
* Copyright (C) 2003-2015 by Christian Schoenebeck * |
* Copyright (C) 2003-2017 by Christian Schoenebeck * |
6 |
* <cuse@users.sourceforge.net> * |
* <cuse@users.sourceforge.net> * |
7 |
* * |
* * |
8 |
* This program is part of libgig. * |
* This program is part of libgig. * |
89 |
} |
} |
90 |
|
|
91 |
static bool endsWith(const string& haystack, const string& needle, bool caseSensitive) { |
static bool endsWith(const string& haystack, const string& needle, bool caseSensitive) { |
92 |
|
if (haystack.size() < needle.size()) return false; |
93 |
const string sub = haystack.substr(haystack.size() - needle.size(), needle.size()); |
const string sub = haystack.substr(haystack.size() - needle.size(), needle.size()); |
94 |
return (caseSensitive) ? (sub == needle) : (!strcasecmp(sub.c_str(), needle.c_str())); |
return (caseSensitive) ? (sub == needle) : (!strcasecmp(sub.c_str(), needle.c_str())); |
95 |
} |
} |