| 89 | | static inline bool beginsWith(const std::string& a, const std::string& b) |
| 90 | | { |
| 91 | | return (a.size() >= b.size() && a.substr(0, b.size()) == b); |
| 92 | | } |
| 93 | | |
| 94 | | static inline bool endsWith(const std::string& a, const std::string& b) |
| 95 | | { |
| 96 | | return (a.size() >= b.size() && a.substr(a.size() - b.size()) == b); |
| 97 | | } |
| 98 | | |
| | 89 | /** |
| | 90 | * @returns True if @a str begins with @a prefix; otherwise false. |
| | 91 | */ |
| | 92 | static inline bool beginsWith(const std::string& str, const std::string& prefix) |
| | 93 | { |
| | 94 | return (str.size() >= prefix.size() && |
| | 95 | str.substr(0, prefix.size()) == prefix); |
| | 96 | } |
| | 97 | |
| | 98 | /** |
| | 99 | * @returns True if @a str ends with @a suffix; otherwise false. |
| | 100 | */ |
| | 101 | static inline bool endsWith(const std::string& str, const std::string& suffix) |
| | 102 | { |
| | 103 | return (str.size() >= suffix.size() && |
| | 104 | str.substr(str.size() - suffix.size()) == suffix); |
| | 105 | } |
| | 106 | |
| | 107 | /** |
| | 108 | * @returns True if @a path appears to be a licq plugin (based on |
| | 109 | * filename); otherwise false. |
| | 110 | */ |