KVIrc 5.2.6
Developer APIs
KviQString.h File Reference

Helper functions for the QString class. More...

#include "kvi_settings.h"
#include "kvi_inttypes.h"
#include "kvi_stdarg.h"
#include <QByteArray>
#include <QChar>
#include <QString>

Go to the source code of this file.

Namespaces

namespace  KviQString
 A namespace for QString helper functions.
 

Enumerations

enum  KviQString::EscapeKVSFlags {
  KviQString::EscapeSpace = 1 , KviQString::PermitVariables = 2 , KviQString::PermitFunctions = 4 , KviQString::PermitMultiLine = 8 ,
  KviQString::EscapeParenthesis = 16
}
 Holds the flags to escape KVS. More...
 

Functions

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

Detailed Description

Helper functions for the QString class.

Author
Szymon Stefanek