ZNC  trunk
 All Classes Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
Public Types | Public Member Functions | Static Public Member Functions | Protected Member Functions | List of all members
PString Class Reference

#include <pstring.h>

+ Inheritance diagram for PString:
+ Collaboration diagram for PString:

Public Types

enum  EType {
  STRING, INT, UINT, NUM,
  BOOL
}
 
enum  EEscape {
  EASCII, EURL, EHTML, ESQL,
  ENAMEDFMT, EDEBUG
}
 

Public Member Functions

 PString ()
 
 PString (const char *c)
 
 PString (const CString &s)
 
 PString (int i)
 
 PString (u_int i)
 
 PString (long i)
 
 PString (u_long i)
 
 PString (long long i)
 
 PString (unsigned long long i)
 
 PString (double i)
 
 PString (bool b)
 
 PString (SV *sv)
 
virtual ~PString ()
 
EType GetType () const
 
void SetType (EType e)
 
SV * GetSV (bool bMakeMortal=true) const
 
template<typename T >
bool Convert (T *target) const
 Casts a CString to another type. More...
 
template<typename Iterator >
CString Join (Iterator i_start, const Iterator &i_end) const
 Joins a collection of objects together, using 'this' as a delimiter. More...
 
int CaseCmp (const CString &s, CString::size_type uLen=CString::npos) const
 Compare this string caselessly to some other string. More...
 
int StrCmp (const CString &s, CString::size_type uLen=CString::npos) const
 Compare this string case sensitively to some other string. More...
 
bool Equals (const CString &s, bool bCaseSensitive=false, CString::size_type uLen=CString::npos) const
 Check if this string is equal to some other string. More...
 
bool WildCmp (const CString &sWild) const
 Do a wild compare on this string. More...
 
CStringMakeUpper ()
 Turn all characters in this string into their upper-case equivalent. More...
 
CStringMakeLower ()
 Turn all characters in this string into their lower-case equivalent. More...
 
CString AsUpper () const
 Return a copy of this string with all characters turned into upper-case. More...
 
CString AsLower () const
 Return a copy of this string with all characters turned into lower-case. More...
 
CString Escape_n (EEscape eFrom, EEscape eTo) const
 
CString Escape_n (EEscape eTo) const
 
CStringEscape (EEscape eFrom, EEscape eTo)
 
CStringEscape (EEscape eTo)
 
unsigned int Replace (const CString &sReplace, const CString &sWith, const CString &sLeft="", const CString &sRight="", bool bRemoveDelims=false)
 Replace all occurrences in the current string. More...
 
CString Replace_n (const CString &sReplace, const CString &sWith, const CString &sLeft="", const CString &sRight="", bool bRemoveDelims=false) const
 Replace all occurrences in the current string. More...
 
CString Ellipsize (unsigned int uLen) const
 Ellipsize the current string. More...
 
CString Left (size_type uCount) const
 Return the left part of the string. More...
 
CString Right (size_type uCount) const
 Return the right part of the string. More...
 
CString FirstLine () const
 Get the first line of this string. More...
 
CString Token (size_t uPos, bool bRest=false, const CString &sSep=" ", bool bAllowEmpty=false) const
 Get a token out of this string. More...
 
CString Token (size_t uPos, bool bRest, const CString &sSep, bool bAllowEmpty, const CString &sLeft, const CString &sRight, bool bTrimQuotes=true) const
 Get a token out of this string. More...
 
size_type URLSplit (MCString &msRet) const
 
size_type OptionSplit (MCString &msRet, bool bUpperKeys=false) const
 
size_type QuoteSplit (VCString &vsRet) const
 
size_type Split (const CString &sDelim, VCString &vsRet, bool bAllowEmpty=true, const CString &sLeft="", const CString &sRight="", bool bTrimQuotes=true, bool bTrimWhiteSpace=false) const
 Split up this string into tokens. More...
 
size_type Split (const CString &sDelim, SCString &ssRet, bool bAllowEmpty=true, const CString &sLeft="", const CString &sRight="", bool bTrimQuotes=true, bool bTrimWhiteSpace=false) const
 Split up this string into tokens. More...
 
CString MD5 () const
 
CString SHA256 () const
 
unsigned long Base64Decode (CString &sRet) const
 Treat this string as base64-encoded data and decode it. More...
 
unsigned long Base64Decode ()
 Treat this string as base64-encoded data and decode it. More...
 
CString Base64Decode_n () const
 Treat this string as base64-encoded data and decode it. More...
 
bool Base64Encode (CString &sRet, unsigned int uWrap=0) const
 Base64-encode the current string. More...
 
bool Base64Encode (unsigned int uWrap=0)
 Base64-encode the current string. More...
 
CString Base64Encode_n (unsigned int uWrap=0) const
 Base64-encode the current string. More...
 
CString Encrypt_n (const CString &sPass, const CString &sIvec="") const
 
CString Decrypt_n (const CString &sPass, const CString &sIvec="") const
 
void Encrypt (const CString &sPass, const CString &sIvec="")
 
void Decrypt (const CString &sPass, const CString &sIvec="")
 
void Crypt (const CString &sPass, bool bEncrypt, const CString &sIvec="")
 
bool ToBool () const
 
short ToShort () const
 
unsigned short ToUShort () const
 
int ToInt () const
 
long ToLong () const
 
unsigned int ToUInt () const
 
unsigned long ToULong () const
 
unsigned long long ToULongLong () const
 
long long ToLongLong () const
 
double ToDouble () const
 
bool Trim (const CString &s=" \t\r\n")
 Trim this string. More...
 
bool TrimLeft (const CString &s=" \t\r\n")
 Trim this string. More...
 
bool TrimRight (const CString &s=" \t\r\n")
 Trim this string. More...
 
CString Trim_n (const CString &s=" \t\r\n") const
 Trim this string. More...
 
CString TrimLeft_n (const CString &s=" \t\r\n") const
 Trim this string. More...
 
CString TrimRight_n (const CString &s=" \t\r\n") const
 Trim this string. More...
 
bool TrimPrefix (const CString &sPrefix=":")
 Trim a given prefix. More...
 
bool TrimSuffix (const CString &sSuffix)
 Trim a given suffix. More...
 
CString TrimPrefix_n (const CString &sPrefix=":") const
 Trim a given prefix. More...
 
CString TrimSuffix_n (const CString &sSuffix) const
 Trim a given suffix. More...
 
bool StartsWith (const CString &sPrefix) const
 Check whether the string starts with a given prefix. More...
 
bool EndsWith (const CString &sSuffix) const
 Check whether the string ends with a given suffix. More...
 
bool LeftChomp (size_type uLen=1)
 Remove characters from the beginning of this string. More...
 
bool RightChomp (size_type uLen=1)
 Remove characters from the end of this string. More...
 
CString LeftChomp_n (size_type uLen=1) const
 Remove characters from the beginning of this string. More...
 
CString RightChomp_n (size_type uLen=1) const
 Remove characters from the end of this string. More...
 
CStringStripControls ()
 Remove controls characters from this string. More...
 
CString StripControls_n () const
 Remove controls characters from this string. More...
 

Static Public Member Functions

static bool WildCmp (const CString &sWild, const CString &sString)
 Do a wildcard comparision between two strings. More...
 
static EEscape ToEscape (const CString &sEsc)
 
static unsigned int Replace (CString &sStr, const CString &sReplace, const CString &sWith, const CString &sLeft="", const CString &sRight="", bool bRemoveDelims=false)
 Replace all occurrences in a string. More...
 
static CString NamedFormat (const CString &sFormat, const MCString &msValues)
 Build a string from a format string, replacing values from a map. More...
 
static CString RandomString (unsigned int uLength)
 Produces a random string. More...
 
static CString ToPercent (double d)
 Pretty-print a percent value. More...
 
static CString ToByteStr (unsigned long long d)
 Pretty-print a number of bytes. More...
 
static CString ToTimeStr (unsigned long s)
 Pretty-print a time span. More...
 

Protected Member Functions

unsigned char * strnchr (const unsigned char *src, unsigned char c, unsigned int iMaxBytes, unsigned char *pFill=NULL, unsigned int *piCount=NULL) const
 

Member Enumeration Documentation

enum CString::EEscape
inherited
Enumerator
EASCII 
EURL 
EHTML 
ESQL 
ENAMEDFMT 
EDEBUG 
Enumerator
STRING 
INT 
UINT 
NUM 
BOOL 

Constructor & Destructor Documentation

PString::PString ( )
inline

References STRING.

PString::PString ( const char *  c)
inline

References STRING.

PString::PString ( const CString s)
inline

References STRING.

PString::PString ( int  i)
inline

References INT.

PString::PString ( u_int  i)
inline

References UINT.

PString::PString ( long  i)
inline

References INT.

PString::PString ( u_long  i)
inline

References UINT.

PString::PString ( long long  i)
inline

References INT.

PString::PString ( unsigned long long  i)
inline

References UINT.

PString::PString ( double  i)
inline

References NUM.

PString::PString ( bool  b)
inline

References BOOL.

PString::PString ( SV *  sv)
inline
virtual PString::~PString ( )
inlinevirtual

Member Function Documentation

CString CString::AsLower ( ) const
inherited

Return a copy of this string with all characters turned into lower-case.

Returns
The new string.
CString CString::AsUpper ( ) const
inherited

Return a copy of this string with all characters turned into upper-case.

Returns
The new string.
unsigned long CString::Base64Decode ( CString sRet) const
inherited

Treat this string as base64-encoded data and decode it.

Parameters
sRetString to which the result of the decode is safed.
Returns
The length of the resulting string.
unsigned long CString::Base64Decode ( )
inherited

Treat this string as base64-encoded data and decode it.

The result is saved in this CString instance.

Returns
The length of the resulting string.
CString CString::Base64Decode_n ( ) const
inherited

Treat this string as base64-encoded data and decode it.

Returns
The decoded string.
bool CString::Base64Encode ( CString sRet,
unsigned int  uWrap = 0 
) const
inherited

Base64-encode the current string.

Parameters
sRetString where the result is saved.
uWrapA boolean(!?!) that decides if the result should be wrapped after everywhere 57 characters.
Returns
true unless this code is buggy.
Todo:

WTF @ uWrap.

This only returns false if some formula we use was wrong?!

bool CString::Base64Encode ( unsigned int  uWrap = 0)
inherited

Base64-encode the current string.

This string is overwritten with the result of the encode.

Todo:
return value and param are as with Base64Encode() from above.
CString CString::Base64Encode_n ( unsigned int  uWrap = 0) const
inherited

Base64-encode the current string.

Todo:
uWrap is as broken as Base64Encode()'s uWrap.
Returns
The encoded string.
int CString::CaseCmp ( const CString s,
CString::size_type  uLen = CString::npos 
) const
inherited

Compare this string caselessly to some other string.

Parameters
sThe string to compare to.
uLenThe number of characters to compare.
Returns
An integer less than, equal to, or greater than zero if this string smaller, equal.... to the given string.
template<typename T >
bool CString::Convert ( T *  target) const
inlineinherited

Casts a CString to another type.

Implemented via std::stringstream, you use this for any class that has an operator<<(std::ostream, YourClass).

Parameters
targetThe object to cast into. If the cast fails, its state is unspecified.
Returns
True if the cast succeeds, and false if it fails.
void CString::Crypt ( const CString sPass,
bool  bEncrypt,
const CString sIvec = "" 
)
inherited
void CString::Decrypt ( const CString sPass,
const CString sIvec = "" 
)
inherited
CString CString::Decrypt_n ( const CString sPass,
const CString sIvec = "" 
) const
inherited
CString CString::Ellipsize ( unsigned int  uLen) const
inherited

Ellipsize the current string.

For example, ellipsizing "Hello, I'm Bob" to the length 9 would result in "Hello,...".

Parameters
uLenThe length to ellipsize to.
Returns
The ellipsized string.
void CString::Encrypt ( const CString sPass,
const CString sIvec = "" 
)
inherited
CString CString::Encrypt_n ( const CString sPass,
const CString sIvec = "" 
) const
inherited
bool CString::EndsWith ( const CString sSuffix) const
inherited

Check whether the string ends with a given suffix.

Parameters
sSuffixThe suffix.
Returns
True if the string ends with suffix, false otherwise.
bool CString::Equals ( const CString s,
bool  bCaseSensitive = false,
CString::size_type  uLen = CString::npos 
) const
inherited

Check if this string is equal to some other string.

Parameters
sThe string to compare to.
bCaseSensitiveTrue if you want the comparision to be case sensitive.
uLenNumber of characters to consider.
Returns
True if the strings are equal.
CString& CString::Escape ( EEscape  eFrom,
EEscape  eTo 
)
inherited
CString& CString::Escape ( EEscape  eTo)
inherited
CString CString::Escape_n ( EEscape  eFrom,
EEscape  eTo 
) const
inherited
CString CString::Escape_n ( EEscape  eTo) const
inherited
CString CString::FirstLine ( ) const
inlineinherited

Get the first line of this string.

Returns
The first line of text.

References CString::Token().

SV* PString::GetSV ( bool  bMakeMortal = true) const
inline
EType PString::GetType ( ) const
inline

Referenced by GetSV().

template<typename Iterator >
CString CString::Join ( Iterator  i_start,
const Iterator &  i_end 
) const
inlineinherited

Joins a collection of objects together, using 'this' as a delimiter.

You can pass either pointers to arrays, or iterators to collections.

Parameters
i_beginAn iterator pointing to the beginning of a group of objects.
i_endAn iterator pointing past the end of a group of objects.
Returns
The joined string

References CString::CString().

CString CString::Left ( size_type  uCount) const
inherited

Return the left part of the string.

Parameters
uCountThe number of characters to keep.
Returns
The resulting string.
bool CString::LeftChomp ( size_type  uLen = 1)
inherited

Remove characters from the beginning of this string.

Parameters
uLenThe number of characters to remove.
Returns
true if this string was modified.
CString CString::LeftChomp_n ( size_type  uLen = 1) const
inherited

Remove characters from the beginning of this string.

This string object isn't modified.

Parameters
uLenThe number of characters to remove.
Returns
The result of the conversion.
CString& CString::MakeLower ( )
inherited

Turn all characters in this string into their lower-case equivalent.

Returns
A reference to *this.
CString& CString::MakeUpper ( )
inherited

Turn all characters in this string into their upper-case equivalent.

Returns
A reference to *this.
CString CString::MD5 ( ) const
inherited
Returns
The MD5 hash of this string.
static CString CString::NamedFormat ( const CString sFormat,
const MCString msValues 
)
staticinherited

Build a string from a format string, replacing values from a map.

The format specification can contain simple named parameters that match keys in the given map. For example in the string "a {b} c", the key "b" is looked up in the map, and inserted for "{b}".

Parameters
sFormatThe format specification.
msValuesA map of named parameters to their values.
Returns
The string with named parameters replaced.
size_type CString::OptionSplit ( MCString msRet,
bool  bUpperKeys = false 
) const
inherited
size_type CString::QuoteSplit ( VCString vsRet) const
inherited
static CString CString::RandomString ( unsigned int  uLength)
staticinherited

Produces a random string.

Parameters
uLengthThe length of the resulting string.
Returns
A random string.
static unsigned int CString::Replace ( CString sStr,
const CString sReplace,
const CString sWith,
const CString sLeft = "",
const CString sRight = "",
bool  bRemoveDelims = false 
)
staticinherited

Replace all occurrences in a string.

You can specify a "safe zone" via sLeft and sRight. Anything inside of such a zone will not be replaced. This does not do recursion, so e.g. with Replace("(a()a)", "a", "b", "(", ")", true) you would get "a(b)" as result. The second opening brace and the second closing brace would not be seen as a delimitered and thus wouldn't be removed. The first a is inside a "safe zone" and thus is left alone, too.

Parameters
sStrThe string to do the replacing on. This will also contain the result when this function returns.
sReplaceThe string that should be replaced.
sWithThe replacement to use.
sLeftThe string that marks the begin of the "safe zone".
sRightThe string that marks the end of the "safe zone".
bRemoveDelimsIf this is true, all matches for sLeft and sRight are removed.
Returns
The number of replacements done.
unsigned int CString::Replace ( const CString sReplace,
const CString sWith,
const CString sLeft = "",
const CString sRight = "",
bool  bRemoveDelims = false 
)
inherited

Replace all occurrences in the current string.

See Also
CString::Replace
Parameters
sReplaceThe string to look for.
sWithThe replacement to use.
sLeftThe delimiter at the beginning of a safe zone.
sRightThe delimiter at the end of a safe zone.
bRemoveDelimsIf true, all matching delimiters are removed.
Returns
The number of replacements done.
CString CString::Replace_n ( const CString sReplace,
const CString sWith,
const CString sLeft = "",
const CString sRight = "",
bool  bRemoveDelims = false 
) const
inherited

Replace all occurrences in the current string.

See Also
CString::Replace
Parameters
sReplaceThe string to look for.
sWithThe replacement to use.
sLeftThe delimiter at the beginning of a safe zone.
sRightThe delimiter at the end of a safe zone.
bRemoveDelimsIf true, all matching delimiters are removed.
Returns
The result of the replacing. The current string is left unchanged.
CString CString::Right ( size_type  uCount) const
inherited

Return the right part of the string.

Parameters
uCountThe number of characters to keep.
Returns
The resulting string.
bool CString::RightChomp ( size_type  uLen = 1)
inherited

Remove characters from the end of this string.

Parameters
uLenThe number of characters to remove.
Returns
true if this string was modified.
CString CString::RightChomp_n ( size_type  uLen = 1) const
inherited

Remove characters from the end of this string.

This string object isn't modified.

Parameters
uLenThe number of characters to remove.
Returns
The result of the conversion.
void PString::SetType ( EType  e)
inline
CString CString::SHA256 ( ) const
inherited
Returns
The SHA256 hash of this string.
size_type CString::Split ( const CString sDelim,
VCString vsRet,
bool  bAllowEmpty = true,
const CString sLeft = "",
const CString sRight = "",
bool  bTrimQuotes = true,
bool  bTrimWhiteSpace = false 
) const
inherited

Split up this string into tokens.

Via sLeft and sRight you can define "markers" like with Replace(). Anything in such a marked section is treated as a single token. All occurences of sDelim in such a block are ignored.

Parameters
sDelimDelimiter between tokens.
vsRetVector for returning the result.
bAllowEmptyDo empty tokens count as a valid token?
sLeftLeft delimiter like with Replace().
sRightRight delimiter like with Replace().
bTrimQuotesShould sLeft and sRight be removed from the token they mark?
bTrimWhiteSpaceIf this is true, CString::Trim() is called on each token.
Returns
The number of tokens found.
size_type CString::Split ( const CString sDelim,
SCString ssRet,
bool  bAllowEmpty = true,
const CString sLeft = "",
const CString sRight = "",
bool  bTrimQuotes = true,
bool  bTrimWhiteSpace = false 
) const
inherited

Split up this string into tokens.

This function is identical to the other CString::Split(), except that the result is returned as a SCString instead of a VCString.

bool CString::StartsWith ( const CString sPrefix) const
inherited

Check whether the string starts with a given prefix.

Parameters
sPrefixThe prefix.
Returns
True if the string starts with prefix, false otherwise.
int CString::StrCmp ( const CString s,
CString::size_type  uLen = CString::npos 
) const
inherited

Compare this string case sensitively to some other string.

Parameters
sThe string to compare to.
uLenThe number of characters to compare.
Returns
An integer less than, equal to, or greater than zero if this string smaller, equal.... to the given string.
CString& CString::StripControls ( )
inherited

Remove controls characters from this string.

Controls characters are color codes, and those in C0 set See https://en.wikipedia.org/wiki/C0_and_C1_control_codes

Returns
The result of the conversion.
CString CString::StripControls_n ( ) const
inherited

Remove controls characters from this string.

Controls characters are color codes, and those in C0 set See https://en.wikipedia.org/wiki/C0_and_C1_control_codes This string object isn't modified.

Returns
The result of the conversion.
unsigned char* CString::strnchr ( const unsigned char *  src,
unsigned char  c,
unsigned int  iMaxBytes,
unsigned char *  pFill = NULL,
unsigned int *  piCount = NULL 
) const
protectedinherited
bool CString::ToBool ( ) const
inherited
Returns
True if this string is not "false".

Referenced by CConfig::FindBoolEntry().

static CString CString::ToByteStr ( unsigned long long  d)
staticinherited

Pretty-print a number of bytes.

Parameters
dThe number of bytes.
Returns
A string describing the number of bytes.
double CString::ToDouble ( ) const
inherited
Returns
The numerical value of this string similar to atoi().

Referenced by CConfig::FindDoubleEntry(), and GetSV().

static EEscape CString::ToEscape ( const CString sEsc)
staticinherited
int CString::ToInt ( ) const
inherited
Returns
The numerical value of this string similar to atoi().
CString CString::Token ( size_t  uPos,
bool  bRest = false,
const CString sSep = " ",
bool  bAllowEmpty = false 
) const
inherited

Get a token out of this string.

For example in the string "a bc d e", each of "a", "bc", "d" and "e" are tokens.

Parameters
uPosThe number of the token you are interested. The first token has a position of 0.
bRestIf false, only the token you asked for is returned. Else you get the substring starting from the beginning of your token.
sSepSeperator between tokens.
bAllowEmptyIf this is true, empty tokens are allowed. In the example from above this means that there is a token "" before the "e" token.
Returns
The token you asked for and, if bRest is true, everything after it.
See Also
Split() if you need a string split into all of its tokens.

Referenced by CString::FirstLine().

CString CString::Token ( size_t  uPos,
bool  bRest,
const CString sSep,
bool  bAllowEmpty,
const CString sLeft,
const CString sRight,
bool  bTrimQuotes = true 
) const
inherited

Get a token out of this string.

This function behaves much like the other Token() function in this class. The extra arguments are handled similarly to Split().

long CString::ToLong ( ) const
inherited
Returns
The numerical value of this string similar to atoi().
long long CString::ToLongLong ( ) const
inherited
Returns
The numerical value of this string similar to atoi().

Referenced by GetSV().

static CString CString::ToPercent ( double  d)
staticinherited

Pretty-print a percent value.

Parameters
dThe percent value. This should be in range 0-100.
Returns
The "pretty" string.
short CString::ToShort ( ) const
inherited
Returns
The numerical value of this string similar to atoi().
static CString CString::ToTimeStr ( unsigned long  s)
staticinherited

Pretty-print a time span.

Parameters
sNumber of seconds to print.
Returns
A string like "4w 6d 4h 3m 58s".
unsigned int CString::ToUInt ( ) const
inherited
Returns
The numerical value of this string similar to atoi().

Referenced by CConfig::FindUIntEntry().

unsigned long CString::ToULong ( ) const
inherited
Returns
The numerical value of this string similar to atoi().
unsigned long long CString::ToULongLong ( ) const
inherited
Returns
The numerical value of this string similar to atoi().

Referenced by GetSV().

unsigned short CString::ToUShort ( ) const
inherited
Returns
The numerical value of this string similar to atoi().

Referenced by CConfig::FindUShortEntry().

bool CString::Trim ( const CString s = " \t\r\n")
inherited

Trim this string.

All leading/trailing occurences of characters from s are removed.

Parameters
sA list of characters that should be trimmed.
Returns
true if this string was modified.
CString CString::Trim_n ( const CString s = " \t\r\n") const
inherited

Trim this string.

All leading/trailing occurences of characters from s are removed. This CString instance is not modified.

Parameters
sA list of characters that should be trimmed.
Returns
The trimmed string.
bool CString::TrimLeft ( const CString s = " \t\r\n")
inherited

Trim this string.

All leading occurences of characters from s are removed.

Parameters
sA list of characters that should be trimmed.
Returns
true if this string was modified.
CString CString::TrimLeft_n ( const CString s = " \t\r\n") const
inherited

Trim this string.

All leading occurences of characters from s are removed. This CString instance is not modified.

Parameters
sA list of characters that should be trimmed.
Returns
The trimmed string.
bool CString::TrimPrefix ( const CString sPrefix = ":")
inherited

Trim a given prefix.

Parameters
sPrefixThe prefix that should be removed.
Returns
True if this string was modified.
CString CString::TrimPrefix_n ( const CString sPrefix = ":") const
inherited

Trim a given prefix.

Parameters
sPrefixThe prefix that should be removed.
Returns
A copy of this string without the prefix.
bool CString::TrimRight ( const CString s = " \t\r\n")
inherited

Trim this string.

All trailing occurences of characters from s are removed.

Parameters
sA list of characters that should be trimmed.
Returns
true if this string was modified.
CString CString::TrimRight_n ( const CString s = " \t\r\n") const
inherited

Trim this string.

All trailing occurences of characters from s are removed. This CString instance is not modified.

Parameters
sA list of characters that should be trimmed.
Returns
The trimmed string.
bool CString::TrimSuffix ( const CString sSuffix)
inherited

Trim a given suffix.

Parameters
sSuffixThe suffix that should be removed.
Returns
True if this string was modified.
CString CString::TrimSuffix_n ( const CString sSuffix) const
inherited

Trim a given suffix.

Parameters
sSuffixThe suffix that should be removed.
Returns
A copy of this string without the prefix.

Referenced by CDir::FillByWildcard().

size_type CString::URLSplit ( MCString msRet) const
inherited
static bool CString::WildCmp ( const CString sWild,
const CString sString 
)
staticinherited

Do a wildcard comparision between two strings.

For example, the following returns true: WildCmp("*!?bar@foo", "I_am!~bar@foo");

Parameters
sWildThe wildcards used for the comparison.
sStringThe string that is used for comparing.
Returns
true if the wildcard matches.

Referenced by CDir::FillByWildcard().

bool CString::WildCmp ( const CString sWild) const
inherited

Do a wild compare on this string.

Parameters
sWildThe wildcards used to for the comparison.
Returns
The result of this->WildCmp(sWild, *this);.

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