Support find plugin to load

This commit is contained in:
John Zhao
2018-06-04 22:09:20 +08:00
parent b7436e41b9
commit dfb574c179
7 changed files with 184 additions and 0 deletions

View File

@@ -65,6 +65,13 @@ bool starts_with(const std::string &text, const std::string &prefix) {
return text.compare(0, prefix.length(), prefix) == 0;
}
bool ends_with(const std::string &text, const std::string &suffix) {
if (suffix.length() > text.length())
return false;
return text.compare(
text.length() - suffix.length(), suffix.length(), suffix) == 0;
}
std::vector<std::string> split(
const std::string &text, const std::string &delimiters) {
std::vector<std::string> tokens;

View File

@@ -41,6 +41,9 @@ int hex2int(const std::string &text);
MYNTEYE_API
bool starts_with(const std::string &text, const std::string &prefix);
MYNTEYE_API
bool ends_with(const std::string &text, const std::string &suffix);
MYNTEYE_API
std::vector<std::string> split(
const std::string &text, const std::string &delimiters);