|
|
|
|
@ -256,8 +256,9 @@ bool starts_with(const std::string &s1, const std::string &s2) { |
|
|
|
|
return strncmp(s1.c_str(), s2.c_str(), s2.size()) == 0; |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
bool ends_with(const std::string &s1, const std::string &s2) { |
|
|
|
|
return strcmp(s1.c_str() + (s1.size() - s2.size()), s2.c_str()) == 0; |
|
|
|
|
bool ends_with(const std::string& s, const std::string& suffix) { |
|
|
|
|
return s.size() >= suffix.size() && |
|
|
|
|
strcmp(s.c_str() + (s.size() - suffix.size()), suffix.c_str()) == 0; |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
std::string check_output(const std::string& command) { |
|
|
|
|
|