string.cpp File Reference

Common string manipulation functions. More...

#include "string.h"

Go to the source code of this file.

Functions

QStringList char_array_to_stringlist (char **arr, int len)
bool err (QString *str, QString errmsg)
QString ensure_valid_chars (QString str, QString validChars)
QString scrub_email_addr (QString email)
QString string_wrap (QString str, int width, QString sep, QString le)


Detailed Description

Common string manipulation functions.

Version:
Id
string.cpp 1256 2006-10-01 23:40:24Z edmanm

Definition in file string.cpp.


Function Documentation

QStringList char_array_to_stringlist ( char **  arr,
int  len 
)

Create a QStringList from the array of C-style strings.

Definition at line 33 of file string.cpp.

References i().

Referenced by main().

QString ensure_valid_chars ( QString  str,
QString  validChars 
)

Ensures all characters in str are in validChars. If a character appears in str but not in validChars, it will be removed and the resulting string returned.

Definition at line 58 of file string.cpp.

References i().

Referenced by ServerSettings::getNickname(), and NicknameValidator::validate().

bool err ( QString *  str,
QString  errmsg 
)

Conditionally assigns errmsg to str if str is not null and returns false. This is a seemingly pointless function, but it saves some messiness in methods whose QString *errmsg parameter is optional.

Definition at line 46 of file string.cpp.

Referenced by ControlSocket::connect(), ControlSocket::disconnect(), GeoIpCache::loadFromDisk(), LogFile::open(), ControlSocket::readLine(), ControlSocket::readLineData(), ControlSocket::readReply(), GeoIpCache::saveToDisk(), ControlConnection::send(), ControlSocket::sendCommand(), touch_file(), and write_pidfile().

QString scrub_email_addr ( QString  email  ) 

Scrubs an email address by replacing "@" with " at " and "." with " dot ".

Definition at line 72 of file string.cpp.

Referenced by ServerSettings::confValues().

QString string_wrap ( QString  str,
int  width,
QString  sep,
QString  le 
)

Wraps str at width characters wide, using sep as the word separator (" ", for example), and placing the line ending le at the end of each line, except the last.

Definition at line 84 of file string.cpp.

Referenced by LogTreeItem::setMessage().


Generated on Mon Oct 23 20:08:16 2006 for Vidalia by  doxygen 1.5.0