LogDoctor 2.00
Parse Apache2/Nginx/IIS logs and create statistics
|
#include <strings.h>
Static Public Member Functions | |
static const int | count (const std::string &str, const std::string &flag, const bool consecutives=true) |
Count the occurrences of the given sequence in the given string. | |
static const bool | isNumeric (const std::string &str) |
Checks whether a string only contains numeric characters. | |
static const bool | isNumeric (const char &chr) |
Checks whether character is numeric. | |
static const bool | isAlphabetic (const std::string &str) |
Checks whether a string only contains alphabetic characters. | |
static const bool | isAlphabetic (const char &chr) |
Checks whether a character is alphabetic. | |
static const bool | isAlnum (const std::string &str) |
Checks whether a string only contains alpha-numeric characters. | |
static const bool | isAlnum (const char &chr) |
Checks whether a character is alpha-numeric. | |
static const bool | isHex (const char &chr) |
Checks whether a string only contains hexadecimal characters. | |
static const bool | isIP (const std::string &str) |
Checks whether a string could be a valid IPv4/IPv6. | |
static const size_t | findLast (const std::string &str, const std::string &flag) |
Finds the last occurrence of the given sequence in the given string. | |
static const bool | startsWith (const std::string &str, const std::string &flag) |
Checks if a string starts with the given sequence. | |
static const bool | endsWith (const std::string &str, const std::string &flag) |
Checks if a string ends with the given sequence. | |
static const bool | contains (const std::string &str, const std::string &flag) |
Checks if a string contains the given sequence. | |
static std::string | strip (const std::string &str, const std::string &chars=" \n\t\b\r\v") |
Strips the given characters from both the left and the right side of a string. | |
static std::string | lstrip (const std::string &str, const std::string &chars=" \n\t\b\r\v") |
Strips the given characters from the left side of a string. | |
static std::string | rstrip (const std::string &str, const std::string &chars=" \n\t\b\r\v") |
Strips the given characters from the right side of a string. | |
static std::string | lstripUntil (const std::string &str, const std::string &chr, const bool &inclusive=true, const bool &consecutives=true) |
Strips everything from a string starting from the left side untill the delimiter is found (a.k.a. cut) | |
static void | split (std::vector< std::string > &list, const std::string &target_str, const std::string &separator="\n") |
Splits a string using a separator. | |
static void | splitrip (std::vector< std::string > &list, const std::string &target_str, const std::string &separator="\n", const std::string &strip=" \n\t\b\r\v") |
Splits a string and strips all the splitted items. | |
static const std::string | replace (const std::string &str, const std::string &target, const std::string &replace) |
Replaces all the occurrences of a sequence with another. | |
static const std::string | toUpper (const std::string &str) |
Converts a string to upper case. | |
static const std::string | toLower (const std::string &str) |
Converts a string to lower case. | |
Utilities for the strings
|
static |
Checks if a string contains the given sequence.
str | The target string |
flag | The sequence to search for |
|
static |
Count the occurrences of the given sequence in the given string.
str | The target string |
|
static |
Checks if a string ends with the given sequence.
str | The target string |
flag | The sequence to search for |
|
static |
Finds the last occurrence of the given sequence in the given string.
str | The target string |
flag | The sequence to search for |
|
static |
Checks whether a character is alpha-numeric.
str | The target character |
|
static |
Checks whether a string only contains alpha-numeric characters.
str | The target string |
|
static |
Checks whether a character is alphabetic.
str | The target character |
|
static |
Checks whether a string only contains alphabetic characters.
str | The target string |
|
static |
Checks whether a string only contains hexadecimal characters.
str | The target character |
|
static |
Checks whether a string could be a valid IPv4/IPv6.
str | The target string |
|
static |
Checks whether character is numeric.
str | The target character |
|
static |
Checks whether a string only contains numeric characters.
str | The target string |
|
static |
Strips the given characters from the left side of a string.
str | The target string |
chars | The characters to strip away |
|
static |
Strips everything from a string starting from the left side untill the delimiter is found (a.k.a. cut)
str | The target string |
chr | The delimiter |
inclusive | Whether to also strip the delimiter or not |
consecutives | Whether to strip all the occurrences of the delimiter if they're consecutive |
|
static |
Replaces all the occurrences of a sequence with another.
str | The target string |
target | The sequence which will be replaced |
replace | The sequence to be used to replace the target |
|
static |
Strips the given characters from the right side of a string.
str | The target string |
chars | The characters to strip away |
|
static |
Splits a string using a separator.
list | Will hold the splitted content |
target_str | The target string |
separator | The sequence to use as separator |
|
static |
Splits a string and strips all the splitted items.
list | Will hold the splitted content |
target_str | The target string |
separator | The sequence to use as separator |
strip | The characters to strip away |
|
static |
Checks if a string starts with the given sequence.
str | The target string |
flag | The sequence to search for |
|
static |
Strips the given characters from both the left and the right side of a string.
str | The target string |
chars | The characters to strip away |
|
static |
Converts a string to lower case.
str | The target string |
|
static |
Converts a string to upper case.
str | The target string |