#include <qcstring.h>
Classes | |
struct | LongStringRep |
struct | LSData |
struct | LSHeader |
struct | ShortStringRep |
class | StringRep |
Public Member Functions | |
QCString () | |
~QCString () | |
QCString (const QCString &s) | |
QCString (int size) | |
QCString (const char *str) | |
QCString (const char *str, uint maxlen) | |
QCString & | operator= (const QCString &s) |
QCString & | operator= (const char *str) |
bool | isNull () const |
bool | isEmpty () const |
uint | length () const |
uint | size () const |
const char * | data () const |
char * | rawData () const |
bool | resize (uint newlen) |
bool | truncate (uint pos) |
bool | fill (char c, int len=-1) |
QCString | copy () const |
QCString & | sprintf (const char *format,...) |
int | find (char c, int index=0, bool cs=TRUE) const |
int | find (const char *str, int index=0, bool cs=TRUE) const |
int | find (const QCString &str, int index=0, bool cs=TRUE) const |
int | find (const QRegExp &rx, int index=0) const |
int | findRev (char c, int index=-1, bool cs=TRUE) const |
int | findRev (const char *str, int index=-1, bool cs=TRUE) const |
int | findRev (const QRegExp &rx, int index=-1) const |
int | contains (char c, bool cs=TRUE) const |
int | contains (const char *str, bool cs=TRUE) const |
int | contains (const QRegExp &rx) const |
bool | stripPrefix (const char *prefix) |
QCString | left (uint len) const |
QCString | right (uint len) const |
QCString | mid (uint index, uint len=0xffffffff) const |
QCString | lower () const |
QCString | upper () const |
QCString | stripWhiteSpace () const |
QCString | simplifyWhiteSpace () const |
QCString & | assign (const char *str) |
QCString & | insert (uint index, const char *s) |
QCString & | insert (uint index, char c) |
QCString & | append (const char *s) |
QCString & | prepend (const char *s) |
QCString & | remove (uint index, uint len) |
QCString & | replace (uint index, uint len, const char *s) |
QCString & | replace (const QRegExp &rx, const char *str) |
short | toShort (bool *ok=0) const |
ushort | toUShort (bool *ok=0) const |
int | toInt (bool *ok=0) const |
uint | toUInt (bool *ok=0) const |
long | toLong (bool *ok=0) const |
ulong | toULong (bool *ok=0) const |
uint64 | toUInt64 (bool *ok=0) const |
QCString & | setNum (short n) |
QCString & | setNum (ushort n) |
QCString & | setNum (int n) |
QCString & | setNum (uint n) |
QCString & | setNum (long n) |
QCString & | setNum (ulong n) |
operator const char * () const | |
QCString & | operator+= (const char *str) |
QCString & | operator+= (char c) |
char & | at (uint i) const |
char & | operator[] (int i) const |
Private Attributes | |
StringRep | m_rep |
This is an alternative implementation of QCString. It provides basically the same functions but uses reference counting and copy on write.
Definition at line 131 of file qcstring.h.
|
inline |
creates an empty string
Definition at line 135 of file qcstring.h.
|
inline |
|
inline |
makes a copy of a string.
Definition at line 145 of file qcstring.h.
|
inlineexplicit |
creates a string with room for size characters
[in] | size | the number of character to allocate (including the 0-terminator) |
Definition at line 152 of file qcstring.h.
|
inline |
|
inline |
creates a string from str and copies over the first maxlen characters.
Definition at line 164 of file qcstring.h.
QCString & QCString::append | ( | const char * | s | ) |
Definition at line 383 of file qcstring.cpp.
QCString & QCString::assign | ( | const char * | str | ) |
Definition at line 350 of file qcstring.cpp.
|
inline |
Definition at line 153 of file qcstring.cpp.
Definition at line 174 of file qcstring.cpp.
int QCString::contains | ( | const QRegExp & | rx | ) | const |
Definition at line 195 of file qcstring.cpp.
|
inline |
Returns a deep copy of the string.
Definition at line 250 of file qcstring.h.
|
inline |
Returns a pointer to the contents of the string in the form of a 0-terminated C string
Definition at line 207 of file qcstring.h.
|
inline |
Fills a string with a predefined character
[in] | c | the character used to fill the string with. |
[in] | len | the number of character to fill. Use -1 to fill the whole string. |
Definition at line 243 of file qcstring.h.
Definition at line 41 of file qcstring.cpp.
Definition at line 59 of file qcstring.cpp.
Definition at line 84 of file qcstring.cpp.
int QCString::find | ( | const QRegExp & | rx, |
int | index = 0 |
||
) | const |
Definition at line 89 of file qcstring.cpp.
Definition at line 95 of file qcstring.cpp.
Definition at line 127 of file qcstring.cpp.
int QCString::findRev | ( | const QRegExp & | rx, |
int | index = -1 |
||
) | const |
Definition at line 147 of file qcstring.cpp.
Definition at line 355 of file qcstring.cpp.
Definition at line 376 of file qcstring.cpp.
|
inline |
|
inline |
Returns TRUE iff the string is empty. Equivalent to isEmpty().
Definition at line 183 of file qcstring.h.
Definition at line 213 of file qcstring.cpp.
|
inline |
Returns the length of the string, excluding the 0-terminator. Equivalent to size().
Definition at line 195 of file qcstring.h.
QCString QCString::lower | ( | ) | const |
Definition at line 263 of file qcstring.cpp.
Definition at line 246 of file qcstring.cpp.
|
inline |
|
inline |
Appends string str to this string and returns a reference to the result.
Definition at line 306 of file qcstring.h.
|
inline |
Appends character c to this string and returns a reference to the result.
Definition at line 317 of file qcstring.h.
|
inline |
|
inline |
QCString & QCString::prepend | ( | const char * | s | ) |
Definition at line 387 of file qcstring.cpp.
|
inline |
Returns a writable pointer to the data.
Definition at line 216 of file qcstring.h.
Definition at line 391 of file qcstring.cpp.
Definition at line 411 of file qcstring.cpp.
Definition at line 418 of file qcstring.cpp.
Resizes the string to hold newlen characters (this value should include the 0-terminator). If the string is enlarged the contents will be left unmodified.
Definition at line 225 of file qcstring.h.
Definition at line 231 of file qcstring.cpp.
QCString & QCString::setNum | ( | short | n | ) |
Definition at line 469 of file qcstring.cpp.
Definition at line 474 of file qcstring.cpp.
QCString & QCString::setNum | ( | int | n | ) |
Definition at line 479 of file qcstring.cpp.
Definition at line 484 of file qcstring.cpp.
QCString & QCString::setNum | ( | long | n | ) |
Definition at line 489 of file qcstring.cpp.
Definition at line 514 of file qcstring.cpp.
QCString QCString::simplifyWhiteSpace | ( | ) | const |
Definition at line 323 of file qcstring.cpp.
|
inline |
Returns the length of the string, excluding the 0-terminator.
Definition at line 201 of file qcstring.h.
QCString & QCString::sprintf | ( | const char * | format, |
... | |||
) |
Definition at line 27 of file qcstring.cpp.
bool QCString::stripPrefix | ( | const char * | prefix | ) |
Definition at line 201 of file qcstring.cpp.
QCString QCString::stripWhiteSpace | ( | ) | const |
Definition at line 295 of file qcstring.cpp.
int QCString::toInt | ( | bool * | ok = 0 | ) | const |
Definition at line 439 of file qcstring.cpp.
long QCString::toLong | ( | bool * | ok = 0 | ) | const |
Definition at line 451 of file qcstring.cpp.
short QCString::toShort | ( | bool * | ok = 0 | ) | const |
Definition at line 427 of file qcstring.cpp.
Definition at line 445 of file qcstring.cpp.
Definition at line 463 of file qcstring.cpp.
Definition at line 457 of file qcstring.cpp.
Definition at line 433 of file qcstring.cpp.
QCString QCString::upper | ( | ) | const |
Definition at line 279 of file qcstring.cpp.
|
private |
Definition at line 695 of file qcstring.h.