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

📄 qcstring.3qt

📁 Qt/Embedded是一个多平台的C++图形用户界面应用程序框架
💻 3QT
📖 第 1 页 / 共 3 页
字号:
.br    QCString s = "Pineapple";.br    QCString t = s.right( 5 );                  // t == "apple".fi.PPSee also left() and mid()..SH "QCString QCString::rightJustify ( uint width, char fill=' ', bool truncate=FALSE ) const"Returns a string of length \fIwidth\fR (plus '\\0') that contains pad characters followed by the string..PPIf the length of the string exceeds \fIwidth\fR and \fItruncate\fR is FALSE, 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".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, filling with spaces..PPReturns FALSE if this \fIindex\fR was out of range and the string could not be expanded, otherwise TRUE..SH "QCString & QCString::setNum ( double n, char f='g', int prec=6 )"Sets the string to the printed value of \fIn.\fR.PPArguments:.TP\fIf\fR is the format specifier: 'f', 'F', 'e', 'E', 'g', 'G' (same as sprintf())..TP\fIprec\fR is the precision. Returns a reference to the string..SH "QCString & QCString::setNum ( float n, char f='g', int prec=6 )"Sets the string to the printed value of \fIn.\fR.PPArguments:.TP\fIf\fR is the format specifier: 'f', 'F', 'e', 'E', 'g', 'G' (same as sprintf())..TP\fIprec\fR is the precision. Returns a reference to the string..SH "QCString & QCString::setNum ( int n )"Sets the string to the printed value of \fIn\fR and returns a reference to the string..SH "QCString & QCString::setNum ( long n )"Sets the string to the printed value of \fIn\fR and returns a reference to the string..SH "QCString & QCString::setNum ( short n )"Sets the string to the printed value of \fIn\fR and returns a reference to the string..SH "QCString & QCString::setNum ( uint n )"Sets the string to the printed unsigned value of \fIn\fR and returns a reference to the string..SH "QCString & QCString::setNum ( ulong n )"Sets the string to the printed unsigned value of \fIn\fR and returns a reference to the string..SH "QCString & QCString::setNum ( ushort n )"Sets the string to the printed unsigned value of \fIn\fR and returns a reference to the string..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 any ASCII code 9, 10, 11, 12, 13 or 32..PP.nf.br    QCString s = "  lots\\t of\\nwhite    space ";.br    QCString t = s.simplifyWhiteSpace();                // t == "lots of white space".fi.PPSee also stripWhiteSpace()..SH "QCString & QCString::sprintf ( const char * format, ... )"Implemented as a call to the native vsprintf() (see your C-library manual)..PPIf your 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 natural 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.fi.PP\fBWarning:\fR All vsprintf() implementations will write past the end of the target string (*this) if the format 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 begging for trouble. Sooner or later someone \fIwill\fR paste a 3000-character 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 any ASCII code 9, 10, 11, 12, 13 or 32..PPExample:.PP.nf.br    QCString s = " space ";.br    QCString t = s.stripWhiteSpace();           // t == "space".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 non-null, \fI*ok\fR is set to TRUE if there are no conceivable errors, and FALSE if the string is not a number at all, or if it has trailing garbage..SH "float QCString::toFloat ( bool * ok=0 ) const"Returns the string converted to a \fCfloat\fR value..PPIf \fIok\fR is non-null, \fI*ok\fR is set to TRUE if there are no conceivable errors, and FALSE if the string is not a number at all, or if it has trailing garbage..SH "int QCString::toInt ( bool * ok=0 ) const"Returns the string converted to a \fCint\fR value..PPIf \fIok\fR is non-null, \fI*ok\fR is set to TRUE if there are no conceivable errors, and FALSE if the string is not a number at all, or if it has trailing garbage..SH "long QCString::toLong ( bool * ok=0 ) const"Returns the string converted to a \fClong\fR value..PPIf \fIok\fR is non-null, \fI*ok\fR is set to TRUE if there are no conceivable errors, and FALSE if the string is not a number at all, or if it has trailing garbage..SH "short QCString::toShort ( bool * ok=0 ) const"Returns the string converted to a \fCshort\fR value..PPIf \fIok\fR is non-null, \fI*ok\fR is set to TRUE if there are no conceivable errors, and FALSE if the string is not a number at all, or if it has trailing garbage..SH "uint QCString::toUInt ( bool * ok=0 ) const"Returns the string converted to an \fCunsigned int\fR value..PPIf \fIok\fR is non-null, \fI*ok\fR is set to TRUE if there are no conceivable errors, and FALSE if the string is not a number at all, or if it has trailing garbage..SH "ulong QCString::toULong ( bool * ok=0 ) const"Returns the string converted to an \fCunsigned long\fR value..PPIf \fIok\fR is non-null, \fI*ok\fR is set to TRUE if there are no conceivable errors, and FALSE if the string is not a number at all, or if it has trailing garbage..SH "ushort QCString::toUShort ( bool * ok=0 ) const"Returns the string converted to an \fCunsigned short\fR value..PPIf \fIok\fR is non-null, \fI*ok\fR is set to TRUE if there are no conceivable errors, and FALSE if the string is not a number at all, or if it has trailing garbage..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".fi.PPSee also resize()..SH "QCString QCString::upper () const"Returns a new string that is the string converted to upper case..PPPresently it only handles 7-bit ASCII, or whatever toupper() handles (if $LC_CTYPE is set, most UNIX systems do the Right Thing)..PPExample:.PP.nf.br    QCString s("TeX");.br    QCString t = s.upper();                     // t == "TEX".fi.PPSee also lower()..SH RELATED FUNCTION DOCUMENTATION.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 null..PPSpecial case II: Returns a random nonzero value if \fIstr1\fR is null or \fIstr2\fR is null (but not both)..PPSee also qstrncmp(), qstricmp() and qstrnicmp()..SH "bool operator!= (const QCString & s1, const char * s2)"Returns TRUE if the two strings are different, or FALSE if they are equal..PPEquivalent to \fCqstrcmp(s1,s2) != 0\fR.SH "bool operator!= (const char * s1, const QCString & s2)"Returns TRUE if the two strings are different, or FALSE if they are equal..PPEquivalent to \fCqstrcmp(s1,s2) != 0\fR.SH "bool operator== (const char * s1, const QCString & s2)"Returns TRUE if the two strings are equal, or FALSE if they are different..PPEquivalent to \fCqstrcmp(s1,s2) == 0\fR.SH "char * qstrncpy (char * dst, const char * src, uint len)"A safe strncpy() function..PPCopies all characters up to \fIlen\fR bytes from \fIstr\fR into \fIdst\fR and returns a pointer to \fIdst.\fR Guarantees that \fIdst\fR is \\0-terminated. If \fIsrc\fR is null, it immediately returns 0..PPSee also qstrcpy()..SH "QDataStream & operator<< (QDataStream & s, const QCString & str)"Writes a string to the stream..PPSee also Format of the QDataStream operators.SH "bool operator< (const char * s1, const QCString & s2)"Returns TRUE if \fIs1\fR is alphabetically less than \fIs2,\fR otherwise FALSE..PPEquivalent to \fCqstrcmp(s1,s2) < 0\fR.SH "void * memmove (void * dst, const void * src, uint len)"This function is normally part of the C library. Qt implements memmove() for platforms that do not have 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 "bool operator> (const char * s1, const QCString & s2)"Returns TRUE if \fIs1\fR is alphabetically greater than \fIs2,\fR otherwise FALSE..PPEquivalent to \fCqstrcmp(s1,s2) > 0\fR.SH "QDataStream & operator>> (QDataStream & s, QCString & str)"Reads a string from the stream..PPSee also Format of the QDataStream operators.SH "bool operator<= (const QCString & s1, const char * s2)"Returns TRUE if \fIs1\fR is alphabetically less than or equal to \fIs2,\fR otherwise FALSE..PPEquivalent to \fCqstrcmp(s1,s2) <= 0\fR.SH "bool operator!= (const QCString & s1, const QCString & s2)"Returns TRUE if the two strings are different, or FALSE if they are equal..PPEquivalent to \fCqstrcmp(s1,s2) != 0\fR.SH "bool operator<= (const char * s1, const QCString & s2)"Returns TRUE if \fIs1\fR is alphabetically less than or equal to \fIs2,\fR otherwise FALSE..PPEquivalent to \fCqstrcmp(s1,s2) <= 0\fR.SH "bool operator>= (const char * s1, const QCString & s2)"Returns TRUE if \fIs1\fR is alphabetically greater than or equal to \fIs2,\fR otherwise FALSE..PPEquivalent to \fCqstrcmp(s1,s2) >= 0\fR.SH "QCString operator+ (const QCString & s, char c)"Returns the concatenated string of s and c..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 null..PPSpecial case II: Returns a random nonzero value if \fIstr1\fR is null or \fIstr2\fR is null (but not both)..PPSee also qstrcmp(), qstrncmp() and qstrnicmp()..SH "QCString operator+ (const QCString & s1, const QCString & s2)"Returns the concatenated string of s1 and s2..SH "int strnicmp (const char * str1, const char * str2, uint len)"A safe strnicmp() function..PPCompares \fIstr1\fR and \fIstr2\fR up to \fIlen\fR bytes 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 null..PPSpecial case II: Returns a random nonzero value if \fIstr1\fR is null or \fIstr2\fR is null (but not both)..PPSee also qstrcmp(), qstrncmp() and qstricmp()..SH "char * qstrdup (const char * str)"Returns a duplicate string..PPAllocates space for a copy of \fIstr\fR (using \fCnew),\fR copies it, and returns a pointer to the copy. If \fIsrc\fR is null, it immediately returns 0..SH "QCString operator+ (char c, const QCString & s)"Returns the concatenated string of c and s..SH "bool operator>= (const QCString & s1, const char * s2)"Returns TRUE if \fIs1\fR is alphabetically greater than or equal to \fIs2,\fR otherwise FALSE..PPEquivalent to \fCqstrcmp(s1,s2) >= 0\fR.SH "bool operator== (const QCString & s1, const char * s2)"Returns TRUE if the two strings are equal, or FALSE if they are different..PPEquivalent to \fCqstrcmp(s1,s2) == 0\fR.SH "bool operator> (const QCString & s1, const char * s2)"Returns TRUE if \fIs1\fR is alphabetically greater than \fIs2,\fR otherwise FALSE..PPEquivalent to \fCqstrcmp(s1,s2) > 0\fR.SH "QCString operator+ (const QCString & s1, const char * s2)"Returns the concatenated string of s1 and s2..SH "bool operator< (const QCString & s1, const char * s2)"Returns TRUE if \fIs1\fR is alphabetically less than \fIs2,\fR otherwise FALSE..PPEquivalent to \fCqstrcmp(s1,s2) < 0\fR.SH "int qstrncmp (const char * str1, const char * str2, uint len)"A safe strncmp() function..PPCompares \fIstr1\fR and \fIstr2\fR up to \fIlen\fR bytes..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 null..PPSpecial case II: Returns a random nonzero value if \fIstr1\fR is null or \fIstr2\fR is null (but not both)..PPSee also qstrcmp(), qstricmp() and qstrnicmp()..SH "QCString operator+ (const char * s1, const QCString & s2)"Returns the concatenated string of s1 and s2..SH "bool operator== (const QCString & s1, const QCString & s2)"Returns TRUE if the two strings are equal, or FALSE if they are different..PPEquivalent to \fCqstrcmp(s1,s2) == 0\fR.SH "SEE ALSO".BR http://doc.trolltech.com/qcstring.html.SH COPYRIGHTCopyright 1992-2000 Trolltech AS, http://www.trolltech.com/.  See thelicense file included in the distribution for a complete licensestatement..SH AUTHORGenerated automatically from the source code.

⌨️ 快捷键说明

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