A QString which uses constant Unicode data. More...
#include <qstring.h>
Public Member Functions | |
QConstString (QChar *unicode, uint length) | |
~QConstString () | |
const QString & | string () const |
Additional Inherited Members | |
Private Member Functions inherited from QString | |
QString () | |
QString (QChar) | |
QString (const QString &) | |
QString (const QByteArray &) | |
QString (const QCString &) | |
QString (const QChar *unicode, uint length) | |
QString (const char *str) | |
~QString () | |
QString & | operator= (const QString &) |
QString & | operator= (const char *) |
QString & | operator= (const QCString &) |
QString & | operator= (QChar c) |
QString & | operator= (char c) |
QString (const Null &) | |
QString & | operator= (const Null &) |
bool | isNull () const |
bool | isEmpty () const |
uint | length () const |
void | truncate (uint pos) |
void | fill (QChar c, int len=-1) |
QString | copy () const |
QString | arg (long a, int fieldwidth=0, int base=10) const |
QString | arg (ulong a, int fieldwidth=0, int base=10) const |
QString | arg (int a, int fieldwidth=0, int base=10) const |
QString | arg (uint a, int fieldwidth=0, int base=10) const |
QString | arg (short a, int fieldwidth=0, int base=10) const |
QString | arg (ushort a, int fieldwidth=0, int base=10) const |
QString | arg (char a, int fieldwidth=0) const |
QString | arg (QChar a, int fieldwidth=0) const |
QString | arg (const QString &a, int fieldwidth=0) const |
QString | arg (double a, int fieldwidth=0, char fmt='g', int prec=-1) const |
QString & | sprintf (const char *format,...) |
int | find (QChar c, int index=0, bool cs=TRUE) const |
int | find (char c, int index=0, bool cs=TRUE) const |
int | find (const QString &str, int index=0, bool cs=TRUE) const |
int | find (const QRegExp &, int index=0) const |
int | find (const char *str, int index=0) const |
int | findRev (QChar c, int index=-1, bool cs=TRUE) const |
int | findRev (char c, int index=-1, bool cs=TRUE) const |
int | findRev (const QString &str, int index=-1, bool cs=TRUE) const |
int | findRev (const QRegExp &, int index=-1) const |
int | findRev (const char *str, int index=-1) const |
int | contains (QChar c, bool cs=TRUE) const |
int | contains (char c, bool cs=TRUE) const |
int | contains (const char *str, bool cs=TRUE) const |
int | contains (const QString &str, bool cs=TRUE) const |
int | contains (const QRegExp &) const |
QString | left (uint len) const |
QString | right (uint len) const |
QString | mid (uint index, uint len=0xffffffff) const |
QString | leftJustify (uint width, QChar fill=' ', bool trunc=FALSE) const |
QString | rightJustify (uint width, QChar fill=' ', bool trunc=FALSE) const |
QString | lower () const |
QString | upper () const |
QString | stripWhiteSpace () const |
QString | simplifyWhiteSpace () const |
QString & | insert (uint index, const QString &) |
QString & | insert (uint index, const QChar *, uint len) |
QString & | insert (uint index, QChar) |
QString & | insert (uint index, char c) |
QString & | append (char) |
QString & | append (QChar) |
QString & | append (const QString &) |
QString & | prepend (char) |
QString & | prepend (QChar) |
QString & | prepend (const QString &) |
QString & | remove (uint index, uint len) |
QString & | replace (uint index, uint len, const QString &) |
QString & | replace (uint index, uint len, const QChar *, uint clen) |
QString & | replace (const QRegExp &, const QString &) |
short | toShort (bool *ok=0, int base=10) const |
ushort | toUShort (bool *ok=0, int base=10) const |
int | toInt (bool *ok=0, int base=10) const |
uint | toUInt (bool *ok=0, int base=10) const |
long | toLong (bool *ok=0, int base=10) const |
ulong | toULong (bool *ok=0, int base=10) const |
uint64 | toUInt64 (bool *ok=0, int base=10) const |
float | toFloat (bool *ok=0) const |
double | toDouble (bool *ok=0) const |
QString & | setNum (short, int base=10) |
QString & | setNum (ushort, int base=10) |
QString & | setNum (int, int base=10) |
QString & | setNum (uint, int base=10) |
QString & | setNum (long, int base=10) |
QString & | setNum (ulong, int base=10) |
QString & | setNum (float, char f='g', int prec=6) |
QString & | setNum (double, char f='g', int prec=6) |
void | setExpand (uint index, QChar c) |
QString & | operator+= (const QString &str) |
QString & | operator+= (QChar c) |
QString & | operator+= (char c) |
QChar | at (uint i) const |
QChar | operator[] (int i) const |
QCharRef | at (uint i) |
QCharRef | operator[] (int i) |
QChar | constref (uint i) const |
QChar & | ref (uint i) |
const QChar * | unicode () const |
const char * | ascii () const |
const char * | latin1 () const |
const unsigned short * | ucs2 () const |
QCString | utf8 () const |
QCString | local8Bit () const |
bool | operator! () const |
QString & | setUnicode (const QChar *unicode, uint len) |
QString & | setUnicodeCodes (const ushort *unicode_as_ushorts, uint len) |
QString & | setLatin1 (const char *, int len=-1) |
int | compare (const QString &s) const |
void | compose () |
QChar::Direction | basicDirection () |
QString | visual (int index=0, int len=-1) |
const char * | data () const |
bool | startsWith (const QString &) const |
Static Private Member Functions inherited from QString | |
static QString | number (long, int base=10) |
static QString | number (ulong, int base=10) |
static QString | number (int, int base=10) |
static QString | number (uint, int base=10) |
static QString | number (double, char f='g', int prec=6) |
static QString | fromLatin1 (const char *, int len=-1) |
static QString | fromUcs2 (const unsigned short *ucs2) |
static QString | fromUtf8 (const char *, int len=-1) |
static QString | fromLocal8Bit (const char *, int len=-1) |
static int | compare (const QString &s1, const QString &s2) |
Static Private Attributes inherited from QString | |
static const Null | null = { } |
Related Functions inherited from QString | |
bool | operator== (const QString &s1, const QString &s2) |
bool | operator== (const QString &s1, const char *s2) |
bool | operator== (const char *s1, const QString &s2) |
bool | operator!= (const QString &s1, const QString &s2) |
bool | operator!= (const QString &s1, const char *s2) |
bool | operator!= (const char *s1, const QString &s2) |
bool | operator< (const QString &s1, const char *s2) |
bool | operator< (const char *s1, const QString &s2) |
bool | operator<= (const QString &s1, const char *s2) |
bool | operator<= (const char *s1, const QString &s2) |
bool | operator> (const QString &s1, const char *s2) |
bool | operator> (const char *s1, const QString &s2) |
bool | operator>= (const QString &s1, const char *s2) |
bool | operator>= (const char *s1, const QString &s2) |
QString | operator+ (const QString &s1, const QString &s2) |
QString | operator+ (const QString &s1, const char *s2) |
QString | operator+ (const char *s1, const QString &s2) |
QString | operator+ (const QString &s, char c) |
QString | operator+ (char c, const QString &s) |
QDataStream & | operator<< (QDataStream &s, const QString &str) |
A QString which uses constant Unicode data.
In order to minimize copying, highly optimized applications can use QConstString to provide a QString-compatible object from existing Unicode data. It is then the user's responsibility to make sure that the Unicode data must exist for the entire lifetime of the QConstString object.
Constructs a QConstString that uses the first length Unicode characters in the array unicode. Any attempt to modify copies of the string will cause it to create a copy of the data, thus it remains forever unmodified.
Note that unicode is not copied. The caller must be able to guarantee that unicode will not be deleted or modified. Since that is generally not the case with const
strings (they are references), this constructor demands a non-const pointer even though it never modifies unicode.
Definition at line 15179 of file qstring.cpp.
QConstString::~QConstString | ( | ) |
Destroys the QConstString, creating a copy of the data if other strings are still using it.
Definition at line 15188 of file qstring.cpp.
|
inline |