SPAOP
|
A namespace for tools for manipulation and validation of user input strings. More...
Functions | |
std::vector< const std::string > | splitString (const std::string &s, char delim) |
Splits a string around the matches of a given delimiter char. More... | |
bool | isValidIP (const std::string &ip) |
Checks whether a given string represents a valid IP(v4). More... | |
bool | isValidPort (const std::string &port) |
Checks whether a given string represents a valid user port number. More... | |
A namespace for tools for manipulation and validation of user input strings.
bool parsetools::isValidIP | ( | const std::string & | ip | ) |
Checks whether a given string represents a valid IP(v4).
(Internally, inet_pton is called and checked for its return code.)
ip | The string to be checked. |
bool parsetools::isValidPort | ( | const std::string & | port | ) |
Checks whether a given string represents a valid user port number.
The well-known ports (0-1023) are considered to be invalid, so valid port numbers range from 1024 to 65535.
port | The string to be checked. |
std::vector< const std::string > parsetools::splitString | ( | const std::string & | s, |
char | delim | ||
) |
Splits a string around the matches of a given delimiter char.
s | The string to be split. |
delim | The delimiter used for splitting. |