logic: Test License
Test license for x days License_generator flag -e <days>
This commit is contained in:
@@ -182,4 +182,16 @@ namespace utility
|
||||
auto wsback = std::find_if_not(str.rbegin(), str.rend(), [](int c){ return std::isspace(c); }).base();
|
||||
return (wsback <= wsfront ? std::string() : std::string(wsfront, wsback));
|
||||
}
|
||||
|
||||
std::string substrBetween(const std::string &str, const std::string &delimiter1, const std::string &delimiter2)
|
||||
{
|
||||
size_t found_delimiter1 = str.find(delimiter1);
|
||||
found_delimiter1 += delimiter1.length();
|
||||
size_t found_delimiter2 = str.find(delimiter2,found_delimiter1);
|
||||
if(found_delimiter1 != str.npos && found_delimiter2 != str.npos)
|
||||
{
|
||||
return str.substr(found_delimiter1, found_delimiter2-found_delimiter1);
|
||||
}
|
||||
return "";
|
||||
}
|
||||
}
|
||||
|
||||
@@ -32,6 +32,8 @@ namespace utility
|
||||
std::string substrBefore(const std::string& str, char delimiter);
|
||||
std::string substrAfter(const std::string& str, char delimiter);
|
||||
|
||||
std::string substrBetween(const std::string& str, const std::string& delimiter1, const std::string& delimiter2);
|
||||
|
||||
bool isPrefix(const std::string& prefix, const std::string& text);
|
||||
|
||||
std::string toUpperCase(const std::string& in);
|
||||
|
||||
Reference in New Issue
Block a user