KVIrc  4.9.2
DeveloperAPIs
Enumerations | Functions | Variables
KviQString Namespace Reference

A namespace for QString helper functions. More...

Enumerations

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

Functions

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

Variables

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

Detailed Description

A namespace for QString helper functions.

This namespace contains several helper functions that are used when dealing with QString.

Enumeration Type Documentation

Holds the flags to escape KVS.

Enumerator
EscapeSpace 

escapes spaces

PermitVariables 

escapes '' character to permit variables

PermitFunctions 

escapes '$' character to permit functions

PermitMultiLine 

escapes '' and '
' characters

EscapeParenthesis 

escapes parenthesis

Function Documentation

KVILIB_API void KviQString::appendFormatted ( QString &  szSrc,
QString  szFmt,
  ... 
)
KVILIB_API void KviQString::appendNumber ( QString &  szSrc,
double  dReal 
)

Appends the given number to the source string.

Parameters
szSrcThe source string
dRealNumber in double format
Returns
void

Referenced by KviKvsVariant::appendAsString().

KVILIB_API void KviQString::appendNumber ( QString &  szSrc,
int  iInteger 
)

Appends the given number to the source string.

Parameters
szSrcThe source string
iIntegerNumber in int format
Returns
void
KVILIB_API void KviQString::appendNumber ( QString &  szSrc,
kvi_i64_t  iInteger 
)

Appends the given number to the source string.

Parameters
szSrcThe source string
iIntegerNumber in kvi_i64_t format
Returns
void
KVILIB_API void KviQString::appendNumber ( QString &  szSrc,
kvi_u64_t  uInteger 
)

Appends the given number to the source string.

Parameters
szSrcThe source string
uIntegerNumber in kvi_i64_t format
Returns
void
KVILIB_API void KviQString::appendNumber ( QString &  szSrc,
unsigned int  uInteger 
)

Appends the given number to the source string.

Parameters
szSrcThe source string
uIntegerNumber in unsigned int format
Returns
void
KVILIB_API void KviQString::bufferToHex ( QString &  szRetBuffer,
const unsigned char *  pcBuffer,
unsigned int  uLen 
)

Returns an hexadecimal converted string starting from a buffer.

Parameters
szRetBufferThe buffer to hold the hexadecimal string
pcBufferThe buffer containing the string to convert
uLenThe max length of the original string

References cHexDigits, and u.

KVILIB_API int KviQString::cmpCI ( const QString &  sz1,
const QString &  sz2,
bool  bNonAlphaGreater = false 
)

Compares two strings with case insensitive.

Note that greater here means that come AFTER in the alphabetic order return < 0 —> str1 < str2 return = 0 —> str1 = str2 return > 0 —> str1 > str2

Parameters
sz1The first string
sz2The second string
bNonAlphaGreaterWheter to check if strings are not alphabetics
Returns
int

Referenced by KviUserListView::insertUserEntry().

KVILIB_API int KviQString::cmpCIN ( const QString &  sz1,
const QString &  sz2,
unsigned int  uLen 
)

Compares two strings with case insensitive up to N chars.

Note that greater here means that come AFTER in the alphabetic order return < 0 —> str1 < str2 return = 0 —> str1 = str2 return > 0 —> str1 > str2

Parameters
sz1The first string
sz2The second string
uLenThe number of chars to check
Returns
int

References MY_MIN.

Referenced by KviUserListView::completeNickStandard().

KVILIB_API void KviQString::cutFromFirst ( QString &  szSrc,
const QChar &  c,
bool  bIncluded = true 
)

Cuts the string after the first occurrence of the given char.

If the char is not found, the string is returned as it is.

Parameters
szSrcThe source string
cThe char to search for
bIncludedWheter to include the given char
Returns
void

Referenced by KviWindow::systemTextEncodingPopupActivated().

KVILIB_API void KviQString::cutFromFirst ( QString &  szSrc,
const QString &  szFind,
bool  bIncluded = true 
)

Cuts the string after the first occurrence of the given char.

If the char is not found, the string is returned as it is.

Parameters
szSrcThe source string
szFindThe string to search for
bIncludedWheter to include the given string
Returns
void
KVILIB_API void KviQString::cutFromLast ( QString &  szSrc,
const QChar &  c,
bool  bIncluded = true 
)

Cuts the string after the last occurrence of the given char.

If the char is not found, the string is returned as it is.

Parameters
szSrcThe source string
cThe char to search for
bIncludedWheter to include the given char
Returns
void

Referenced by KviApplication::completeDirectory(), KviModuleManager::completeModuleNames(), and KviConsoleWindow::completeServer().

KVILIB_API void KviQString::cutFromLast ( QString &  szSrc,
const QString &  szFind,
bool  bIncluded = true 
)

Cuts the string after the last occurrence of the given char.

If the char is not found, the string is returned as it is.

Parameters
szSrcThe source string
szFindThe string to search for
bIncludedWheter to include the given string
Returns
void
KVILIB_API 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.

If the char is not found, the string is returned as it is.

Parameters
szSrcThe source string
cThe char to search for
bIncludedWheter to include the given char in the cut
bClearIfNotFoundWheter to cut the whole string if the char is not found
Returns
void

Referenced by KviModuleManager::completeModuleNames(), KviConsoleWindow::completeServer(), and KviApplication::mapImageFile().

KVILIB_API 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.

If the char is not found, the string is returned as it is.

Parameters
szSrcThe source string
szFindThe string to search for
bIncludedWheter to include the given string in the cut
bClearIfNotFoundWheter to cut the whole string if the string is not found
Returns
void
KVILIB_API 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.

If the char is not found, the string is returned as it is.

Parameters
szSrcThe source string
cThe char to search for
bIncludedWheter to include the given char in the cut
bClearIfNotFoundWheter to cut the whole string if the char is not found
Returns
void

Referenced by KviApplication::completeDirectory(), KviModuleManager::completeModuleNames(), DccFileTransfer::connectionInProgress(), dcc_kvs_cmd_get(), file_kvs_fnc_extractfilename(), KviRegisteredChannelDataBase::load(), KviModuleManager::loadModulesByCaps(), KviIrcServerParser::parseCtcpReplyAvatar(), and sharedfile_kvs_cmd_add().

KVILIB_API 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.

If the char is not found, the string is returned as it is.

Parameters
szSrcThe source string
szFindThe string to search for
bIncludedWheter to include the given string in the cut
bClearIfNotFoundWheter to cut the whole string if the string is not found
Returns
void
KVILIB_API void KviQString::ensureLastCharIs ( QString &  szSrc,
const QChar &  c 
)
KVILIB_API bool KviQString::equalCI ( const QString &  sz1,
const QString &  sz2 
)

Compares two strings with case insensitive.

It returns true if the strings are equal, false otherwise

Parameters
sz1First string
sz2Second string
Returns
bool

Referenced by AliasEditorWidget::aliasExists(), AliasEditorWidget::aliasRefresh(), KviConsoleWindow::avatarChanged(), KviUserListView::completeNickStandard(), KviInputEditor::completion(), config_kvs_fnc_id(), config_kvs_fnc_open(), AliasEditorWidget::createFullItem(), ClassEditorWidget::createFullItem(), ClassEditorWidget::createFullNamespace(), KviIrcLink::createSocket(), KviWindow::createSystemTextEncodingPopup(), dcc_kvs_get_listen_ip_address(), dialog_kvs_cmd_file(), KviKvsObject::disconnectSignal(), DccFileTransfer::doResume(), RegisteredUsersDialog::editGroup(), RegisteredUsersDialog::editItem(), EventEditor::eventHandlerDisabled(), KviKvsTreeNodeSpecialCommandClass::execute(), IrcServerDetailsWidget::fillData(), OptionsDialog::fillTreeWidget(), KviKvsEventManager::findAppEventByName(), KviKvsEventManager::findAppEventIndexByName(), KviIrcConnection::findChannel(), KviKvsObject::findChild(), KviKvsPopupMenu::findChildPopupByName(), KviApplication::findConsole(), KviIrcContext::findDeadChannel(), KviIrcContext::findDeadQuery(), KviRegisteredChannelDataBase::findExact(), ClassEditorWidget::findFunction(), AliasEditorWidget::findItem(), ClassEditorWidget::findItem(), KviMenuBar::findMenu(), OptionsWidget_servers::findNetItem(), KviIrcConnection::findQuery(), KviKvsEventManager::findScriptAppHandler(), KviKvsEventManager::findScriptRawHandler(), KviIrcNetwork::findServer(), ClassEditorWidget::findTopLevelItem(), KvsObject_wrapper::findTopLevelWidgetToWrap(), KvsObject_wrapper::findWidgetToWrap(), KviApplication::findWindowByCaption(), KviStringConversion::fromString(), KvsObject_textedit::functionsetAlignment(), KvsObject_textedit::functionsetTextFormat(), KvsObject_textedit::functionSetWordWrap(), KviRegisteredUser::getBoolProperty(), KviKvsObject::getClass(), EventEditor::getUniqueHandlerName(), RawEditorWidget::getUniqueHandlerName(), PopupEditorWidget::getUniquePopupName(), KviIsOnNotifyListManager::handleIsOn(), KviIsOnNotifyListManager::handleUserhost(), http_kvs_complete_get(), OptionsWidget_servers::importServer(), KvsObject_wrapper::init(), AddonFunctions::installAddonPackage(), ThemeFunctions::installThemePackage(), KviChannelWindow::internalMask(), IrcNetworkDetailsWidget::IrcNetworkDetailsWidget(), IrcServerDetailsWidget::IrcServerDetailsWidget(), kvi_hash_key_equal(), KviClassEditorDialog::KviClassEditorDialog(), KviIdentityGeneralOptionsWidget::KviIdentityGeneralOptionsWidget(), KviKvsCallbackMessageBox::KviKvsCallbackMessageBox(), KviKvsCoreFunctions::KVSCF(), KviKvsCoreSimpleCommands::KVSCSC(), KVSO_CLASS_FUNCTION(), KviRegisteredUserDataBase::load(), KviUserIdentityManager::load(), ClassEditorWidget::loadNotBuiltClasses(), LogFile::LogFile(), KviIrcConnectionAsyncData< KviAsyncWhoisInfo >::lookup(), KviIrcServerDataBase::makeCurrentBestServerInNetwork(), KviIrcServerDataBase::makeCurrentServer(), OptionsWidget_soundGeneral::mediaFillBox(), KviIrcView::mouseDoubleClickEvent(), AliasEditorWidget::namespaceExists(), KviPixmap::operator=(), KviIrcMask::operator==(), OptionsDialog::OptionsDialog(), OptionsWidget_soundGeneral::OptionsWidget_soundGeneral(), OptionsWidget_textEncoding::OptionsWidget_textEncoding(), parseArgs(), KviKvsParser::parseCommand(), KviIrcServerParser::parseLiteralNotice(), KviIrcServerParser::parseLiteralQuit(), KviUserListView::partAllButOne(), KviSoundPlayer::play(), PopupEditorWidget::popupRefresh(), KviKvsPopupMenu::removeItemByName(), KviMaskEditor::removeMask(), KviKvsEventManager::removeScriptAppHandler(), KviKvsEventManager::removeScriptRawHandler(), KviSharedFilesManager::removeSharedFile(), ClassEditorWidget::renameNamespace(), EventEditor::saveLastEditedItem(), RawEditorWidget::saveLastEditedItem(), PopupEditorWidget::saveLastEditedItem(), OptionsWidget_proxy::saveLastItem(), KviWindow::saveProperties(), KviWindow::savePropertiesAsDefault(), ClassEditorWidget::searchInheritedClasses(), KviIrcConnectionTargetResolver::serverLookupTerminated(), KviConsoleWindow::setAvatar(), KviApplication::setOptionValue(), SetupWizard::SetupWizard(), snd_kvs_cmd_autodetect(), OptionsWidget_soundGeneral::soundFillBox(), KviHttpRequest::start(), str_kvs_fnc_equal(), KviIrcView::triggerMouseRelatedKvsEvents(), KviUserListView::userActionVerifyMask(), and window_kvs_fnc_list().

KVILIB_API bool KviQString::equalCI ( const QString &  sz1,
const QChar *  pC2 
)

Compares two strings with case insensitive.

It returns true if the strings are equal, false otherwise. The parameter pC2 is assumed to be null terminated here!

Parameters
sz1First string
pC2Second string
Returns
bool
KVILIB_API bool KviQString::equalCI ( const QString &  sz1,
const char *  pc2 
)

Compares two strings with case insensitive.

It returns true if the strings are equal, false otherwise

Parameters
sz1First string
pc2Second string
Returns
bool
KVILIB_API bool KviQString::equalCIN ( const QString &  sz1,
const QString &  sz2,
unsigned int  uLen 
)
KVILIB_API bool KviQString::equalCIN ( const QString &  sz1,
const char *  pc2,
unsigned int  uLen 
)

Compares two strings with case insensitive up to N chars.

It returns true if the strings are equal, false otherwise

Parameters
sz1First string
pc2Second string
uLenThe length of the string to check
Returns
bool
KVILIB_API bool KviQString::equalCIN ( const QString &  sz1,
const QChar *  pC2,
unsigned int  uLen 
)

Compares two strings with case insensitive up to N chars.

It returns true if the strings are equal, false otherwise pC2 is assumed to be null terminated here!

Parameters
sz1First string
pC2Second string
uLenThe length of the string to check
Returns
bool
KVILIB_API bool KviQString::equalCS ( const QString &  sz1,
const QString &  sz2 
)
KVILIB_API bool KviQString::equalCS ( const QString &  sz1,
const char *  pc2 
)

Compares two strings with case sensitive.

It returns true if the strings are equal, false otherwise

Parameters
sz1First string
pc2Second string
Returns
bool
KVILIB_API bool KviQString::equalCSN ( const QString &  sz1,
const QString &  sz2,
unsigned int  uLen 
)

Compares two strings with case sensitive up to N chars.

It returns true if the strings are equal, false otherwise

Parameters
sz1First string
sz2Second string
uLenThe length of the string to check
Returns
bool

References MY_MIN.

Referenced by KviApplication::completeDirectory(), and KviRegisteredUserDataBase::load().

KVILIB_API bool KviQString::equalCSN ( const QString &  sz1,
const char *  pc2,
unsigned int  uLen 
)

Compares two strings with case sensitive up to N chars.

It returns true if the strings are equal, false otherwise

Parameters
sz1First string
pc2Second string
uLenThe length of the string to check
Returns
bool
KVILIB_API void KviQString::escapeKvs ( QString *  szData,
uint  uFlags = 0 
)
KVILIB_API QString KviQString::getToken ( QString &  szSrc,
const QChar &  sep 
)

Returns a token from a string.

Parameters
szSrcThe source string
sepThe token to find
Returns
QString

References i.

Referenced by KviFileUtils::makeDir().

KVILIB_API 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.

If the char is not found, the string is returned as it is.

Parameters
szSrcThe source string
cThe char to search for
bIncludedWheter to include the given char in the returned string
bReturnFullStringIfNotFoundTrue if we want the function to return the whole string if the char isn't found and false if we want the function to return an empty string in this case.
Returns
void
KVILIB_API 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.

If the char is not found, the string is returned as it is.

Parameters
szSrcThe source string
szFindThe string to search for
bIncludedWheter to include the given string in the returned string
bReturnFullStringIfNotFoundTrue if we want the function to return the whole string if the string isn't found and false if we want the function to return an empty string in this case.
Returns
void
KVILIB_API 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.

If the char is not found, the string is returned as it is.

Parameters
szSrcThe source string
cThe char to search for
bIncludedWheter to include the given char in the returned string
bReturnFullStringIfNotFoundTrue if we want the function to return the whole string if the char isn't found and false if we want the function to return an empty string in this case.
Returns
void

Referenced by KviRegisteredChannelDataBase::load().

KVILIB_API 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.

If the char is not found, the string is returned as it is.

Parameters
szSrcThe source string
szFindThe string to search for
bIncludedWheter to include the given string in the returned string
bReturnFullStringIfNotFoundTrue if we want the function to return the whole string if the string isn't found and false if we want the function to return an empty string in this case.
Returns
void
KVILIB_API QString KviQString::lowerISO88591 ( const QString &  szSrc)

Returns an ISO-8859-1 lower case string.

Parameters
szSrcThe source string
Returns
QString

References KviMemory::allocate(), KviMemory::free(), and iso88591_toLower_map.

Referenced by str_kvs_fnc_lowcase().

KVILIB_API QString KviQString::makeSizeReadable ( quint64  size)

Returns a readable size in byte's multiples.

This will return strings like KiB, MiB, GiB, TiB and so on

Parameters
sizeThe size of the file
Returns
QString

References __tr2qs.

Referenced by HttpFileTransfer::displayPaint(), DccFileTransfer::displayPaint(), KviIOGraphWidget::paintEvent(), DccBroker::recvFileManage(), DccBroker::renameOverwriteResume(), and FileTransferWindow::rightButtonPressed().

KVILIB_API 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.

Parameters
szExpThe regular expression to match
szStrThe source string
bIsRegExpWheter to use a wildcard or regexp matching
bExactWheter to match the whole string
bCsWheter to match with case sensitive
Returns
bool

Referenced by chan_kvs_fnc_matchban(), chan_kvs_fnc_matchbanexception(), chan_kvs_fnc_matchinvite(), chan_kvs_fnc_matchmask(), chan_kvs_fnc_matchqban(), LogViewWindow::filterNext(), KviIdentityProfileSet::findName(), KviIdentityProfileSet::findNetwork(), KviNickServRuleSet::matchRule(), and str_kvs_fnc_match().

KVILIB_API bool KviQString::matchWildExpressions ( const QString &  szM1,
const QString &  szM2 
)

Matches two strings containging wildcards (* and ?)

Parameters
szM1The first string to match
szM2The second string to match
Returns
bool

Referenced by KviRegisteredChannelDataBase::find(), KviIrcMask::matches(), and regchan_kvs_fnc_list().

KVILIB_API void KviQString::stripLeft ( QString &  szSrc,
const QChar &  c 
)

Trims all c chars at the start of the given string.

Parameters
szSrcThe source string
cThe char to trim
Returns
void

Referenced by KviFileUtils::makeDir().

KVILIB_API void KviQString::stripRight ( QString &  szSrc,
const QChar &  c 
)

Trims all c chars at the end of the given string.

Parameters
szSrcThe source string
cThe char to trim
Returns
void

References c.

KVILIB_API void KviQString::stripRightWhiteSpace ( QString &  szSrc)

Trims all the whitespaces at the end of the given string.

Parameters
szSrcThe source string
Returns
void

Referenced by KviCommandFormatter::blockFromBuffer().

KVILIB_API QString KviQString::toHtmlEscaped ( QString  szData)
kvi_i64_t KviQString::toI64 ( QString &  szNumber,
bool *  bOk 
)
inline

Return the string converted to a long.

Parameters
szNumberThe source number
bOkThe conversion error handling
Returns
kvi_i64_t

Referenced by KviKvsVariant::asBoolean(), KviKvsVariant::asInteger(), and KviKvsVariant::castToInteger().

kvi_u64_t KviQString::toU64 ( QString &  szNumber,
bool *  bOk 
)
inline

Return the string converted to an unsigned long.

Parameters
szNumberThe source number
bOkThe conversion error handling
Returns
kvi_u64_t
KVILIB_API void KviQString::transliterate ( QString &  szSrc,
const QString &  szToFind,
const QString &  szReplacement 
)

Replaces a string with another.

Parameters
szSrcThe source string
szToFindThe string to replace
szReplacementThe string to replace with
Returns
void

References i, k, and MY_MIN.

Referenced by KviKvsTreeNodeOperationStringTransliteration::execute().

KVILIB_API QString KviQString::upperISO88591 ( const QString &  szSrc)

Returns an ISO-8859-1 upper case string.

Parameters
szSrcThe source string
Returns
QString

References KviMemory::allocate(), KviMemory::free(), and iso88591_toUpper_map.

Referenced by KviIrcServerParser::parseCtcpReply(), KviIrcServerParser::parseCtcpRequest(), and str_kvs_fnc_upcase().

KVILIB_API void KviQString::vsprintf ( QString &  szSrc,
const QString &  szFmt,
kvi_va_list  list 
)

Writes to the character string.

Parameters
szSrcThe source string
szFmtThe format string
listThe list of format parameters
Returns
void

References KviMemory::allocate(), KviMemory::free(), INCREMENT_MEM, INCREMENT_MEM_BY, kvi_va_arg, KviCString::len(), MEMINCREMENT, p, and KviCString::ptr().

Referenced by appendFormatted(), KviMessageBox::information(), KviWindow::output(), KviKvsParser::report(), KviKvsRunTimeContext::report(), KviMessageBox::warning(), and KviMessageBox::yesNo().

Variable Documentation

char KviQString::cHexDigits[16] = { '0', '1', '2', '3', '4', '5', '6', '7', '8', '9', 'a', 'b', 'c', 'd', 'e', 'f' }
static

Referenced by bufferToHex().

KVILIB_API const QString KviQString::Empty