KVIrc
4.9.2
DeveloperAPIs
|
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... | |
A namespace for QString helper functions.
This namespace contains several helper functions that are used when dealing with QString.
KVILIB_API void KviQString::appendFormatted | ( | QString & | szSrc, |
QString | szFmt, | ||
... | |||
) |
Appends a formatted string.
szSrc | The source string |
szFmt | The format string |
... | Format string parameters |
References kvi_va_end, kvi_va_list, kvi_va_start, and vsprintf().
Referenced by KviKvsTreeNodeSingleParameterIdentifier::contextDescription(), KviKvsTreeNodeMultipleParameterIdentifier::contextDescription(), KviIrcView::doLinkToolTip(), KviIrcContextDisplay::drawContents(), KviKvsPopupMenu::generateDefPopupCore(), KviIrcConnection::getCommonChannels(), KviApplication::getGlobalKvircDirectory(), KviApplication::getTmpFileName(), KviKvsParameterProcessor::handleParameterTypeError(), KviKvsCoreFunctions::KVSCF(), KviKvsCoreSimpleCommands::KVSCSC(), KviModuleManager::loadModule(), KviConsoleWindow::outputPrivmsg(), parseArgs(), KviIrcServerParser::parseCtcpReplyAvatar(), KviIrcServerParser::parseNumericWhoisChannels(), KviStupidNotifyListManager::sendIsOn(), KviWatchNotifyListManager::start(), KviIrcContextDisplay::tipRequest(), KviStatusBarLagIndicator::tipText(), and KviChannelWindow::updateModeLabel().
KVILIB_API void KviQString::appendNumber | ( | QString & | szSrc, |
double | dReal | ||
) |
Appends the given number to the source string.
szSrc | The source string |
dReal | Number in double format |
Referenced by KviKvsVariant::appendAsString().
KVILIB_API void KviQString::appendNumber | ( | QString & | szSrc, |
int | iInteger | ||
) |
Appends the given number to the source string.
szSrc | The source string |
iInteger | Number in int format |
KVILIB_API void KviQString::appendNumber | ( | QString & | szSrc, |
kvi_i64_t | iInteger | ||
) |
Appends the given number to the source string.
szSrc | The source string |
iInteger | Number in kvi_i64_t format |
KVILIB_API void KviQString::appendNumber | ( | QString & | szSrc, |
kvi_u64_t | uInteger | ||
) |
Appends the given number to the source string.
szSrc | The source string |
uInteger | Number in kvi_i64_t format |
KVILIB_API void KviQString::appendNumber | ( | QString & | szSrc, |
unsigned int | uInteger | ||
) |
Appends the given number to the source string.
szSrc | The source string |
uInteger | Number in unsigned int format |
KVILIB_API void KviQString::bufferToHex | ( | QString & | szRetBuffer, |
const unsigned char * | pcBuffer, | ||
unsigned int | uLen | ||
) |
Returns an hexadecimal converted string starting from a buffer.
szRetBuffer | The buffer to hold the hexadecimal string |
pcBuffer | The buffer containing the string to convert |
uLen | The 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
sz1 | The first string |
sz2 | The second string |
bNonAlphaGreater | Wheter to check if strings are not alphabetics |
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
sz1 | The first string |
sz2 | The second string |
uLen | The number of chars to check |
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.
szSrc | The source string |
c | The char to search for |
bIncluded | Wheter to include the given char |
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.
szSrc | The source string |
szFind | The string to search for |
bIncluded | Wheter to include the given string |
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.
szSrc | The source string |
c | The char to search for |
bIncluded | Wheter to include the given char |
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.
szSrc | The source string |
szFind | The string to search for |
bIncluded | Wheter to include the given string |
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.
szSrc | The source string |
c | The char to search for |
bIncluded | Wheter to include the given char in the cut |
bClearIfNotFound | Wheter to cut the whole string if the char is not found |
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.
szSrc | The source string |
szFind | The string to search for |
bIncluded | Wheter to include the given string in the cut |
bClearIfNotFound | Wheter to cut the whole string if the string is not found |
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.
szSrc | The source string |
c | The char to search for |
bIncluded | Wheter to include the given char in the cut |
bClearIfNotFound | Wheter to cut the whole string if the char is not found |
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.
szSrc | The source string |
szFind | The string to search for |
bIncluded | Wheter to include the given string in the cut |
bClearIfNotFound | Wheter to cut the whole string if the string is not found |
KVILIB_API void KviQString::ensureLastCharIs | ( | QString & | szSrc, |
const QChar & | c | ||
) |
Ensures the last char of a string is the given char.
If the string does not end with the given char, it appends it
szSrc | The source string |
c | The char to check |
Referenced by SetupWizard::accept(), KviPackageWriter::addDirectory(), KviCommandFormatter::blockFromBuffer(), SetupWizard::chooseDataPath(), SetupWizard::chooseOldDataPath(), DccBroker::chooseSaveFileName(), KviApplication::completeDirectory(), LogViewWindow::createLog(), file_kvs_fnc_cwd(), file_kvs_fnc_homedir(), file_kvs_fnc_rootdir(), KviApplication::findAudioFile(), KviLocale::findCatalogue(), KviApplication::findImage(), KviApplication::findImageInImageSearchPath(), KviApplication::findSmallIcon(), KviWindow::getDefaultLogFileName(), KviApplication::getGlobalKvircDirectory(), KviApplication::getLocalKvircDirectory(), KviApplication::getTmpFileName(), PackAddonSaveSelectionWidget::initializePage(), AddonFunctions::installAddonPackage(), KviKvsCoreSimpleCommands::KVSCSC(), SetupWizard::makeLink(), KviApplication::mapImageFile(), PackAddonDialog::packAddon(), package_kvs_fnc_info(), PackThemeDataWidget::parseThemes(), KviThemeInfo::setDirectoryAndLocation(), KviApplication::setupBegin(), SetupWizard::SetupWizard(), and KviPackageReader::unpackFile().
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
sz1 | First string |
sz2 | Second string |
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!
sz1 | First string |
pC2 | Second string |
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
sz1 | First string |
pc2 | Second string |
KVILIB_API bool KviQString::equalCIN | ( | const QString & | sz1, |
const QString & | sz2, | ||
unsigned int | uLen | ||
) |
Compares two strings with case insensitive up to N chars.
It returns true if the strings are equal, false otherwise
sz1 | First string |
sz2 | Second string |
uLen | The length of the string to check |
References MY_MIN.
Referenced by avatar_kvs_cmd_set(), OptionsWidget_identityAvatar::chooseAvatar(), KviConsoleWindow::completeChannel(), KviKvsAliasManager::completeCommand(), KviApplication::completeDirectory(), KviKvsKernel::completeFunction(), KviModuleManager::completeModuleNames(), KviUserListView::completeNickBashLike(), KviConsoleWindow::completeServer(), KviInputEditor::completion(), KviApplication::fileDownloadTerminated(), KviIconManager::getAvatar(), KviAvatar::KviAvatar(), KviKvsCallbackTextInput::KviKvsCallbackTextInput(), KviKvsCoreSimpleCommands::KVSCSC(), KviIrcServerDataBase::makeCurrentServer(), KviIrcServerParser::parseCtcpReplyAvatar(), OptionsDialog::recursiveSearch(), KviApplication::setOptionValue(), KviKvsVariant::unserializeBool(), and KviKvsVariant::unserializeNull().
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
sz1 | First string |
pc2 | Second string |
uLen | The length of the string to check |
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!
sz1 | First string |
pC2 | Second string |
uLen | The length of the string to check |
KVILIB_API bool KviQString::equalCS | ( | const QString & | sz1, |
const QString & | sz2 | ||
) |
Compares two strings with case sensitive.
It returns true if the strings are equal, false otherwise
sz1 | First string |
sz2 | Second string |
Referenced by KviPackageWriter::addDirectory(), KviApplication::completeDirectory(), KviFileUtils::deleteDir(), KviApplication::fillRecentNicknamesPopup(), KviStringConversion::fromString(), KviRegisteredUser::getBoolProperty(), kvi_hash_key_equal(), KviSharedFilesManager::lookupSharedFile(), KviIrcServerParser::parseCtcpReply(), KviIrcServerParser::parseCtcpReplyUserinfo(), KviIrcServerParser::parseCtcpRequest(), KviIrcServerParser::parseNumericWhoisUser(), ClassEditorWidget::renameClass(), ClassEditorWidget::renameFunction(), spaste_kvs_cmd_stop(), str_kvs_fnc_equal(), KviUserListView::userAction(), KviUserListView::userActionVerifyMask(), and KviIrcConnection::userInfoReceived().
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
sz1 | First string |
pc2 | Second string |
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
sz1 | First string |
sz2 | Second string |
uLen | The length of the string to check |
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
sz1 | First string |
pc2 | Second string |
uLen | The length of the string to check |
KVILIB_API void KviQString::escapeKvs | ( | QString * | szData, |
uint | uFlags = 0 |
||
) |
Escapes any kvs special character from a string.
szData | The string to escape |
uFlags | The flag which correspond to the characters to escape |
References EscapeParenthesis, EscapeSpace, PermitFunctions, PermitMultiLine, and PermitVariables.
Referenced by avatar_kvs_cmd_set(), KviChannelWindow::closeEvent(), KviInputEditor::completionEscapeUnsafeToken(), UrlDialog::dblclk_url(), KviInputEditor::dropEvent(), KviWindow::getDefaultLogFileName(), AddonFunctions::installAddonPackage(), ChannelsJoinDialog::joinClicked(), KviKvsVariant::KviKvsVariant(), KviKvsCoreFunctions::KVSCF(), KviKvsCoreSimpleCommands::KVSCSC(), ClassEditorWidget::newClass(), KviAsyncAvatarSelectionDialog::okClicked(), KviUserInput::parseCommand(), KviIrcServerParser::parseCtcpReplyAvatar(), KviInputEditor::pasteFile(), KviChangeUserModeAction::popupActivated(), ChannelsJoinDialog::regClicked(), DccFileTransfer::retryDCC(), DccFileTransfer::retryRevDCC(), DccFileTransfer::retryTDCC(), UrlDialog::sayToWin(), KviIrcContext::terminateConnectionRequest(), and KviIrcConnection::useRealName().
KVILIB_API QString KviQString::getToken | ( | QString & | szSrc, |
const QChar & | sep | ||
) |
Returns a token from a string.
szSrc | The source string |
sep | The token to find |
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.
szSrc | The source string |
c | The char to search for |
bIncluded | Wheter to include the given char in the returned string |
bReturnFullStringIfNotFound | True 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. |
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.
szSrc | The source string |
szFind | The string to search for |
bIncluded | Wheter to include the given string in the returned string |
bReturnFullStringIfNotFound | True 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. |
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.
szSrc | The source string |
c | The char to search for |
bIncluded | Wheter to include the given char in the returned string |
bReturnFullStringIfNotFound | True 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. |
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.
szSrc | The source string |
szFind | The string to search for |
bIncluded | Wheter to include the given string in the returned string |
bReturnFullStringIfNotFound | True 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. |
KVILIB_API QString KviQString::lowerISO88591 | ( | const QString & | szSrc | ) |
Returns an ISO-8859-1 lower case string.
szSrc | The source string |
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
size | The size of the file |
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.
szExp | The regular expression to match |
szStr | The source string |
bIsRegExp | Wheter to use a wildcard or regexp matching |
bExact | Wheter to match the whole string |
bCs | Wheter to match with case sensitive |
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 ?)
szM1 | The first string to match |
szM2 | The second string to match |
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.
szSrc | The source string |
c | The char to trim |
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.
szSrc | The source string |
c | The char to trim |
References c.
KVILIB_API void KviQString::stripRightWhiteSpace | ( | QString & | szSrc | ) |
Trims all the whitespaces at the end of the given string.
szSrc | The source string |
Referenced by KviCommandFormatter::blockFromBuffer().
KVILIB_API QString KviQString::toHtmlEscaped | ( | QString | szData | ) |
Escapes any html special character from a string (wrapper to QString::toHtmlEscaped)
szData | The string to escape |
Referenced by KviTopicWidget::applyOptions(), ChannelTreeWidgetItem::ChannelTreeWidgetItem(), KviHtmlGenerator::convertToHtml(), KviIrcView::doLinkToolTip(), DccChatWindow::event(), DccVideoWindow::event(), KviApplication::fileDownloadTerminated(), KviChannelWindow::getTalkingUsersStats(), KviConsoleWindow::getUserTipText(), KviChannelWindow::getWindowListTipText(), KviConsoleWindow::outputPrivmsg(), KviIrcServerParser::parseCtcpRequestAction(), KviIrcServerParser::parseCtcpRequestPage(), KviIrcServerParser::parseLiteralNotice(), KviIrcServerParser::parseLiteralPrivmsg(), KviTopicWidget::setTopic(), KviChannelWindow::updateModeLabel(), and KviTopicWidget::updateToolTip().
|
inline |
Return the string converted to a long.
szNumber | The source number |
bOk | The conversion error handling |
Referenced by KviKvsVariant::asBoolean(), KviKvsVariant::asInteger(), and KviKvsVariant::castToInteger().
|
inline |
Return the string converted to an unsigned long.
szNumber | The source number |
bOk | The conversion error handling |
KVILIB_API void KviQString::transliterate | ( | QString & | szSrc, |
const QString & | szToFind, | ||
const QString & | szReplacement | ||
) |
Replaces a string with another.
szSrc | The source string |
szToFind | The string to replace |
szReplacement | The string to replace with |
Referenced by KviKvsTreeNodeOperationStringTransliteration::execute().
KVILIB_API QString KviQString::upperISO88591 | ( | const QString & | szSrc | ) |
Returns an ISO-8859-1 upper case string.
szSrc | The source string |
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.
szSrc | The source string |
szFmt | The format string |
list | The list of format parameters |
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().
|
static |
Referenced by bufferToHex().
KVILIB_API const QString KviQString::Empty |
A global empty string (note that this is ALSO NULL under Qt 3.x)
Referenced by KviKvsScriptAddon::configureCallbackCode(), KviDnsResolver::firstHostname(), KviDnsResolver::firstIpAddress(), KviBasicIrcServerInfo::getChannelModeDescription(), KviRegisteredUser::getProperty(), KviBasicIrcServerInfo::getUserModeDescription(), KviKvsScriptAddon::helpCallbackCode(), KviRuntimeInfo::hostname(), kvi_hash_key_default(), KviIrcView::lastLineOfText(), KviWindow::lastLineOfText(), KviIrcView::lastMessageText(), KviWindow::lastMessageText(), KviWindow::loadProperties(), KviWindow::localNick(), KviAvatarCache::lookup(), KviRuntimeInfo::machine(), KviRuntimeInfo::name(), KviRuntimeInfo::nodename(), KviRuntimeInfo::release(), KviWindow::saveProperties(), KviKvsVariant::string(), KviWindow::target(), and KviRuntimeInfo::version().