| 35 | namespace Falcor |
| 36 | { |
| 37 | bool hasPrefix(const std::string& str, const std::string& prefix, bool caseSensitive) |
| 38 | { |
| 39 | if (str.size() >= prefix.size()) |
| 40 | { |
| 41 | if (caseSensitive == false) |
| 42 | { |
| 43 | std::string s = str; |
| 44 | std::string pfx = prefix; |
| 45 | std::transform(str.begin(), str.end(), s.begin(), ::tolower); |
| 46 | std::transform(prefix.begin(), prefix.end(), pfx.begin(), ::tolower); |
| 47 | return s.compare(0, pfx.length(), pfx) == 0; |
| 48 | } |
| 49 | else |
| 50 | { |
| 51 | return str.compare(0, prefix.length(), prefix) == 0; |
| 52 | } |
| 53 | } |
| 54 | return false; |
| 55 | } |
| 56 | |
| 57 | bool hasSuffix(const std::string& str, const std::string& suffix, bool caseSensitive) |
| 58 | { |
no test coverage detected