⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 qcstring.3qt

📁 Linux下的基于X11的图形开发环境。
💻 3QT
📖 第 1 页 / 共 3 页
字号:
.SH "QCString QCString::rightJustify ( uint width, char fill = ' ', bool truncate = FALSE ) const"Returns a string of length \fIwidth\fR (plus one for the terminating '&#92;0') that contains zero or more of the \fIfill\fR character followed by this string..PPIf the length of the string exceeds \fIwidth\fR and \fItruncate\fR is FALSE (the default), then the returned string is a copy of the string. If the length of the string exceeds \fIwidth\fR and \fItruncate\fR is TRUE, then the returned string is a left(\fIwidth\fR)..PPExample:.PP.nf.br    QCString s("pie");.br    QCString t = s.rightJustify(8, '.');  // t == ".....pie".br.fi.PPSee also leftJustify()..SH "bool QCString::setExpand ( uint index, char c )"Sets the character at position \fIindex\fR to \fIc\fR and expands the string if necessary, padding with spaces..PPReturns FALSE if \fIindex\fR was out of range and the string could not be expanded; otherwise returns TRUE..SH "QCString & QCString::setNum ( double n, char f = 'g', int prec = 6 )"Sets the string to the string representation of the number \fIn\fR and returns a reference to the string..PPThe format of the string representation is specified by the format character \fIf\fR, and the precision (number of digits after the decimal point) is specified with \fIprec\fR..PPThe valid formats for \fIf\fR are 'e', 'E', 'f', 'g' and 'G'. The formats are the same as for sprintf(); they are explained in QString::arg()..SH "QCString & QCString::setNum ( short n )"This is an overloaded member function, provided for convenience. It behaves essentially like the above function..PPSets the string to the string representation of the number \fIn\fR and returns a reference to the string..SH "QCString & QCString::setNum ( ushort n )"This is an overloaded member function, provided for convenience. It behaves essentially like the above function..PPSets the string to the string representation of the number \fIn\fR and returns a reference to the string..SH "QCString & QCString::setNum ( int n )"This is an overloaded member function, provided for convenience. It behaves essentially like the above function..PPSets the string to the string representation of the number \fIn\fR and returns a reference to the string..SH "QCString & QCString::setNum ( uint n )"This is an overloaded member function, provided for convenience. It behaves essentially like the above function..PPSets the string to the string representation of the number \fIn\fR and returns a reference to the string..SH "QCString & QCString::setNum ( long n )"This is an overloaded member function, provided for convenience. It behaves essentially like the above function..PPSets the string to the string representation of the number \fIn\fR and returns a reference to the string..SH "QCString & QCString::setNum ( ulong n )"This is an overloaded member function, provided for convenience. It behaves essentially like the above function..PPSets the string to the string representation of the number \fIn\fR and returns a reference to the string..SH "QCString & QCString::setNum ( float n, char f = 'g', int prec = 6 )"This is an overloaded member function, provided for convenience. It behaves essentially like the above function..SH "QCString & QCString::setStr ( const char * str )"Makes a deep copy of \fIstr\fR. Returns a reference to the string..SH "QCString QCString::simplifyWhiteSpace () const"Returns a new string that has white space removed from the start and the end, plus any sequence of internal white space replaced with a single space (ASCII 32)..PPWhite space means the decimal ASCII codes 9, 10, 11, 12, 13 and 32..PP.nf.br    QCString s = "  lots\\t of\\nwhite    space ";.br    QCString t = s.simplifyWhiteSpace(); // t == "lots of white space".br.fi.PPSee also stripWhiteSpace()..SH "QCString & QCString::sprintf ( const char * format, ... )"Implemented as a call to the native vsprintf() (see the manual for your C library)..PPIf the string is shorter than 256 characters, this sprintf() calls resize(256) to decrease the chance of memory corruption. The string is resized back to its actual length before sprintf() returns..PPExample:.PP.nf.br    QCString s;.br    s.sprintf( "%d - %s", 1, "first" );         // result < 256 chars.br.br    QCString big( 25000 );                      // very long string.br    big.sprintf( "%d - %s", 2, longString );    // result < 25000 chars.br.fi.PP\fBWarning:\fR All vsprintf() implementations will write past the end of the target string (*this) if the \fIformat\fR specification and arguments happen to be longer than the target string, and some will also fail if the target string is longer than some arbitrary implementation limit..PPGiving user-supplied arguments to sprintf() is risky: Sooner or later someone will paste a huge line into your application..SH "QCString QCString::stripWhiteSpace () const"Returns a new string that has white space removed from the start and the end..PPWhite space means the decimal ASCII codes 9, 10, 11, 12, 13 and 32..PPExample:.PP.nf.br    QCString s = " space ";.br    QCString t = s.stripWhiteSpace();           // t == "space".br.fi.PPSee also simplifyWhiteSpace()..SH "double QCString::toDouble ( bool * ok = 0 ) const"Returns the string converted to a \fCdouble\fR value..PPIf \fIok\fR is not 0: \fI*ok\fR is set to FALSE if the string is not a number, or if it has trailing garbage; otherwise \fI*ok\fR is set to TRUE..SH "float QCString::toFloat ( bool * ok = 0 ) const"Returns the string converted to a \fCfloat\fR value..PPIf \fIok\fR is not 0: \fI*ok\fR is set to FALSE if the string is not a number, or if it has trailing garbage; otherwise \fI*ok\fR is set to TRUE..SH "int QCString::toInt ( bool * ok = 0 ) const"Returns the string converted to a \fCint\fR value..PPIf \fIok\fR is not 0: \fI*ok\fR is set to FALSE if the string is not a number, or if it has trailing garbage; otherwise \fI*ok\fR is set to TRUE..SH "long QCString::toLong ( bool * ok = 0 ) const"Returns the string converted to a \fClong\fR value..PPIf \fIok\fR is not 0: \fI*ok\fR is set to FALSE if the string is not a number, or if it has trailing garbage; otherwise \fI*ok\fR is set to TRUE..SH "short QCString::toShort ( bool * ok = 0 ) const"Returns the string converted to a \fCshort\fR value..PPIf \fIok\fR is not 0: \fI*ok\fR is set to FALSE if the string is not a number, is out of range, or if it has trailing garbage; otherwise \fI*ok\fR is set to TRUE..SH "uint QCString::toUInt ( bool * ok = 0 ) const"Returns the string converted to an \fCunsigned int\fR value..PPIf \fIok\fR is not 0: \fI*ok\fR is set to FALSE if the string is not a number, or if it has trailing garbage; otherwise \fI*ok\fR is set to TRUE..SH "ulong QCString::toULong ( bool * ok = 0 ) const"Returns the string converted to an \fCunsigned long\fR value..PPIf \fIok\fR is not 0: \fI*ok\fR is set to FALSE if the string is not a number, or if it has trailing garbage; otherwise \fI*ok\fR is set to TRUE..SH "ushort QCString::toUShort ( bool * ok = 0 ) const"Returns the string converted to an \fCunsigned short\fR value..PPIf \fIok\fR is not 0: \fI*ok\fR is set to FALSE if the string is not a number, is out of range, or if it has trailing garbage; otherwise \fI*ok\fR is set to TRUE..SH "bool QCString::truncate ( uint pos )"Truncates the string at position \fIpos\fR..PPEquivalent to calling \fCresize(pos+1)\fR..PPExample:.PP.nf.br    QCString s = "truncate this string";.br    s.truncate( 5 );                      // s == "trunc".br.fi.PPSee also resize()..SH "QCString QCString::upper () const"Returns a new string that is a copy of this string converted to upper case..PPExample:.PP.nf.br    QCString s( "Debit" );.br    QCString t = s.upper();  // t == "DEBIT".br.fi.PPSee also lower() and Note on character comparisons..SH RELATED FUNCTION DOCUMENTATION.SH "bool operator!= ( const QCString & s1, const QCString & s2 )"Returns TRUE if \fIs1\fR and \fIs2\fR are different; otherwise returns FALSE..PPEquivalent to qstrcmp(\fIs1\fR, \fIs2\fR) != 0..SH "bool operator!= ( const QCString & s1, const char * s2 )"This is an overloaded member function, provided for convenience. It behaves essentially like the above function..PPReturns TRUE if \fIs1\fR and \fIs2\fR are different; otherwise returns FALSE..PPEquivalent to qstrcmp(\fIs1\fR, \fIs2\fR) != 0..SH "bool operator!= ( const char * s1, const QCString & s2 )"This is an overloaded member function, provided for convenience. It behaves essentially like the above function..PPReturns TRUE if \fIs1\fR and \fIs2\fR are different; otherwise returns FALSE..PPEquivalent to qstrcmp(\fIs1\fR, \fIs2\fR) != 0..SH "const QCString operator+ ( const QCString & s1, const QCString & s2 )"Returns a string which consists of the concatenation of \fIs1\fR and \fIs2\fR..SH "const QCString operator+ ( const QCString & s1, const char * s2 )"This is an overloaded member function, provided for convenience. It behaves essentially like the above function..PPReturns a string which consists of the concatenation of \fIs1\fR and \fIs2\fR..SH "const QCString operator+ ( const char * s1, const QCString & s2 )"This is an overloaded member function, provided for convenience. It behaves essentially like the above function..PPReturns a string which consists of the concatenation of \fIs1\fR and \fIs2\fR..SH "const QCString operator+ ( const QCString & s, char c )"This is an overloaded member function, provided for convenience. It behaves essentially like the above function..PPReturns a string which consists of the concatenation of \fIs\fR and \fIc\fR..SH "const QCString operator+ ( char c, const QCString & s )"This is an overloaded member function, provided for convenience. It behaves essentially like the above function..PPReturns a string which consists of the concatenation of \fIc\fR and \fIs\fR..SH "bool operator< ( const QCString & s1, const char * s2 )"Returns TRUE if \fIs1\fR is less than \fIs2\fR; otherwise returns FALSE..PPEquivalent to qstrcmp(\fIs1\fR, \fIs2\fR) < 0..PPSee also Note on character comparisons..SH "bool operator< ( const char * s1, const QCString & s2 )"This is an overloaded member function, provided for convenience. It behaves essentially like the above function..PPReturns TRUE if \fIs1\fR is less than \fIs2\fR; otherwise returns FALSE..PPEquivalent to qstrcmp(\fIs1\fR, \fIs2\fR) < 0..PPSee also Note on character comparisons..SH "QDataStream & operator<< ( QDataStream & s, const QCString & str )"Writes string \fIstr\fR to the stream \fIs\fR..PPSee also Format of the QDataStream operators..SH "bool operator<= ( const QCString & s1, const char * s2 )"Returns TRUE if \fIs1\fR is less than or equal to \fIs2\fR; otherwise returns FALSE..PPEquivalent to qstrcmp(\fIs1\fR, \fIs2\fR) <= 0..PPSee also Note on character comparisons..SH "bool operator<= ( const char * s1, const QCString & s2 )"This is an overloaded member function, provided for convenience. It behaves essentially like the above function..PPReturns TRUE if \fIs1\fR is less than or equal to \fIs2\fR; otherwise returns FALSE..PPEquivalent to qstrcmp(\fIs1\fR, \fIs2\fR) <= 0..PPSee also Note on character comparisons..SH "bool operator== ( const QCString & s1, const QCString & s2 )"Returns TRUE if \fIs1\fR and \fIs2\fR are equal; otherwise returns FALSE..PPEquivalent to qstrcmp(\fIs1\fR, \fIs2\fR) == 0..SH "bool operator== ( const QCString & s1, const char * s2 )"This is an overloaded member function, provided for convenience. It behaves essentially like the above function..PPReturns TRUE if \fIs1\fR and \fIs2\fR are equal; otherwise returns FALSE..PPEquivalent to qstrcmp(\fIs1\fR, \fIs2\fR) == 0..SH "bool operator== ( const char * s1, const QCString & s2 )"This is an overloaded member function, provided for convenience. It behaves essentially like the above function..PPReturns TRUE if \fIs1\fR and \fIs2\fR are equal; otherwise returns FALSE..PPEquivalent to qstrcmp(\fIs1\fR, \fIs2\fR) == 0..SH "bool operator> ( const QCString & s1, const char * s2 )"Returns TRUE if \fIs1\fR is greater than \fIs2\fR; otherwise returns FALSE..PPEquivalent to qstrcmp(\fIs1\fR, \fIs2\fR) > 0..PPSee also Note on character comparisons..SH "bool operator> ( const char * s1, const QCString & s2 )"This is an overloaded member function, provided for convenience. It behaves essentially like the above function..PPReturns TRUE if \fIs1\fR is greater than \fIs2\fR; otherwise returns FALSE..PPEquivalent to qstrcmp(\fIs1\fR, \fIs2\fR) > 0..PPSee also Note on character comparisons..SH "bool operator>= ( const QCString & s1, const char * s2 )"Returns TRUE if \fIs1\fR is greater than or equal to \fIs2\fR; otherwise returns FALSE..PPEquivalent to qstrcmp(\fIs1\fR, \fIs2\fR) >= 0..PPSee also Note on character comparisons..SH "bool operator>= ( const char * s1, const QCString & s2 )"This is an overloaded member function, provided for convenience. It behaves essentially like the above function..PPReturns TRUE if \fIs1\fR is greater than or equal to \fIs2\fR; otherwise returns FALSE..PPEquivalent to qstrcmp(\fIs1\fR, \fIs2\fR) >= 0..PPSee also Note on character comparisons..SH "QDataStream & operator>> ( QDataStream & s, QCString & str )"Reads a string into \fIstr\fR from the stream \fIs\fR..PPSee also Format of the QDataStream operators..SH "void * qmemmove ( void * dst, const void * src, uint len )"This function is normally part of the C library. Qt implements memmove() for platforms that do not provide it..PPmemmove() copies \fIlen\fR bytes from \fIsrc\fR into \fIdst\fR. The data is copied correctly even if \fIsrc\fR and \fIdst\fR overlap..SH "int qstrcmp ( const char * str1, const char * str2 )"A safe strcmp() function..PPCompares \fIstr1\fR and \fIstr2\fR. Returns a negative value if \fIstr1\fR is less than \fIstr2\fR, 0 if \fIstr1\fR is equal to \fIstr2\fR or a positive value if \fIstr1\fR is greater than \fIstr2\fR..PPSpecial case I: Returns 0 if \fIstr1\fR and \fIstr2\fR are both 0..PPSpecial case II: Returns a random nonzero value if \fIstr1\fR is 0 or \fIstr2\fR is 0 (but not both)..PPSee also qstrncmp(), qstricmp(), qstrnicmp(), and Note on character comparisons..SH "char * qstrcpy ( char * dst, const char * src )"A safe strcpy() function..PPCopies all characters up to and including the '&#92;0' from \fIsrc\fR into \fIdst\fR and returns a pointer to \fIdst\fR..SH "char * qstrdup ( const char * src )"Returns a duplicate string..PPAllocates space for a copy of \fIsrc\fR, copies it, and returns a pointer to the copy. If \fIsrc\fR is 0, it immediately returns 0..PPThe returned string must be deleted using \fCdelete[]\fR..SH "int qstricmp ( const char * str1, const char * str2 )"A safe stricmp() function..PPCompares \fIstr1\fR and \fIstr2\fR ignoring the case..PPReturns a negative value if \fIstr1\fR is less than \fIstr2\fR, 0 if \fIstr1\fR is equal to \fIstr2\fR or a positive value if \fIstr1\fR is greater than \fIstr2\fR..PPSpecial case I: Returns 0 if \fIstr1\fR and \fIstr2\fR are both 0..PPSpecial case II: Returns a random nonzero value if \fIstr1\fR is 0 or \fIstr2\fR is 0 (but not both)..PPSee also qstrcmp(), qstrncmp(), qstrnicmp(), and Note on character comparisons..SH "int qstrncmp ( const char * str1, const char * str2, uint len )"A safe strncmp() function..PPCompares at most \fIlen\fR bytes of \fIstr1\fR and \fIstr2\fR..PPReturns a negative value if \fIstr1\fR is less than \fIstr2\fR, 0 if \fIstr1\fR is equal to \fIstr2\fR or a positive value if \fIstr1\fR is greater than \fIstr2\fR..PPSpecial case I: Returns 0 if \fIstr1\fR and \fIstr2\fR are both 0..PPSpecial case II: Returns a random nonzero value if \fIstr1\fR is 0 or \fIstr2\fR is 0 (but not both)..PPSee also qstrcmp(), qstricmp(), qstrnicmp(), and Note on character comparisons..SH "char * qstrncpy ( char * dst, const char * src, uint len )"A safe strncpy() function..PPCopies at most \fIlen\fR bytes from \fIsrc\fR (stopping at \fIlen\fR or the terminating '&#92;0' whichever comes first) into \fIdst\fR and returns a pointer to \fIdst\fR. Guarantees that \fIdst\fR is '&#92;0'-terminated. If \fIsrc\fR or \fIdst\fR is 0, returns 0 immediately..PPSee also qstrcpy()..SH "int qstrnicmp ( const char * str1, const char * str2, uint len )"A safe strnicmp() function..PPCompares at most \fIlen\fR bytes of \fIstr1\fR and \fIstr2\fR ignoring the case..PPReturns a negative value if \fIstr1\fR is less than \fIstr2\fR, 0 if \fIstr1\fR is equal to \fIstr2\fR or a positive value if \fIstr1\fR is greater than \fIstr2\fR..PPSpecial case I: Returns 0 if \fIstr1\fR and \fIstr2\fR are both 0..PPSpecial case II: Returns a random nonzero value if \fIstr1\fR is 0 or \fIstr2\fR is 0 (but not both)..PPSee also qstrcmp(), qstrncmp(), qstricmp(), and Note on character comparisons..SH "SEE ALSO".BR http://doc.trolltech.com/qcstring.html.BR http://www.trolltech.com/faq/tech.html.SH COPYRIGHTCopyright 1992-2001 Trolltech AS, http://www.trolltech.com.  See thelicense file included in the distribution for a complete licensestatement..SH AUTHORGenerated automatically from the source code..SH BUGSIf you find a bug in Qt, please report it as described in.BR http://doc.trolltech.com/bughowto.html .Good bug reports help us to help you. Thank you..PThe definitive Qt documentation is provided in HTML format; it islocated at $QTDIR/doc/html and can be read using Qt Assistant or witha web browser. This man page is provided as a convenience for thoseusers who prefer man pages, although this format is not officiallysupported by Trolltech. .PIf you find errors in this manual page, please report them to.BR qt-bugs@trolltech.com .Please include the name of the manual page (qcstring.3qt) and the Qtversion (3.1.1).

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -