Implement probe_lua and add it to lpxclient/lpxserver

This commit is contained in:
2021-11-26 13:56:24 -05:00
parent c02109699e
commit 1e93533246
10 changed files with 134 additions and 35 deletions

View File

@@ -185,6 +185,18 @@ std::string toupper(std::string input) {
return input;
}
bool has_prefix(const std::string &s, const std::string &prefix) {
return 0 == s.compare(0, prefix.size(), prefix);
}
bool has_suffix(const std::string &s, const std::string &suffix) {
if (s.length() >= suffix.length()) {
return (0 == s.compare (s.length() - suffix.length(), suffix.length(), suffix));
} else {
return false;
}
}
bool validinteger(const std::string &value) {
char *endptr;
if (value.size() == 0) return false;