KVIrc  4.9.2
DeveloperAPIs
Public Types | Public Member Functions | Static Public Member Functions | Public Attributes | List of all members
KviCString Class Reference

#include <KviCString.h>

+ Inheritance diagram for KviCString:

Public Types

enum  KviFormatConstructorTag { Format, Sprintf }
 

Public Member Functions

void append (const KviCString &str)
 
void append (const QString &str)
 
void append (char c)
 
void append (const char *str)
 
void append (const char *str, int len)
 
void append (KviFormatConstructorTag dummy, const char *fmt,...)
 
char & at (int idx) const
 
int base64ToBuffer (char **buffer, bool bNullToNewlines=false)
 
void bufferToBase64 (const char *buffer, int len)
 
void bufferToHex (const char *buffer, int len)
 
void clear ()
 
bool contains (const char *str, bool caseS=true) const
 
bool contains (char c, bool caseS=true) const
 
KviCStringcut (int idx, int len)
 
KviCStringcutFromFirst (char c, bool bIncluded=true)
 
KviCStringcutFromFirst (const char *c, bool bIncluded=true)
 
KviCStringcutFromLast (char c, bool bIncluded=true)
 
KviCStringcutFromLast (const char *c, bool bIncluded=true)
 
KviCStringcutLeft (int len)
 
KviCStringcutRight (int len)
 
KviCStringcutToFirst (char c, bool bIncluded=true)
 
KviCStringcutToFirst (const char *c, bool bIncluded=true)
 
KviCStringcutToLast (char c, bool bIncluded=true)
 
KviCStringcutToLast (const char *c, bool bIncluded=true)
 
void ensureLastCharIs (char ch)
 
bool equalsCI (const KviCString &other) const
 
bool equalsCI (const char *other) const
 
bool equalsCIN (const char *other, int len) const
 
bool equalsCS (const KviCString &other) const
 
bool equalsCS (const char *other) const
 
bool equalsCSN (const char *other, int len) const
 
void extractFromString (const char *begin, const char *end)
 
int find (char c, int startIdx) const
 
int find (const char *str, int startIdx, bool caseS=true) const
 
int findFirstIdx (char c) const
 
int findFirstIdx (const char *str, bool caseS=true) const
 
int findLastIdx (char c) const
 
int findLastIdx (const char *str, bool caseS=true) const
 
int findRev (const char *str, int startIdx, bool caseS=true) const
 
bool firstCharIs (char ch) const
 
bool getLine (KviCString &str)
 
bool getToken (KviCString &str, char sep)
 
KviCString getToken (char sep)
 
bool hasData () const
 
bool hasNonWhiteSpaceData () const
 
KviCStringhexDecode (const char *pFrom)
 
KviCStringhexDecode ()
 
KviCStringhexEncodeWhiteSpace ()
 
KviCStringhexEncodeWithTable (const unsigned char table[256])
 
int hexToBuffer (char **buffer, bool bNullToNewlines=false)
 
KviCStringinsert (int idx, const char *data)
 
KviCStringinsert (int idx, char c)
 
bool isEmpty () const
 
bool isNum () const
 
bool isUnsignedNum () const
 
void joinFromArray (KviCString **strings, const char *sep=0, bool bLastSep=false)
 
 KviCString ()
 
 KviCString (const char *str)
 
 KviCString (const char *str, int len)
 
 KviCString (const char *bg, const char *end)
 
 KviCString (KviFormatConstructorTag tag, const char *fmt,...)
 
 KviCString (const KviCString &str)
 
 KviCString (const QString &str)
 
 KviCString (const QByteArray &str)
 
 KviCString (char c, int fillLen=1)
 
 KviCString (const kvi_wchar_t *unicode)
 
 KviCString (const kvi_wchar_t *unicode, int len)
 
bool lastCharIs (char ch) const
 
KviCString left (int maxLen) const
 
KviCString leftToFirst (char c, bool bIncluded=false) const
 
KviCString leftToLast (char c, bool bIncluded=false) const
 
int len () const
 
KviCString lower () const
 
KviCString lowerISO88591 () const
 
KviCString middle (int idx, int maxLen) const
 
int occurrences (const char *str, bool caseS=true) const
 
int occurrences (char c, bool caseS=true) const
 
 operator const char * () const
 
KviCStringoperator+= (const KviCString &str)
 
KviCStringoperator+= (const char *str)
 
KviCStringoperator+= (char c)
 
KviCStringoperator+= (const QString &str)
 
KviCStringoperator= (const KviCString &str)
 
KviCStringoperator= (const char *str)
 
KviCStringoperator= (char c)
 
KviCStringoperator= (const QString &str)
 
KviCStringoperator= (const QByteArray &str)
 
KviCStringpadRight (int iLen, const char c= '\0')
 
void prepend (const KviCString &str)
 
void prepend (const char *str)
 
void prepend (const char *str, int len)
 
char * ptr () const
 
KviCStringreplaceAll (const char c, const char *str)
 
KviCStringreplaceAll (const char *toFind, const char *str, bool bCaseS=true)
 
KviCString right (int maxLen) const
 
KviCStringsetLen (int len)
 
KviCStringsetNum (long num)
 
KviCStringsetNum (unsigned long num)
 
KviCStringsetNum (int num)
 
KviCStringsetNum (unsigned int num)
 
KviCStringsetNum (short num)
 
KviCStringsetNum (unsigned short num)
 
KviCStringsetNum (char num)
 
KviCStringsetNum (unsigned char num)
 
KviCStringsetStr (const char *str, int len=-1)
 
KviCString ** splitToArray (char sep, int max, int *realCount) const
 
KviCStringsprintf (const char *fmt,...)
 
KviCStringstripLeft (char c)
 
KviCStringstripLeftWhiteSpace ()
 
KviCStringstripRight (char c)
 
KviCStringstripRightWhiteSpace ()
 
KviCStringstripSpace ()
 
char toChar (bool *bOk=0) const
 
int toInt (bool *bOk=0) const
 
long toLong (bool *bOk=0) const
 
long toLongExt (bool *bOk=0, int base=0)
 
long long toLongLong (bool *bOk=0) const
 
void toLower ()
 
void toLowerISO88591 ()
 
short toShort (bool *bOk=0) const
 
unsigned char toUChar (bool *bOk=0) const
 
unsigned int toUInt (bool *bOk=0) const
 
unsigned long toULong (bool *bOk=0) const
 
unsigned long long toULongLong (bool *bOk=0) const
 
void toUpper ()
 
void toUpperISO88591 ()
 
unsigned short toUShort (bool *bOk=0) const
 
KviCStringtransliterate (const char *szToFind, const char *szReplacement)
 
KviCStringtrim ()
 
KviCString upper () const
 
KviCString upperISO88591 () const
 
KviCStringvsprintf (const char *fmt, kvi_va_list list)
 
 ~KviCString ()
 

Static Public Member Functions

static KviCStringemptyString ()
 
static bool ext_contains (const char *data, const char *item, bool caseS=true)
 
static void freeArray (KviCString **strings)
 
static void freeBuffer (char *buffer)
 

Public Attributes

int m_len
 
char * m_ptr
 

Member Enumeration Documentation

Enumerator
Format 
Sprintf 

Constructor & Destructor Documentation

KviCString::KviCString ( )
KviCString::KviCString ( const char *  str)
KviCString::KviCString ( const char *  str,
int  len 
)
KviCString::KviCString ( const char *  bg,
const char *  end 
)
KviCString::KviCString ( KviFormatConstructorTag  tag,
const char *  fmt,
  ... 
)
KviCString::KviCString ( const KviCString str)
KviCString::KviCString ( const QString &  str)
KviCString::KviCString ( const QByteArray &  str)
KviCString::KviCString ( char  c,
int  fillLen = 1 
)
KviCString::KviCString ( const kvi_wchar_t unicode)
KviCString::KviCString ( const kvi_wchar_t unicode,
int  len 
)

References KviMemory::allocate(), len(), m_len, m_ptr, and p.

KviCString::~KviCString ( )

References KviMemory::free(), and m_ptr.

Member Function Documentation

void KviCString::append ( const KviCString str)
void KviCString::append ( const QString &  str)
void KviCString::append ( char  c)

References m_len, m_ptr, and KviMemory::reallocate().

void KviCString::append ( const char *  str)
void KviCString::append ( const char *  str,
int  len 
)
void KviCString::append ( KviFormatConstructorTag  dummy,
const char *  fmt,
  ... 
)
char& KviCString::at ( int  idx) const
inline
int KviCString::base64ToBuffer ( char **  buffer,
bool  bNullToNewlines = false 
)
void KviCString::bufferToBase64 ( const char *  buffer,
int  len 
)
void KviCString::bufferToHex ( const char *  buffer,
int  len 
)
void KviCString::clear ( )
bool KviCString::contains ( const char *  str,
bool  caseS = true 
) const
bool KviCString::contains ( char  c,
bool  caseS = true 
) const

References m_ptr, and p.

KviCString & KviCString::cut ( int  idx,
int  len 
)
KviCString & KviCString::cutFromFirst ( char  c,
bool  bIncluded = true 
)
KviCString & KviCString::cutFromFirst ( const char *  c,
bool  bIncluded = true 
)

References cutRight(), findFirstIdx(), len(), and m_len.

KviCString & KviCString::cutFromLast ( char  c,
bool  bIncluded = true 
)

References cutRight(), findLastIdx(), and m_len.

KviCString & KviCString::cutFromLast ( const char *  c,
bool  bIncluded = true 
)

References cutRight(), findLastIdx(), len(), and m_len.

KviCString & KviCString::cutLeft ( int  len)
KviCString & KviCString::cutRight ( int  len)
KviCString & KviCString::cutToFirst ( char  c,
bool  bIncluded = true 
)
KviCString & KviCString::cutToFirst ( const char *  c,
bool  bIncluded = true 
)

References cutLeft(), findFirstIdx(), and len().

KviCString & KviCString::cutToLast ( char  c,
bool  bIncluded = true 
)
KviCString & KviCString::cutToLast ( const char *  c,
bool  bIncluded = true 
)

References cutLeft(), findLastIdx(), and len().

KviCString & KviCString::emptyString ( )
static
void KviCString::ensureLastCharIs ( char  ch)
inline
bool KviCString::equalsCI ( const KviCString other) const
inline
bool KviCString::equalsCI ( const char *  other) const
inline

References kvi_strEqualCI().

bool KviCString::equalsCIN ( const char *  other,
int  len 
) const
inline

References kvi_strEqualCIN().

bool KviCString::equalsCS ( const KviCString other) const
inline

References kvi_strEqualCS(), m_len, and m_ptr.

bool KviCString::equalsCS ( const char *  other) const
inline

References kvi_strEqualCS().

bool KviCString::equalsCSN ( const char *  other,
int  len 
) const
inline

References kvi_strEqualCSN().

bool KviCString::ext_contains ( const char *  data,
const char *  item,
bool  caseS = true 
)
static
void KviCString::extractFromString ( const char *  begin,
const char *  end 
)
int KviCString::find ( char  c,
int  startIdx 
) const

References m_len, m_ptr, and p.

int KviCString::find ( const char *  str,
int  startIdx,
bool  caseS = true 
) const
int KviCString::findFirstIdx ( char  c) const
int KviCString::findFirstIdx ( const char *  str,
bool  caseS = true 
) const
int KviCString::findLastIdx ( char  c) const
int KviCString::findLastIdx ( const char *  str,
bool  caseS = true 
) const
int KviCString::findRev ( const char *  str,
int  startIdx,
bool  caseS = true 
) const
bool KviCString::firstCharIs ( char  ch) const
inline
void KviCString::freeArray ( KviCString **  strings)
static
void KviCString::freeBuffer ( char *  buffer)
static

References KviMemory::free().

Referenced by KviKvsCoreFunctions::KVSCF().

bool KviCString::getLine ( KviCString str)
bool KviCString::getToken ( KviCString str,
char  sep 
)
KviCString KviCString::getToken ( char  sep)

References cutLeft(), m_ptr, and p.

bool KviCString::hasData ( ) const
inline
bool KviCString::hasNonWhiteSpaceData ( ) const

References m_ptr.

KviCString & KviCString::hexDecode ( const char *  pFrom)
KviCString& KviCString::hexDecode ( )
inline

References hexDecode().

Referenced by hexDecode().

KviCString & KviCString::hexEncodeWhiteSpace ( )
KviCString & KviCString::hexEncodeWithTable ( const unsigned char  table[256])
int KviCString::hexToBuffer ( char **  buffer,
bool  bNullToNewlines = false 
)
KviCString & KviCString::insert ( int  idx,
const char *  data 
)
KviCString & KviCString::insert ( int  idx,
char  c 
)
bool KviCString::isEmpty ( ) const
inline
bool KviCString::isNum ( ) const

References m_ptr, and p.

bool KviCString::isUnsignedNum ( ) const
void KviCString::joinFromArray ( KviCString **  strings,
const char *  sep = 0,
bool  bLastSep = false 
)
bool KviCString::lastCharIs ( char  ch) const
inline
KviCString KviCString::left ( int  maxLen) const
KviCString KviCString::leftToFirst ( char  c,
bool  bIncluded = false 
) const

References findFirstIdx(), KviCString(), and m_ptr.

Referenced by system_kvs_fnc_dbus().

KviCString KviCString::leftToLast ( char  c,
bool  bIncluded = false 
) const

References findLastIdx(), KviCString(), and m_ptr.

int KviCString::len ( ) const
inline
KviCString KviCString::lower ( ) const

References toLower().

KviCString KviCString::lowerISO88591 ( ) const

References toLowerISO88591().

KviCString KviCString::middle ( int  idx,
int  maxLen 
) const

References KVI_ASSERT, m_len, and m_ptr.

int KviCString::occurrences ( const char *  str,
bool  caseS = true 
) const
int KviCString::occurrences ( char  c,
bool  caseS = true 
) const

References m_ptr, and p.

KviCString::operator const char * ( ) const
inline
KviCString& KviCString::operator+= ( const KviCString str)
inline
KviCString& KviCString::operator+= ( const char *  str)
inline
KviCString& KviCString::operator+= ( char  c)
inline
KviCString& KviCString::operator+= ( const QString &  str)
inline
KviCString & KviCString::operator= ( const KviCString str)
KviCString & KviCString::operator= ( const char *  str)
KviCString & KviCString::operator= ( char  c)

References c, m_len, m_ptr, and KviMemory::reallocate().

KviCString & KviCString::operator= ( const QString &  str)
KviCString & KviCString::operator= ( const QByteArray &  str)
KviCString & KviCString::padRight ( int  iLen,
const char  c = '\0' 
)
void KviCString::prepend ( const KviCString str)
void KviCString::prepend ( const char *  str)
void KviCString::prepend ( const char *  str,
int  len 
)
char* KviCString::ptr ( ) const
inline

Referenced by KviModuleExtensionManager::allocateExtension(), KviModuleExtensionManager::allocateExtensionGetDescriptorList(), KviCommandFormatter::bufferFromBlock(), KviLocale::codecForName(), OptionsWidget_identityAdvanced::commit(), DccVoiceWindow::connected(), DccVideoWindow::connected(), DccChatWindow::connectionInProgress(), DccVoiceWindow::connectionInProgress(), DccVideoWindow::connectionInProgress(), DccFileTransfer::connectionInProgress(), MediaTypeTreeWidgetItem::copyData(), OptionsWidget_proxy::currentItemChanged(), dcc_kvs_cmd_get(), dcc_module_normalize_target_data(), dcc_module_request_error(), dccModuleCtcpDccParseRoutine(), dccModuleParseDccAccept(), dccModuleParseDccCanvas(), dccModuleParseDccChat(), dccModuleParseDccGet(), dccModuleParseDccRecv(), dccModuleParseDccResume(), dccModuleParseDccRSend(), dccModuleParseDccSend(), dccModuleParseDccVideo(), dccModuleParseDccVoice(), UglyBase64::decode(), KviIrcMessage::decodeAndSplitPrefix(), DccFileTransfer::doResume(), DccMarshal::doSSLHandshake(), UglyBase64::encode(), LinksWindow::endOfLinks(), KviIdentSentinel::event(), DccChatWindow::event(), DccVoiceWindow::event(), DccVideoWindow::event(), DccFileTransfer::event(), DccBroker::executeChat(), IrcServerDetailsWidget::fillData(), KviLocale::findCatalogue(), KviModuleExtensionManager::findExtensionDescriptor(), KviMediaManager::findMediaType(), KviStringConversion::fromString(), KviParameterList::getBool(), KviModuleExtensionManager::getExtensionList(), LinksWindow::getItemByHost(), KviApplication::getLocalKvircDirectory(), KviIrcConnection::handleAuthenticate(), KviIsOnNotifyListManager::handleIsOn(), KviStupidNotifyListManager::handleIsOn(), DccBroker::handleResumeRequest(), KviIsOnNotifyListManager::handleUserhost(), KviIrcConnection::heartbeat(), hexToBuffer(), LinksWindow::hostPopupClicked(), KviIconWidget::init(), LinksWindow::insertLink(), KviApplication::ipcMessage(), kvi_compare(), kvi_hash_hash(), kvi_hash_key_equal(), KviDebugContext::KviDebugContext(), KviIpcSentinel::KviIpcSentinel(), KviIrcMessage::KviIrcMessage(), KviLocale::KviLocale(), KviSockaddr::KviSockaddr(), KviKvsCoreFunctions::KVSCF(), KviLagMeter::lagCheckAbort(), KviLagMeter::lagCheckComplete(), KviProxyDataBase::load(), KviMediaManager::load(), KviMessageCatalogue::load(), KviConfigurationFile::load(), KviInputHistory::load(), KviStatusBar::load(), KviFile::load(), KviStatusBarClock::loadState(), KviStatusBarConnectionTimer::loadState(), KviStatusBarAwayIndicator::loadState(), KviStatusBarUpdateIndicator::loadState(), LogFile::LogFile(), KviIrcConnection::loginComplete(), main(), RegistrationWizard::maskChanged(), DccVoiceCodec::name(), DccVideoCodec::name(), KviMenuBar::newConnectionToServer(), TipWindow::nextTip(), objects_kvs_fnc_listObjects(), RegisteredUserMaskDialog::okClicked(), DccVoiceThread::openSoundcard(), options_kvs_module_print_pages(), DccChatWindow::ownAction(), DccVideoWindow::ownAction(), DccChatWindow::ownMessage(), DccVideoWindow::ownMessage(), KviQueryWindow::ownMessage(), KviChannelWindow::ownMessage(), KviTopicWidget::paintColoredText(), KviColorWindow::paintEvent(), KviIrcServerParser::parseChannelMode(), KviIrcServerParser::parseCtcpReplyLagcheck(), KviIrcServerParser::parseCtcpRequestAction(), KviIrcServerParser::parseCtcpRequestClientinfo(), KviIrcServerParser::parseCtcpRequestDcc(), KviIrcServerParser::parseCtcpRequestFinger(), KviIrcServerParser::parseCtcpRequestPage(), KviIrcServerParser::parseLiteralJoin(), KviIrcServerParser::parseLiteralNotice(), KviIrcServerParser::parseLiteralPrivmsg(), KviIrcServerParser::parseLiteralQuit(), KviIrcServerParser::parseMessage(), KviIrcServerParser::parseNumeric004(), KviIrcServerParser::parseNumeric005(), KviIrcServerParser::parseNumericNames(), KviIrcServerParser::parseNumericWhoReply(), KviConnectToServerAction::popupActivated(), TipWindow::prevTip(), KviHttpRequest::processData(), KviHttpRequest::processHeader(), KviIrcSocket::proxyHandleHttpFinalReply(), KviIrcSocket::proxyLoginHttp(), KviIrcSocket::proxyLoginV4(), KviConfigurationFile::readKviCStringEntry(), KviModuleExtensionManager::registerExtension(), DccBroker::renameDccSendFile(), ListWindow::requestList(), NotifierWindow::returnPressed(), KviIdentDaemon::run(), DccSendThread::run(), DccRecvThread::run(), KviIrcMessage::safeParam(), KviIrcMessage::safePrefix(), KviIrcMessage::safeTrailing(), KviProxyDataBase::save(), KviMediaManager::save(), KviConfigurationFile::save(), KviInputHistory::save(), KviFile::save(), OptionsWidget_messageColors::save(), KviStatusBar::save(), OptionsWidget_proxy::saveLastItem(), KviStatusBarClock::saveState(), KviStatusBarConnectionTimer::saveState(), KviStatusBarAwayIndicator::saveState(), KviStatusBarUpdateIndicator::saveState(), KviConfigurationFile::setFontProperties(), OptionsWidget_mediaTypes::setLineEdits(), LinksWindow::showHostPopup(), KviFile::skipFirst(), KviHttpRequest::slotSocketConnected(), splitToArray(), DccFileTransfer::startConnection(), system_kvs_fnc_dbus(), KviLagMeter::timerEvent(), KviIrcConnectionRequestQueue::timerSlot(), KviIrcContextDisplay::tipRequest(), DccFileTransfer::tipText(), KviChannelWindow::topicSelected(), KviDebugContext::trace(), KviIrcMessage::trailing(), KviMessageCatalogue::translate(), KviMessageCatalogue::translateToQString(), DccVoiceWindow::updateInfo(), KviChannelWindow::updateModeLabel(), KviUserListView::updateUsersLabel(), KviQString::vsprintf(), KviConfigurationFile::writeEntry(), DccDescriptor::zeroPortRequestTag(), and KviDebugContext::~KviDebugContext().

KviCString & KviCString::replaceAll ( const char  c,
const char *  str 
)
KviCString & KviCString::replaceAll ( const char *  toFind,
const char *  str,
bool  bCaseS = true 
)
KviCString KviCString::right ( int  maxLen) const
KviCString & KviCString::setLen ( int  len)
KviCString & KviCString::setNum ( long  num)
KviCString & KviCString::setNum ( unsigned long  num)

References m_len, m_ptr, p, and KviMemory::reallocate().

KviCString& KviCString::setNum ( int  num)
inline

References setNum().

Referenced by setNum().

KviCString& KviCString::setNum ( unsigned int  num)
inline

References setNum().

Referenced by setNum().

KviCString& KviCString::setNum ( short  num)
inline

References setNum().

Referenced by setNum().

KviCString& KviCString::setNum ( unsigned short  num)
inline

References setNum().

Referenced by setNum().

KviCString& KviCString::setNum ( char  num)
inline

References setNum().

Referenced by setNum().

KviCString& KviCString::setNum ( unsigned char  num)
inline

References setNum().

Referenced by setNum().

KviCString & KviCString::setStr ( const char *  str,
int  len = -1 
)
KviCString ** KviCString::splitToArray ( char  sep,
int  max,
int *  realCount 
) const
KviCString & KviCString::sprintf ( const char *  fmt,
  ... 
)
KviCString & KviCString::stripLeft ( char  c)
KviCString & KviCString::stripLeftWhiteSpace ( )
KviCString & KviCString::stripRight ( char  c)
KviCString & KviCString::stripRightWhiteSpace ( )
KviCString & KviCString::stripSpace ( )
char KviCString::toChar ( bool *  bOk = 0) const
inline
int KviCString::toInt ( bool *  bOk = 0) const
inline
long KviCString::toLong ( bool *  bOk = 0) const

References m_ptr, and p.

long KviCString::toLongExt ( bool *  bOk = 0,
int  base = 0 
)

References m_len, and m_ptr.

long long KviCString::toLongLong ( bool *  bOk = 0) const

References m_ptr, and p.

void KviCString::toLower ( )
void KviCString::toLowerISO88591 ( )

References iso88591_toLower_map, m_ptr, and p.

Referenced by lowerISO88591().

short KviCString::toShort ( bool *  bOk = 0) const
inline
unsigned char KviCString::toUChar ( bool *  bOk = 0) const
inline
unsigned int KviCString::toUInt ( bool *  bOk = 0) const
inline
unsigned long KviCString::toULong ( bool *  bOk = 0) const

References m_ptr, and p.

Referenced by dcc_module_normalize_target_data().

unsigned long long KviCString::toULongLong ( bool *  bOk = 0) const

References m_ptr, and p.

Referenced by dccModuleParseDccResume().

void KviCString::toUpper ( )
void KviCString::toUpperISO88591 ( )
unsigned short KviCString::toUShort ( bool *  bOk = 0) const
inline
KviCString & KviCString::transliterate ( const char *  szToFind,
const char *  szReplacement 
)

References m_ptr, and p.

KviCString & KviCString::trim ( )
KviCString KviCString::upper ( ) const

References toUpper().

KviCString KviCString::upperISO88591 ( ) const

References toUpperISO88591().

KviCString & KviCString::vsprintf ( const char *  fmt,
kvi_va_list  list 
)

Member Data Documentation

int KviCString::m_len
char* KviCString::m_ptr

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