📄 qcstring.3qt
字号:
'\" t.TH QCString 3qt "24 January 2005" "Trolltech AS" \" -*- nroff -*-.\" Copyright 1992-2001 Trolltech AS. All rights reserved. See the.\" license file included in the distribution for a complete license.\" statement..\".ad l.nh.SH NAMEQCString \- Abstraction of the classic C zero-terminated char array (.br.PP\fC#include <qcstring.h>\fR.PPInherits QByteArray..PP.SS "Public Members".in +1c.ti -1c.BI "\fBQCString\fR () ".br.ti -1c.BI "\fBQCString\fR ( int size ) ".br.ti -1c.BI "\fBQCString\fR ( const QCString & s ) ".br.ti -1c.BI "\fBQCString\fR ( const char * str ) ".br.ti -1c.BI "\fBQCString\fR ( const char * " "str" ", uint maxlen ) ".br.ti -1c.BI "QCString& \fBoperator=\fR ( const QCString & s ) ".br.ti -1c.BI "QCString& \fBoperator=\fR ( const char * str ) ".br.ti -1c.BI "bool \fBisNull\fR () const".br.ti -1c.BI "bool \fBisEmpty\fR () const".br.ti -1c.BI "uint \fBlength\fR () const".br.ti -1c.BI "bool \fBresize\fR ( uint newlen ) ".br.ti -1c.BI "bool \fBtruncate\fR ( uint pos ) ".br.ti -1c.BI "bool \fBfill\fR ( char " "c" ", int " "len" " = -1 ) ".br.ti -1c.BI "QCString \fBcopy\fR () const".br.ti -1c.BI "QCString& \fBsprintf\fR ( const char * " "format" ", ... ) ".br.ti -1c.BI "int \fBfind\fR ( char " "c" ", int " "index" "=0, bool " "cs" "=TRUE ) const".br.ti -1c.BI "int \fBfind\fR ( const char * " "str" ", int " "index" "=0, bool " "cs" "=TRUE ) const".br.ti -1c.BI "int \fBfind\fR ( const QRegExp &, int " "index" "=0 ) const".br.ti -1c.BI "int \fBfindRev\fR ( char " "c" ", int " "index" "=-1, bool " "cs" "=TRUE ) const".br.ti -1c.BI "int \fBfindRev\fR ( const char * " "str" ", int " "index" "=-1, bool " "cs" "=TRUE ) const".br.ti -1c.BI "int \fBfindRev\fR ( const QRegExp &, int " "index" "=-1 ) const".br.ti -1c.BI "int \fBcontains\fR ( char " "c" ", bool " "cs" "=TRUE ) const".br.ti -1c.BI "int \fBcontains\fR ( const char * " "str" ", bool " "cs" "=TRUE ) const".br.ti -1c.BI "int \fBcontains\fR ( const QRegExp & ) const".br.ti -1c.BI "QCString \fBleft\fR ( uint len ) const".br.ti -1c.BI "QCString \fBright\fR ( uint len ) const".br.ti -1c.BI "QCString \fBmid\fR ( uint " "index" ", uint " "len" "=0xffffffff ) const".br.ti -1c.BI "QCString \fBleftJustify\fR ( uint " "width" ", char " "fill" "=' ', bool " "trunc" "=FALSE ) const".br.ti -1c.BI "QCString \fBrightJustify\fR ( uint " "width" ", char " "fill" "=' ', bool " "trunc" "=FALSE ) const".br.ti -1c.BI "QCString \fBlower\fR () const".br.ti -1c.BI "QCString \fBupper\fR () const".br.ti -1c.BI "QCString \fBstripWhiteSpace\fR () const".br.ti -1c.BI "QCString \fBsimplifyWhiteSpace\fR () const".br.ti -1c.BI "QCString& \fBinsert\fR ( uint " "index" ", const char * ) ".br.ti -1c.BI "QCString& \fBinsert\fR ( uint " "index" ", char ) ".br.ti -1c.BI "QCString& \fBappend\fR ( const char * ) ".br.ti -1c.BI "QCString& \fBprepend\fR ( const char * ) ".br.ti -1c.BI "QCString& \fBremove\fR ( uint " "index" ", uint len ) ".br.ti -1c.BI "QCString& \fBreplace\fR ( uint " "index" ", uint " "len" ", const char * ) ".br.ti -1c.BI "QCString& \fBreplace\fR ( const QRegExp &, const char * ) ".br.ti -1c.BI "short \fBtoShort\fR ( bool * " "ok" "=0 ) const".br.ti -1c.BI "ushort \fBtoUShort\fR ( bool * " "ok" "=0 ) const".br.ti -1c.BI "int \fBtoInt\fR ( bool * " "ok" "=0 ) const".br.ti -1c.BI "uint \fBtoUInt\fR ( bool * " "ok" "=0 ) const".br.ti -1c.BI "long \fBtoLong\fR ( bool * " "ok" "=0 ) const".br.ti -1c.BI "ulong \fBtoULong\fR ( bool * " "ok" "=0 ) const".br.ti -1c.BI "float \fBtoFloat\fR ( bool * " "ok" "=0 ) const".br.ti -1c.BI "double \fBtoDouble\fR ( bool * " "ok" "=0 ) const".br.ti -1c.BI "QCString& \fBsetStr\fR ( const char * s ) ".br.ti -1c.BI "QCString& \fBsetNum\fR ( short ) ".br.ti -1c.BI "QCString& \fBsetNum\fR ( ushort ) ".br.ti -1c.BI "QCString& \fBsetNum\fR ( int ) ".br.ti -1c.BI "QCString& \fBsetNum\fR ( uint ) ".br.ti -1c.BI "QCString& \fBsetNum\fR ( long ) ".br.ti -1c.BI "QCString& \fBsetNum\fR ( ulong ) ".br.ti -1c.BI "QCString& \fBsetNum\fR ( float, char " "f" "='g', int " "prec" "=6 ) ".br.ti -1c.BI "QCString& \fBsetNum\fR ( double, char " "f" "='g', int " "prec" "=6 ) ".br.ti -1c.BI "bool \fBsetExpand\fR ( uint " "index" ", char c ) ".br.ti -1c.BI "operator \fBconst char*\fR ()const".br.ti -1c.BI "QCString& \fBoperator+=\fR ( const char * str ) ".br.ti -1c.BI "QCString& \fBoperator+=\fR ( char c ) ".br.in -1c.SH RELATED FUNCTION DOCUMENTATION(Note that these are not member functions.).in +1c.ti -1c.BI "bool \fBoperator!=\fR (const QCString & " "s1" ", const char * " "s2" ")".br.ti -1c.BI "int \fBqstricmp\fR (const char * " "str1" ", const char * " "str2" ")".br.ti -1c.BI "bool \fBoperator<\fR (const QCString & " "s1" ", const char * " "s2" ")".br.ti -1c.BI "bool \fBoperator==\fR (const QCString & " "s1" ", const char * " "s2" ")".br.ti -1c.BI "int \fBqstrncmp\fR (const char * " "str1" ", const char * " "str2" ", uint " "len" ")".br.ti -1c.BI "QCString \fBoperator+\fR (const QCString & " "s1" ", const QCString & " "s2" ")".br.ti -1c.BI "bool \fBoperator>=\fR (const char * " "s1" ", const QCString & " "s2" ")".br.ti -1c.BI "QCString \fBoperator+\fR (const QCString & " "s" ", char " "c" ")".br.ti -1c.BI "int \fBstrnicmp\fR (const char * " "str1" ", const char * " "str2" ", uint " "len" ")".br.ti -1c.BI "char * \fBqstrncpy\fR (char * " "dst" ", const char * " "src" ", uint " "len" ")".br.ti -1c.BI "void * \fBmemmove\fR (void * " "dst" ", const void * " "src" ", uint " "len" ")".br.ti -1c.BI "bool \fBoperator>\fR (const QCString & " "s1" ", const char * " "s2" ")".br.ti -1c.BI "QDataStream & \fBoperator<<\fR (QDataStream & " "s" ", const QCString & " "str" ")".br.ti -1c.BI "bool \fBoperator<=\fR (const char * " "s1" ", const QCString & " "s2" ")".br.ti -1c.BI "QCString \fBoperator+\fR (const char * " "s1" ", const QCString & " "s2" ")".br.ti -1c.BI "bool \fBoperator>\fR (const char * " "s1" ", const QCString & " "s2" ")".br.ti -1c.BI "bool \fBoperator<=\fR (const QCString & " "s1" ", const char * " "s2" ")".br.ti -1c.BI "QDataStream & \fBoperator>>\fR (QDataStream & " "s" ", QCString & " "str" ")".br.ti -1c.BI "bool \fBoperator==\fR (const char * " "s1" ", const QCString & " "s2" ")".br.ti -1c.BI "bool \fBoperator>=\fR (const QCString & " "s1" ", const char * " "s2" ")".br.ti -1c.BI "QCString \fBoperator+\fR (char " "c" ", const QCString & " "s" ")".br.ti -1c.BI "bool \fBoperator<\fR (const char * " "s1" ", const QCString & " "s2" ")".br.ti -1c.BI "int \fBqstrcmp\fR (const char * " "str1" ", const char * " "str2" ")".br.ti -1c.BI "bool \fBoperator!=\fR (const QCString & " "s1" ", const QCString & " "s2" ")".br.ti -1c.BI "QCString \fBoperator+\fR (const QCString & " "s1" ", const char * " "s2" ")".br.ti -1c.BI "char * \fBqstrdup\fR (const char * " "str" ")".br.ti -1c.BI "bool \fBoperator==\fR (const QCString & " "s1" ", const QCString & " "s2" ")".br.ti -1c.BI "bool \fBoperator!=\fR (const char * " "s1" ", const QCString & " "s2" ")".br.in -1c.SH DESCRIPTIONThe QCString class provides an abstraction of the classic C zero-terminated char array (\fIchar*\fR)..PPQCString inherits QByteArray, which is defined as QArray<char>..PPSince QCString is a QArray, it uses \fIexplicit\fR sharing with a reference count..PPYou might use QCString for text that is never exposed to the user, but for text the user sees, you should use QString (which provides implicit sharing, Unicode and other internationalization support)..PPNote that QCString is one of the weaker classes in Qt; its design is flawed (it tries to behave like a more convenient const char *) and as a result, algorithms that use QCString heavily all too often perform badly. For example, append() is O(length()) since it scans for a null terminator, which makes many algorithms that use QCString scale even worse..PPNote that for the QCString methods that take a \fIconst char *\fR parameter the results are undefined if the QCString is not zero-terminated. It is legal for the \fIconst char *\fR parameter to be 0..PPA QCString that has not been assigned to anything is \fInull,\fR i.e. both the length and data pointer is 0. A QCString that references the empty string ("", a single '\\0' char) is \fIempty.\fR Both null and empty QCStrings are legal parameters to the methods. Assigning \fIconst char * 0\fR to QCString gives a null QCString..PPSee also Shared classes.SH MEMBER FUNCTION DOCUMENTATION.SH "QCString::QCString ()"Constructs a null string..PPSee also isNull()..SH "QCString::QCString ( const QCString & s )"Constructs a shallow copy \fIs.\fR.PPSee also assign()..SH "QCString::QCString ( const char * str )"Constructs a string that is a deep copy of \fIstr.\fR
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -