ifw  0.0.1-dev
All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
Static Public Member Functions | List of all members
el::base::utils::Str Class Reference

String utilities helper class used internally. You should not use it. More...

#include <easylogging++.h>

Inheritance diagram for el::base::utils::Str:
el::base::StaticClass el::base::StaticClass el::base::StaticClass

Static Public Member Functions

static bool isDigit (char c)
 Checks if character is digit. Dont use libc implementation of it to prevent locale issues. More...
 
static bool wildCardMatch (const char *str, const char *pattern)
 Matches wildcards, '*' and '?' only supported. More...
 
static std::string & ltrim (std::string &str)
 Trims string from start. More...
 
static std::string & rtrim (std::string &str)
 Trim string from end. More...
 
static std::string & trim (std::string &str)
 Trims string from left and right. More...
 
static bool startsWith (const std::string &str, const std::string &start)
 Determines whether or not str starts with specified string. More...
 
static bool endsWith (const std::string &str, const std::string &end)
 Determines whether or not str ends with specified string. More...
 
static std::string & replaceAll (std::string &str, char replaceWhat, char replaceWith)
 Replaces all instances of replaceWhat with 'replaceWith'. Original variable is changed for performance. More...
 
static std::string & replaceAll (std::string &str, const std::string &replaceWhat, const std::string &replaceWith)
 Replaces all instances of 'replaceWhat' with 'replaceWith'. (String version) Replaces in place. More...
 
static void replaceFirstWithEscape (base::type::string_t &str, const base::type::string_t &replaceWhat, const base::type::string_t &replaceWith)
 
static std::string & toUpper (std::string &str)
 Converts string to uppercase. More...
 
static bool cStringEq (const char *s1, const char *s2)
 Compares cstring equality - uses strcmp. More...
 
static bool cStringCaseEq (const char *s1, const char *s2)
 Compares cstring equality (case-insensitive) - uses toupper(char) Dont use strcasecmp because of CRT (VC++) More...
 
static bool contains (const char *str, char c)
 Returns true if c exist in str. More...
 
static char * convertAndAddToBuff (std::size_t n, int len, char *buf, const char *bufLim, bool zeroPadded=true)
 
static char * addToBuff (const char *str, char *buf, const char *bufLim)
 
static char * clearBuff (char buff[], std::size_t lim)
 
static char * wcharPtrToCharPtr (const wchar_t *line)
 Converst wchar* to char* NOTE: Need to free return value after use! More...
 
static bool isDigit (char c)
 Checks if character is digit. Dont use libc implementation of it to prevent locale issues. More...
 
static bool wildCardMatch (const char *str, const char *pattern)
 Matches wildcards, '*' and '?' only supported. More...
 
static std::string & ltrim (std::string &str)
 Trims string from start. More...
 
static std::string & rtrim (std::string &str)
 Trim string from end. More...
 
static std::string & trim (std::string &str)
 Trims string from left and right. More...
 
static bool startsWith (const std::string &str, const std::string &start)
 Determines whether or not str starts with specified string. More...
 
static bool endsWith (const std::string &str, const std::string &end)
 Determines whether or not str ends with specified string. More...
 
static std::string & replaceAll (std::string &str, char replaceWhat, char replaceWith)
 Replaces all instances of replaceWhat with 'replaceWith'. Original variable is changed for performance. More...
 
static std::string & replaceAll (std::string &str, const std::string &replaceWhat, const std::string &replaceWith)
 Replaces all instances of 'replaceWhat' with 'replaceWith'. (String version) Replaces in place. More...
 
static void replaceFirstWithEscape (base::type::string_t &str, const base::type::string_t &replaceWhat, const base::type::string_t &replaceWith)
 
static std::string & toUpper (std::string &str)
 Converts string to uppercase. More...
 
static bool cStringEq (const char *s1, const char *s2)
 Compares cstring equality - uses strcmp. More...
 
static bool cStringCaseEq (const char *s1, const char *s2)
 Compares cstring equality (case-insensitive) - uses toupper(char) Dont use strcasecmp because of CRT (VC++) More...
 
static bool contains (const char *str, char c)
 Returns true if c exist in str. More...
 
static char * convertAndAddToBuff (std::size_t n, int len, char *buf, const char *bufLim, bool zeroPadded=true)
 
static char * addToBuff (const char *str, char *buf, const char *bufLim)
 
static char * clearBuff (char buff[], std::size_t lim)
 
static char * wcharPtrToCharPtr (const wchar_t *line)
 Converst wchar* to char* NOTE: Need to free return value after use! More...
 
static bool isDigit (char c)
 Checks if character is digit. Dont use libc implementation of it to prevent locale issues. More...
 
static bool wildCardMatch (const char *str, const char *pattern)
 Matches wildcards, '*' and '?' only supported. More...
 
static std::string & ltrim (std::string &str)
 Trims string from start. More...
 
static std::string & rtrim (std::string &str)
 Trim string from end. More...
 
static std::string & trim (std::string &str)
 Trims string from left and right. More...
 
static bool startsWith (const std::string &str, const std::string &start)
 Determines whether or not str starts with specified string. More...
 
static bool endsWith (const std::string &str, const std::string &end)
 Determines whether or not str ends with specified string. More...
 
static std::string & replaceAll (std::string &str, char replaceWhat, char replaceWith)
 Replaces all instances of replaceWhat with 'replaceWith'. Original variable is changed for performance. More...
 
static std::string & replaceAll (std::string &str, const std::string &replaceWhat, const std::string &replaceWith)
 Replaces all instances of 'replaceWhat' with 'replaceWith'. (String version) Replaces in place. More...
 
static void replaceFirstWithEscape (base::type::string_t &str, const base::type::string_t &replaceWhat, const base::type::string_t &replaceWith)
 
static std::string & toUpper (std::string &str)
 Converts string to uppercase. More...
 
static bool cStringEq (const char *s1, const char *s2)
 Compares cstring equality - uses strcmp. More...
 
static bool cStringCaseEq (const char *s1, const char *s2)
 Compares cstring equality (case-insensitive) - uses toupper(char) Dont use strcasecmp because of CRT (VC++) More...
 
static bool contains (const char *str, char c)
 Returns true if c exist in str. More...
 
static char * convertAndAddToBuff (std::size_t n, int len, char *buf, const char *bufLim, bool zeroPadded=true)
 
static char * addToBuff (const char *str, char *buf, const char *bufLim)
 
static char * clearBuff (char buff[], std::size_t lim)
 
static char * wcharPtrToCharPtr (const wchar_t *line)
 Converst wchar* to char* NOTE: Need to free return value after use! More...
 

Detailed Description

String utilities helper class used internally. You should not use it.

Member Function Documentation

static char* el::base::utils::Str::addToBuff ( const char *  str,
char *  buf,
const char *  bufLim 
)
inlinestatic
static char* el::base::utils::Str::addToBuff ( const char *  str,
char *  buf,
const char *  bufLim 
)
inlinestatic
static char* el::base::utils::Str::addToBuff ( const char *  str,
char *  buf,
const char *  bufLim 
)
inlinestatic
static char* el::base::utils::Str::clearBuff ( char  buff[],
std::size_t  lim 
)
inlinestatic
static char* el::base::utils::Str::clearBuff ( char  buff[],
std::size_t  lim 
)
inlinestatic
static char* el::base::utils::Str::clearBuff ( char  buff[],
std::size_t  lim 
)
inlinestatic
static bool el::base::utils::Str::contains ( const char *  str,
char  c 
)
inlinestatic

Returns true if c exist in str.

static bool el::base::utils::Str::contains ( const char *  str,
char  c 
)
inlinestatic

Returns true if c exist in str.

static bool el::base::utils::Str::contains ( const char *  str,
char  c 
)
inlinestatic

Returns true if c exist in str.

static char* el::base::utils::Str::convertAndAddToBuff ( std::size_t  n,
int  len,
char *  buf,
const char *  bufLim,
bool  zeroPadded = true 
)
inlinestatic
static char* el::base::utils::Str::convertAndAddToBuff ( std::size_t  n,
int  len,
char *  buf,
const char *  bufLim,
bool  zeroPadded = true 
)
inlinestatic
static char* el::base::utils::Str::convertAndAddToBuff ( std::size_t  n,
int  len,
char *  buf,
const char *  bufLim,
bool  zeroPadded = true 
)
inlinestatic
static bool el::base::utils::Str::cStringCaseEq ( const char *  s1,
const char *  s2 
)
inlinestatic

Compares cstring equality (case-insensitive) - uses toupper(char) Dont use strcasecmp because of CRT (VC++)

static bool el::base::utils::Str::cStringCaseEq ( const char *  s1,
const char *  s2 
)
inlinestatic

Compares cstring equality (case-insensitive) - uses toupper(char) Dont use strcasecmp because of CRT (VC++)

static bool el::base::utils::Str::cStringCaseEq ( const char *  s1,
const char *  s2 
)
inlinestatic

Compares cstring equality (case-insensitive) - uses toupper(char) Dont use strcasecmp because of CRT (VC++)

static bool el::base::utils::Str::cStringEq ( const char *  s1,
const char *  s2 
)
inlinestatic

Compares cstring equality - uses strcmp.

static bool el::base::utils::Str::cStringEq ( const char *  s1,
const char *  s2 
)
inlinestatic

Compares cstring equality - uses strcmp.

static bool el::base::utils::Str::cStringEq ( const char *  s1,
const char *  s2 
)
inlinestatic

Compares cstring equality - uses strcmp.

static bool el::base::utils::Str::endsWith ( const std::string &  str,
const std::string &  end 
)
inlinestatic

Determines whether or not str ends with specified string.

Parameters
strString to check
endString to check against
Returns
Returns true if ends with specified string, false otherwise
static bool el::base::utils::Str::endsWith ( const std::string &  str,
const std::string &  end 
)
inlinestatic

Determines whether or not str ends with specified string.

Parameters
strString to check
endString to check against
Returns
Returns true if ends with specified string, false otherwise
static bool el::base::utils::Str::endsWith ( const std::string &  str,
const std::string &  end 
)
inlinestatic

Determines whether or not str ends with specified string.

Parameters
strString to check
endString to check against
Returns
Returns true if ends with specified string, false otherwise
static bool el::base::utils::Str::isDigit ( char  c)
inlinestatic

Checks if character is digit. Dont use libc implementation of it to prevent locale issues.

static bool el::base::utils::Str::isDigit ( char  c)
inlinestatic

Checks if character is digit. Dont use libc implementation of it to prevent locale issues.

static bool el::base::utils::Str::isDigit ( char  c)
inlinestatic

Checks if character is digit. Dont use libc implementation of it to prevent locale issues.

static std::string& el::base::utils::Str::ltrim ( std::string &  str)
inlinestatic

Trims string from start.

Parameters
[in,out]strString to trim
static std::string& el::base::utils::Str::ltrim ( std::string &  str)
inlinestatic

Trims string from start.

Parameters
[in,out]strString to trim
static std::string& el::base::utils::Str::ltrim ( std::string &  str)
inlinestatic

Trims string from start.

Parameters
[in,out]strString to trim
static std::string& el::base::utils::Str::replaceAll ( std::string &  str,
char  replaceWhat,
char  replaceWith 
)
inlinestatic

Replaces all instances of replaceWhat with 'replaceWith'. Original variable is changed for performance.

Parameters
[in,out]strString to replace from
replaceWhatCharacter to replace
replaceWithCharacter to replace with
Returns
Modified version of str
static std::string& el::base::utils::Str::replaceAll ( std::string &  str,
char  replaceWhat,
char  replaceWith 
)
inlinestatic

Replaces all instances of replaceWhat with 'replaceWith'. Original variable is changed for performance.

Parameters
[in,out]strString to replace from
replaceWhatCharacter to replace
replaceWithCharacter to replace with
Returns
Modified version of str
static std::string& el::base::utils::Str::replaceAll ( std::string &  str,
char  replaceWhat,
char  replaceWith 
)
inlinestatic

Replaces all instances of replaceWhat with 'replaceWith'. Original variable is changed for performance.

Parameters
[in,out]strString to replace from
replaceWhatCharacter to replace
replaceWithCharacter to replace with
Returns
Modified version of str
static std::string& el::base::utils::Str::replaceAll ( std::string &  str,
const std::string &  replaceWhat,
const std::string &  replaceWith 
)
inlinestatic

Replaces all instances of 'replaceWhat' with 'replaceWith'. (String version) Replaces in place.

Parameters
strString to replace from
replaceWhatCharacter to replace
replaceWithCharacter to replace with
Returns
Modified (original) str
static std::string& el::base::utils::Str::replaceAll ( std::string &  str,
const std::string &  replaceWhat,
const std::string &  replaceWith 
)
inlinestatic

Replaces all instances of 'replaceWhat' with 'replaceWith'. (String version) Replaces in place.

Parameters
strString to replace from
replaceWhatCharacter to replace
replaceWithCharacter to replace with
Returns
Modified (original) str
static std::string& el::base::utils::Str::replaceAll ( std::string &  str,
const std::string &  replaceWhat,
const std::string &  replaceWith 
)
inlinestatic

Replaces all instances of 'replaceWhat' with 'replaceWith'. (String version) Replaces in place.

Parameters
strString to replace from
replaceWhatCharacter to replace
replaceWithCharacter to replace with
Returns
Modified (original) str
static void el::base::utils::Str::replaceFirstWithEscape ( base::type::string_t str,
const base::type::string_t replaceWhat,
const base::type::string_t replaceWith 
)
inlinestatic
static void el::base::utils::Str::replaceFirstWithEscape ( base::type::string_t str,
const base::type::string_t replaceWhat,
const base::type::string_t replaceWith 
)
inlinestatic
static void el::base::utils::Str::replaceFirstWithEscape ( base::type::string_t str,
const base::type::string_t replaceWhat,
const base::type::string_t replaceWith 
)
inlinestatic
static std::string& el::base::utils::Str::rtrim ( std::string &  str)
inlinestatic

Trim string from end.

Parameters
[in,out]strString to trim
static std::string& el::base::utils::Str::rtrim ( std::string &  str)
inlinestatic

Trim string from end.

Parameters
[in,out]strString to trim
static std::string& el::base::utils::Str::rtrim ( std::string &  str)
inlinestatic

Trim string from end.

Parameters
[in,out]strString to trim
static bool el::base::utils::Str::startsWith ( const std::string &  str,
const std::string &  start 
)
inlinestatic

Determines whether or not str starts with specified string.

Parameters
strString to check
startString to check against
Returns
Returns true if starts with specified string, false otherwise
static bool el::base::utils::Str::startsWith ( const std::string &  str,
const std::string &  start 
)
inlinestatic

Determines whether or not str starts with specified string.

Parameters
strString to check
startString to check against
Returns
Returns true if starts with specified string, false otherwise
static bool el::base::utils::Str::startsWith ( const std::string &  str,
const std::string &  start 
)
inlinestatic

Determines whether or not str starts with specified string.

Parameters
strString to check
startString to check against
Returns
Returns true if starts with specified string, false otherwise
static std::string& el::base::utils::Str::toUpper ( std::string &  str)
inlinestatic

Converts string to uppercase.

Parameters
strString to convert
Returns
Uppercase string
static std::string& el::base::utils::Str::toUpper ( std::string &  str)
inlinestatic

Converts string to uppercase.

Parameters
strString to convert
Returns
Uppercase string
static std::string& el::base::utils::Str::toUpper ( std::string &  str)
inlinestatic

Converts string to uppercase.

Parameters
strString to convert
Returns
Uppercase string
static std::string& el::base::utils::Str::trim ( std::string &  str)
inlinestatic

Trims string from left and right.

Parameters
[in,out]strString to trim
static std::string& el::base::utils::Str::trim ( std::string &  str)
inlinestatic

Trims string from left and right.

Parameters
[in,out]strString to trim
static std::string& el::base::utils::Str::trim ( std::string &  str)
inlinestatic

Trims string from left and right.

Parameters
[in,out]strString to trim
static char* el::base::utils::Str::wcharPtrToCharPtr ( const wchar_t *  line)
inlinestatic

Converst wchar* to char* NOTE: Need to free return value after use!

static char* el::base::utils::Str::wcharPtrToCharPtr ( const wchar_t *  line)
inlinestatic

Converst wchar* to char* NOTE: Need to free return value after use!

static char* el::base::utils::Str::wcharPtrToCharPtr ( const wchar_t *  line)
inlinestatic

Converst wchar* to char* NOTE: Need to free return value after use!

static bool el::base::utils::Str::wildCardMatch ( const char *  str,
const char *  pattern 
)
inlinestatic

Matches wildcards, '*' and '?' only supported.

static bool el::base::utils::Str::wildCardMatch ( const char *  str,
const char *  pattern 
)
inlinestatic

Matches wildcards, '*' and '?' only supported.

static bool el::base::utils::Str::wildCardMatch ( const char *  str,
const char *  pattern 
)
inlinestatic

Matches wildcards, '*' and '?' only supported.


The documentation for this class was generated from the following files: