50 KiB
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. More... | |
static const bool | isNumeric (const std::string &str) |
Checks whether a string only contains numeric characters. More... | |
static const bool | isNumeric (const unsigned char &chr) |
Checks whether character is numeric. More... | |
static const bool | isAlphabetic (const std::string &str) |
Checks whether a string only contains alphabetic characters. More... | |
static const bool | isAlphabetic (const unsigned char &chr) |
Checks whether a character is alphabetic. More... | |
static const bool | isAlnum (const std::string &str) |
Checks whether a string only contains alpha-numeric characters. More... | |
static const bool | isAlnum (const unsigned char &chr) |
Checks whether a character is alpha-numeric. More... | |
static const bool | isHex (const unsigned char &chr) |
Checks whether a string only contains hexadecimal characters. More... | |
static const bool | isIP (const std::string &str) |
Checks whether a string could be a valid IPv4/IPv6. More... | |
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. More... | |
static const bool | startsWith (const std::string &str, const std::string &flag) |
Checks if a string starts with the given sequence. More... | |
static const bool | endsWith (const std::string &str, const std::string &flag) |
Checks if a string ends with the given sequence. More... | |
static const bool | contains (const std::string &str, const std::string &flag) |
Checks if a string contains the given sequence. More... | |
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. More... | |
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. More... | |
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. More... | |
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) More... | |
static void | split (std::vector< std::string > &list, const std::string &target_str, const std::string &separator="\n") |
Splits a string using a separator. More... | |
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. More... | |
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. More... | |
static const std::string | toUpper (const std::string &str) |
Converts a string to upper case. More... | |
static const std::string | toLower (const std::string &str) |
Converts a string to lower case. More... | |
Detailed Description
Utilities for the strings
Member Function Documentation
◆ contains()
|
static |
Checks if a string contains the given sequence.
- Parameters
-
str The target string flag The sequence to search for
- Returns
- The result of the check
◆ count()
|
static |
Count the occurrences of the given sequence in the given string.
- Parameters
-
str The target string
- Returns
- The number of occurrences
◆ endsWith()
|
static |
Checks if a string ends with the given sequence.
- Parameters
-
str The target string flag The sequence to search for
- Returns
- The result of the check
◆ findLast()
|
static |
Finds the last occurrence of the given sequence in the given string.
- Parameters
-
str The target string flag The sequence to search for
- Returns
- The position of the last occurrence
◆ isAlnum() [1/2]
|
static |
Checks whether a string only contains alpha-numeric characters.
- Parameters
-
str The target string
- Returns
- The result of the check
◆ isAlnum() [2/2]
|
static |
Checks whether a character is alpha-numeric.
- Parameters
-
str The target character
- Returns
- The result of the check
- See also
- isAlnum
◆ isAlphabetic() [1/2]
|
static |
Checks whether a string only contains alphabetic characters.
- Parameters
-
str The target string
- Returns
- The result of the check
◆ isAlphabetic() [2/2]
|
static |
Checks whether a character is alphabetic.
- Parameters
-
str The target character
- Returns
- The result of the check
- See also
- isAlphabetic()
◆ isHex()
|
static |
Checks whether a string only contains hexadecimal characters.
- Parameters
-
str The target character
- Returns
- The result of the check
◆ isIP()
|
static |
Checks whether a string could be a valid IPv4/IPv6.
- Parameters
-
str The target string
- Returns
- The result of the check
◆ isNumeric() [1/2]
|
static |
Checks whether a string only contains numeric characters.
- Parameters
-
str The target string
- Returns
- The result of the check
◆ isNumeric() [2/2]
|
static |
Checks whether character is numeric.
- Parameters
-
str The target character
- Returns
- The result of the check
- See also
- isNumeric()
◆ lstrip()
|
static |
Strips the given characters from the left side of a string.
- Parameters
-
str The target string chars The characters to strip away
- Returns
- The result string
◆ lstripUntil()
|
static |
Strips everything from a string starting from the left side untill the delimiter is found (a.k.a. cut)
- Parameters
-
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
- Returns
- The result string
◆ replace()
|
static |
Replaces all the occurrences of a sequence with another.
- Parameters
-
str The target string target The sequence which will be replaced replace The sequence to be used to replace the target
- Returns
- The result string
◆ rstrip()
|
static |
Strips the given characters from the right side of a string.
- Parameters
-
str The target string chars The characters to strip away
- Returns
- The result string
◆ split()
|
static |
Splits a string using a separator.
- Parameters
-
list Will hold the splitted content target_str The target string separator The sequence to use as separator
◆ splitrip()
|
static |
Splits a string and strips all the splitted items.
- Parameters
-
list Will hold the splitted content target_str The target string separator The sequence to use as separator strip The characters to strip away
◆ startsWith()
|
static |
Checks if a string starts with the given sequence.
- Parameters
-
str The target string flag The sequence to search for
- Returns
- The result of the check
◆ strip()
|
static |
Strips the given characters from both the left and the right side of a string.
- Parameters
-
str The target string chars The characters to strip away
- Returns
- The result string
◆ toLower()
|
static |
Converts a string to lower case.
- Parameters
-
str The target string
- Returns
- The result string
◆ toUpper()
|
static |
Converts a string to upper case.
- Parameters
-
str The target string
- Returns
- The result string
The documentation for this class was generated from the following files:
- logdoctor/utilities/strings.h
- logdoctor/utilities/strings.cpp
Generated by 1.9.5 </html>