Implement probe_lua and add it to lpxclient/lpxserver
This commit is contained in:
@@ -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;
|
||||
|
||||
Reference in New Issue
Block a user