KVIrc  4.9.2
DeveloperAPIs
Namespaces | Macros | Functions | Variables
KviQString.cpp File Reference
#include "KviQString.h"
#include "KviCString.h"
#include "KviMemory.h"
#include "KviLocale.h"
#include <ctype.h>
#include <stdio.h>
#include <QRegExp>

Namespaces

 KviQString
 A namespace for QString helper functions.
 

Macros

#define INCREMENT_MEM
 
#define INCREMENT_MEM_BY(numchars)
 
#define MEMINCREMENT   32
 
#define MY_MIN(a, b)   (((a) < (b)) ? (a) : (b))
 

Functions

void KviQString::appendFormatted (QString &szSrc, QString szFmt,...)
 Appends a formatted string. More...
 
void KviQString::appendNumber (QString &szSrc, double dReal)
 Appends the given number to the source string. More...
 
void KviQString::appendNumber (QString &szSrc, int iInteger)
 Appends the given number to the source string. More...
 
void KviQString::appendNumber (QString &szSrc, kvi_i64_t iInteger)
 Appends the given number to the source string. More...
 
void KviQString::appendNumber (QString &szSrc, kvi_u64_t uInteger)
 Appends the given number to the source string. More...
 
void KviQString::appendNumber (QString &szSrc, unsigned int uInteger)
 Appends the given number to the source string. More...
 
void KviQString::bufferToHex (QString &szRetBuffer, const unsigned char *pcBuffer, unsigned int uLen)
 Returns an hexadecimal converted string starting from a buffer. More...
 
int KviQString::cmpCI (const QString &sz1, const QString &sz2, bool bNonAlphaGreater=false)
 Compares two strings with case insensitive. More...
 
int KviQString::cmpCIN (const QString &sz1, const QString &sz2, unsigned int uLen)
 Compares two strings with case insensitive up to N chars. More...
 
void KviQString::cutFromFirst (QString &szSrc, const QChar &c, bool bIncluded=true)
 Cuts the string after the first occurrence of the given char. More...
 
void KviQString::cutFromFirst (QString &szSrc, const QString &szFind, bool bIncluded=true)
 Cuts the string after the first occurrence of the given char. More...
 
void KviQString::cutFromLast (QString &szSrc, const QChar &c, bool bIncluded=true)
 Cuts the string after the last occurrence of the given char. More...
 
void KviQString::cutFromLast (QString &szSrc, const QString &szFind, bool bIncluded=true)
 Cuts the string after the last occurrence of the given char. More...
 
void KviQString::cutToFirst (QString &szSrc, const QChar &c, bool bIncluded=true, bool bClearIfNotFound=false)
 Cuts the string until the first occurrence of the given char is found. More...
 
void KviQString::cutToFirst (QString &szSrc, const QString &szFind, bool bIncluded=true, bool bClearIfNotFound=false)
 Cuts the string until the first occurrence of the given char is found. More...
 
void KviQString::cutToLast (QString &szSrc, const QChar &c, bool bIncluded=true, bool bClearIfNotFound=false)
 Cuts the string until the last occurrence of the given char is found. More...
 
void KviQString::cutToLast (QString &szSrc, const QString &szFind, bool bIncluded=true, bool bClearIfNotFound=false)
 Cuts the string until the last occurrence of the given char is found. More...
 
void KviQString::ensureLastCharIs (QString &szSrc, const QChar &c)
 Ensures the last char of a string is the given char. More...
 
bool KviQString::equalCI (const QString &sz1, const QString &sz2)
 Compares two strings with case insensitive. More...
 
bool KviQString::equalCI (const QString &sz1, const QChar *pC2)
 Compares two strings with case insensitive. More...
 
bool KviQString::equalCI (const QString &sz1, const char *pc2)
 Compares two strings with case insensitive. More...
 
bool KviQString::equalCIN (const QString &sz1, const QString &sz2, unsigned int uLen)
 Compares two strings with case insensitive up to N chars. More...
 
bool KviQString::equalCIN (const QString &sz1, const char *pc2, unsigned int uLen)
 Compares two strings with case insensitive up to N chars. More...
 
bool KviQString::equalCIN (const QString &sz1, const QChar *pC2, unsigned int uLen)
 Compares two strings with case insensitive up to N chars. More...
 
bool KviQString::equalCS (const QString &sz1, const QString &sz2)
 Compares two strings with case sensitive. More...
 
bool KviQString::equalCS (const QString &sz1, const char *pc2)
 Compares two strings with case sensitive. More...
 
bool KviQString::equalCSN (const QString &sz1, const QString &sz2, unsigned int uLen)
 Compares two strings with case sensitive up to N chars. More...
 
bool KviQString::equalCSN (const QString &sz1, const char *pc2, unsigned int uLen)
 Compares two strings with case sensitive up to N chars. More...
 
void KviQString::escapeKvs (QString *szData, uint uFlags=0)
 Escapes any kvs special character from a string. More...
 
QString KviQString::getToken (QString &szSrc, const QChar &sep)
 Returns a token from a string. More...
 
QString KviQString::leftToFirst (QString &szSrc, const QChar &c, bool bIncluded=true, bool bReturnFullStringIfNotFound=true)
 Returns the string up to the the first occurrence of the given char. More...
 
QString KviQString::leftToFirst (QString &szSrc, const QString &szFind, bool bIncluded=true, bool bReturnFullStringIfNotFound=true)
 Returns the string up to the first occurrence of the given string. More...
 
QString KviQString::leftToLast (QString &szSrc, const QChar &c, bool bIncluded=true, bool bReturnFullStringIfNotFound=true)
 Returns the string up to the last occurrence of the given char. More...
 
QString KviQString::leftToLast (QString &szSrc, const QString &szFind, bool bIncluded=true, bool bReturnFullStringIfNotFound=true)
 Returns the string up to the last occurrence of the given string. More...
 
QString KviQString::lowerISO88591 (const QString &szSrc)
 Returns an ISO-8859-1 lower case string. More...
 
QString KviQString::makeSizeReadable (quint64 size)
 Returns a readable size in byte's multiples. More...
 
bool KviQString::matchString (const QString &szExp, const QString &szStr, bool bIsRegExp=false, bool bExact=false, bool bCs=false)
 Matches two string containging wildcards (* and ?) or regular expressions. More...
 
bool KviQString::matchWildExpressions (const QString &szM1, const QString &szM2)
 Matches two strings containging wildcards (* and ?) More...
 
void KviQString::stripLeft (QString &szSrc, const QChar &c)
 Trims all c chars at the start of the given string. More...
 
void KviQString::stripRight (QString &szSrc, const QChar &c)
 Trims all c chars at the end of the given string. More...
 
void KviQString::stripRightWhiteSpace (QString &szSrc)
 Trims all the whitespaces at the end of the given string. More...
 
QString KviQString::toHtmlEscaped (QString szData)
 Escapes any html special character from a string (wrapper to QString::toHtmlEscaped) More...
 
void KviQString::transliterate (QString &szSrc, const QString &szToFind, const QString &szReplacement)
 Replaces a string with another. More...
 
QString KviQString::upperISO88591 (const QString &szSrc)
 Returns an ISO-8859-1 upper case string. More...
 
void KviQString::vsprintf (QString &szSrc, const QString &szFmt, kvi_va_list list)
 Writes to the character string. More...
 

Variables

static char KviQString::cHexDigits [16] = { '0', '1', '2', '3', '4', '5', '6', '7', '8', '9', 'a', 'b', 'c', 'd', 'e', 'f' }
 
const QString KviQString::Empty
 A global empty string (note that this is ALSO NULL under Qt 3.x) More...
 
unsigned char iso88591_toLower_map [256]
 
unsigned char iso88591_toUpper_map [256]
 

Macro Definition Documentation

#define INCREMENT_MEM
Value:
{ \
iAllocSize += MEMINCREMENT; \
pBuffer = (QChar *)KviMemory::reallocate(pBuffer, sizeof(QChar) * iAllocSize); \
p = pBuffer + iRealLen; \
}
#define MEMINCREMENT
void * reallocate(void *ptr, int size)
Definition: KviMemory.h:118
#define p
Definition: detector.cpp:80

Referenced by KviQString::vsprintf().

#define INCREMENT_MEM_BY (   numchars)
Value:
{ \
iAllocSize += numchars + MEMINCREMENT; \
pBuffer = (QChar *)KviMemory::reallocate(pBuffer, sizeof(QChar) * iAllocSize); \
p = pBuffer + iRealLen; \
}
#define MEMINCREMENT
void * reallocate(void *ptr, int size)
Definition: KviMemory.h:118
#define p
Definition: detector.cpp:80

Referenced by KviQString::vsprintf().

#define MEMINCREMENT   32

Referenced by KviQString::vsprintf().

#define MY_MIN (   a,
 
)    (((a) < (b)) ? (a) : (b))

Variable Documentation

unsigned char iso88591_toLower_map[256]
unsigned char iso88591_toUpper_map[256]