<?xml version="1.0" encoding="UTF-8"?> <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"> <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en_US" lang="en_US"> <head> <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> <!-- q3cstring.cpp --> <title>Qt 4.8: Q3CString Class Reference</title> <link rel="stylesheet" type="text/css" href="style/style.css" /> <script src="scripts/jquery.js" type="text/javascript"></script> <script src="scripts/functions.js" type="text/javascript"></script> <link rel="stylesheet" type="text/css" href="style/superfish.css" /> <link rel="stylesheet" type="text/css" href="style/narrow.css" /> <!--[if IE]> <meta name="MSSmartTagsPreventParsing" content="true"> <meta http-equiv="imagetoolbar" content="no"> <![endif]--> <!--[if lt IE 7]> <link rel="stylesheet" type="text/css" href="style/style_ie6.css"> <![endif]--> <!--[if IE 7]> <link rel="stylesheet" type="text/css" href="style/style_ie7.css"> <![endif]--> <!--[if IE 8]> <link rel="stylesheet" type="text/css" href="style/style_ie8.css"> <![endif]--> <script src="scripts/superfish.js" type="text/javascript"></script> <script src="scripts/narrow.js" type="text/javascript"></script> </head> <body class="" onload="CheckEmptyAndLoadList();"> <div class="header" id="qtdocheader"> <div class="content"> <div id="nav-logo"> <a href="index.html">Home</a></div> <a href="index.html" class="qtref"><span>Qt Reference Documentation</span></a> <div id="narrowsearch"></div> <div id="nav-topright"> <ul> <li class="nav-topright-home"><a href="http://qt.digia.com/">Qt HOME</a></li> <li class="nav-topright-dev"><a href="http://qt-project.org/">DEV</a></li> <li class="nav-topright-doc nav-topright-doc-active"><a href="http://qt-project.org/doc/"> DOC</a></li> <li class="nav-topright-blog"><a href="http://blog.qt.digia.com/">BLOG</a></li> </ul> </div> <div id="shortCut"> <ul> <li class="shortCut-topleft-inactive"><span><a href="index.html">Qt 4.8</a></span></li> <li class="shortCut-topleft-active"><a href="http://qt-project.org/doc/">ALL VERSIONS </a></li> </ul> </div> <ul class="sf-menu" id="narrowmenu"> <li><a href="#">API Lookup</a> <ul> <li><a href="classes.html">Class index</a></li> <li><a href="functions.html">Function index</a></li> <li><a href="modules.html">Modules</a></li> <li><a href="namespaces.html">Namespaces</a></li> <li><a href="qtglobal.html">Global Declarations</a></li> <li><a href="qdeclarativeelements.html">QML elements</a></li> </ul> </li> <li><a href="#">Qt Topics</a> <ul> <li><a href="qt-basic-concepts.html">Programming with Qt</a></li> <li><a href="qtquick.html">Device UIs & Qt Quick</a></li> <li><a href="qt-gui-concepts.html">UI Design with Qt</a></li> <li><a href="supported-platforms.html">Supported Platforms</a></li> <li><a href="technology-apis.html">Qt and Key Technologies</a></li> <li><a href="best-practices.html">How-To's and Best Practices</a></li> </ul> </li> <li><a href="#">Examples</a> <ul> <li><a href="all-examples.html">Examples</a></li> <li><a href="tutorials.html">Tutorials</a></li> <li><a href="demos.html">Demos</a></li> <li><a href="qdeclarativeexamples.html">QML Examples</a></li> </ul> </li> </ul> </div> </div> <div class="wrapper"> <div class="hd"> <span></span> </div> <div class="bd group"> <div class="sidebar"> <div class="searchlabel"> Search index:</div> <div class="search" id="sidebarsearch"> <form id="qtdocsearch" action="" onsubmit="return false;"> <fieldset> <input type="text" name="searchstring" id="pageType" value="" /> <div id="resultdialog"> <a href="#" id="resultclose">Close</a> <p id="resultlinks" class="all"><a href="#" id="showallresults">All</a> | <a href="#" id="showapiresults">API</a> | <a href="#" id="showarticleresults">Articles</a> | <a href="#" id="showexampleresults">Examples</a></p> <p id="searchcount" class="all"><span id="resultcount"></span><span id="apicount"></span><span id="articlecount"></span><span id="examplecount"></span> results:</p> <ul id="resultlist" class="all"> </ul> </div> </fieldset> </form> </div> <div class="box first bottombar" id="lookup"> <h2 title="API Lookup"><span></span> API Lookup</h2> <div id="list001" class="list"> <ul id="ul001" > <li class="defaultLink"><a href="classes.html">Class index</a></li> <li class="defaultLink"><a href="functions.html">Function index</a></li> <li class="defaultLink"><a href="modules.html">Modules</a></li> <li class="defaultLink"><a href="namespaces.html">Namespaces</a></li> <li class="defaultLink"><a href="qtglobal.html">Global Declarations</a></li> <li class="defaultLink"><a href="qdeclarativeelements.html">QML elements</a></li> </ul> </div> </div> <div class="box bottombar" id="topics"> <h2 title="Qt Topics"><span></span> Qt Topics</h2> <div id="list002" class="list"> <ul id="ul002" > <li class="defaultLink"><a href="qt-basic-concepts.html">Programming with Qt</a></li> <li class="defaultLink"><a href="qtquick.html">Device UIs & Qt Quick</a></li> <li class="defaultLink"><a href="qt-gui-concepts.html">UI Design with Qt</a></li> <li class="defaultLink"><a href="supported-platforms.html">Supported Platforms</a></li> <li class="defaultLink"><a href="technology-apis.html">Qt and Key Technologies</a></li> <li class="defaultLink"><a href="best-practices.html">How-To's and Best Practices</a></li> </ul> </div> </div> <div class="box" id="examples"> <h2 title="Examples"><span></span> Examples</h2> <div id="list003" class="list"> <ul id="ul003"> <li class="defaultLink"><a href="all-examples.html">Examples</a></li> <li class="defaultLink"><a href="tutorials.html">Tutorials</a></li> <li class="defaultLink"><a href="demos.html">Demos</a></li> <li class="defaultLink"><a href="qdeclarativeexamples.html">QML Examples</a></li> </ul> </div> </div> </div> <div class="wrap"> <div class="toolbar"> <div class="breadcrumb toolblock"> <ul> <li class="first"><a href="index.html">Home</a></li> <!-- Breadcrumbs go here --> <li><a href="modules.html">Modules</a></li> <li>Qt3SupportLight</li> <li>Q3CString</li> </ul> </div> <div class="toolbuttons toolblock"> <ul> <li id="smallA" class="t_button">A</li> <li id="medA" class="t_button active">A</li> <li id="bigA" class="t_button">A</li> <li id="print" class="t_button"><a href="javascript:this.print();"> <span>Print</span></a></li> </ul> </div> </div> <div class="content mainContent"> <div class="toc"> <h3><a name="toc">Contents</a></h3> <ul> <li class="level1"><a href="#public-functions">Public Functions</a></li> <li class="level1"><a href="#related-non-members">Related Non-Members</a></li> <li class="level1"><a href="#details">Detailed Description</a></li> </ul> </div> <h1 class="title">Q3CString Class Reference</h1> <!-- $$$Q3CString-brief --> <p>The Q3CString class provides an abstraction of the classic C zero-terminated char array (char *). <a href="#details">More...</a></p> <!-- @@@Q3CString --> <pre class="cpp"> <span class="preprocessor">#include <Q3CString></span></pre><p><b>This class is part of the Qt 3 support library.</b> It is provided to keep old source code working. We strongly advise against using it in new code. See <a href="porting4.html#qcstring">Porting to Qt 4</a> for more information.</p> <p><b>Inherits: </b><a href="qbytearray.html">QByteArray</a>.</p> <p><b>Note:</b> All functions in this class are <a href="threads-reentrancy.html#reentrant">reentrant</a>.</p> <ul> <li><a href="q3cstring-members.html">List of all members, including inherited members</a></li> </ul> <a name="public-functions"></a> <h2>Public Functions</h2> <table class="alignedsummary"> <tr><td class="memItemLeft rightAlign topAlign"> </td><td class="memItemRight bottomAlign"><b><a href="q3cstring.html#Q3CString">Q3CString</a></b> ()</td></tr> <tr><td class="memItemLeft rightAlign topAlign"> </td><td class="memItemRight bottomAlign"><b><a href="q3cstring.html#Q3CString-2">Q3CString</a></b> ( int <i>size</i> )</td></tr> <tr><td class="memItemLeft rightAlign topAlign"> </td><td class="memItemRight bottomAlign"><b><a href="q3cstring.html#Q3CString-3">Q3CString</a></b> ( const Q3CString & <i>s</i> )</td></tr> <tr><td class="memItemLeft rightAlign topAlign"> </td><td class="memItemRight bottomAlign"><b><a href="q3cstring.html#Q3CString-4">Q3CString</a></b> ( const QByteArray & <i>ba</i> )</td></tr> <tr><td class="memItemLeft rightAlign topAlign"> </td><td class="memItemRight bottomAlign"><b><a href="q3cstring.html#Q3CString-5">Q3CString</a></b> ( const char * <i>str</i> )</td></tr> <tr><td class="memItemLeft rightAlign topAlign"> </td><td class="memItemRight bottomAlign"><b><a href="q3cstring.html#Q3CString-6">Q3CString</a></b> ( const char * <i>str</i>, uint <i>maxsize</i> )</td></tr> <tr><td class="memItemLeft rightAlign topAlign"> Q3CString & </td><td class="memItemRight bottomAlign"><b><a href="q3cstring.html#append">append</a></b> ( const char * <i>str</i> )</td></tr> <tr><td class="memItemLeft rightAlign topAlign"> Q3CString </td><td class="memItemRight bottomAlign"><b><a href="q3cstring.html#copy">copy</a></b> () const</td></tr> <tr><td class="memItemLeft rightAlign topAlign"> Q3CString </td><td class="memItemRight bottomAlign"><b><a href="q3cstring.html#leftJustify">leftJustify</a></b> ( uint <i>width</i>, char <i>fill</i> = ' ', bool <i>truncate</i> = false ) const</td></tr> <tr><td class="memItemLeft rightAlign topAlign"> Q3CString </td><td class="memItemRight bottomAlign"><b><a href="q3cstring.html#lower">lower</a></b> () const</td></tr> <tr><td class="memItemLeft rightAlign topAlign"> Q3CString </td><td class="memItemRight bottomAlign"><b><a href="q3cstring.html#rightJustify">rightJustify</a></b> ( uint <i>width</i>, char <i>fill</i> = ' ', bool <i>truncate</i> = false ) const</td></tr> <tr><td class="memItemLeft rightAlign topAlign"> bool </td><td class="memItemRight bottomAlign"><b><a href="q3cstring.html#setExpand">setExpand</a></b> ( uint <i>index</i>, char <i>c</i> )</td></tr> <tr><td class="memItemLeft rightAlign topAlign"> Q3CString & </td><td class="memItemRight bottomAlign"><b><a href="q3cstring.html#setNum">setNum</a></b> ( double <i>n</i>, char <i>f</i> = 'g', int <i>prec</i> = 6 )</td></tr> <tr><td class="memItemLeft rightAlign topAlign"> Q3CString & </td><td class="memItemRight bottomAlign"><b><a href="q3cstring.html#setNum-2">setNum</a></b> ( long <i>n</i> )</td></tr> <tr><td class="memItemLeft rightAlign topAlign"> Q3CString & </td><td class="memItemRight bottomAlign"><b><a href="q3cstring.html#setNum-3">setNum</a></b> ( ulong <i>n</i> )</td></tr> <tr><td class="memItemLeft rightAlign topAlign"> Q3CString & </td><td class="memItemRight bottomAlign"><b><a href="q3cstring.html#setNum-4">setNum</a></b> ( int <i>n</i> )</td></tr> <tr><td class="memItemLeft rightAlign topAlign"> Q3CString & </td><td class="memItemRight bottomAlign"><b><a href="q3cstring.html#setNum-5">setNum</a></b> ( uint <i>n</i> )</td></tr> <tr><td class="memItemLeft rightAlign topAlign"> Q3CString & </td><td class="memItemRight bottomAlign"><b><a href="q3cstring.html#setNum-6">setNum</a></b> ( short <i>n</i> )</td></tr> <tr><td class="memItemLeft rightAlign topAlign"> Q3CString & </td><td class="memItemRight bottomAlign"><b><a href="q3cstring.html#setNum-7">setNum</a></b> ( ushort <i>n</i> )</td></tr> <tr><td class="memItemLeft rightAlign topAlign"> Q3CString & </td><td class="memItemRight bottomAlign"><b><a href="q3cstring.html#setNum-8">setNum</a></b> ( float <i>n</i>, char <i>f</i> = 'g', int <i>prec</i> = 6 )</td></tr> <tr><td class="memItemLeft rightAlign topAlign"> Q3CString & </td><td class="memItemRight bottomAlign"><b><a href="q3cstring.html#setStr">setStr</a></b> ( const char * <i>str</i> )</td></tr> <tr><td class="memItemLeft rightAlign topAlign"> Q3CString </td><td class="memItemRight bottomAlign"><b><a href="q3cstring.html#simplifyWhiteSpace">simplifyWhiteSpace</a></b> () const</td></tr> <tr><td class="memItemLeft rightAlign topAlign"> Q3CString & </td><td class="memItemRight bottomAlign"><b><a href="q3cstring.html#sprintf">sprintf</a></b> ( const char * <i>format</i>, ... )</td></tr> <tr><td class="memItemLeft rightAlign topAlign"> Q3CString </td><td class="memItemRight bottomAlign"><b><a href="q3cstring.html#stripWhiteSpace">stripWhiteSpace</a></b> () const</td></tr> <tr><td class="memItemLeft rightAlign topAlign"> double </td><td class="memItemRight bottomAlign"><b><a href="q3cstring.html#toDouble">toDouble</a></b> ( bool * <i>ok</i> = 0 ) const</td></tr> <tr><td class="memItemLeft rightAlign topAlign"> float </td><td class="memItemRight bottomAlign"><b><a href="q3cstring.html#toFloat">toFloat</a></b> ( bool * <i>ok</i> = 0 ) const</td></tr> <tr><td class="memItemLeft rightAlign topAlign"> int </td><td class="memItemRight bottomAlign"><b><a href="q3cstring.html#toInt">toInt</a></b> ( bool * <i>ok</i> = 0 ) const</td></tr> <tr><td class="memItemLeft rightAlign topAlign"> long </td><td class="memItemRight bottomAlign"><b><a href="q3cstring.html#toLong">toLong</a></b> ( bool * <i>ok</i> = 0 ) const</td></tr> <tr><td class="memItemLeft rightAlign topAlign"> short </td><td class="memItemRight bottomAlign"><b><a href="q3cstring.html#toShort">toShort</a></b> ( bool * <i>ok</i> = 0 ) const</td></tr> <tr><td class="memItemLeft rightAlign topAlign"> uint </td><td class="memItemRight bottomAlign"><b><a href="q3cstring.html#toUInt">toUInt</a></b> ( bool * <i>ok</i> = 0 ) const</td></tr> <tr><td class="memItemLeft rightAlign topAlign"> ulong </td><td class="memItemRight bottomAlign"><b><a href="q3cstring.html#toULong">toULong</a></b> ( bool * <i>ok</i> = 0 ) const</td></tr> <tr><td class="memItemLeft rightAlign topAlign"> ushort </td><td class="memItemRight bottomAlign"><b><a href="q3cstring.html#toUShort">toUShort</a></b> ( bool * <i>ok</i> = 0 ) const</td></tr> <tr><td class="memItemLeft rightAlign topAlign"> Q3CString </td><td class="memItemRight bottomAlign"><b><a href="q3cstring.html#upper">upper</a></b> () const</td></tr> <tr><td class="memItemLeft rightAlign topAlign"> Q3CString & </td><td class="memItemRight bottomAlign"><b><a href="q3cstring.html#operator-eq">operator=</a></b> ( const Q3CString & <i>s</i> )</td></tr> <tr><td class="memItemLeft rightAlign topAlign"> Q3CString & </td><td class="memItemRight bottomAlign"><b><a href="q3cstring.html#operator-eq-2">operator=</a></b> ( const QByteArray & <i>ba</i> )</td></tr> <tr><td class="memItemLeft rightAlign topAlign"> Q3CString & </td><td class="memItemRight bottomAlign"><b><a href="q3cstring.html#operator-eq-3">operator=</a></b> ( const char * <i>str</i> )</td></tr> </table> <ul> <li class="fn">124 public functions inherited from <a href="qbytearray.html#public-functions">QByteArray</a></li> </ul> <a name="related-non-members"></a> <h2>Related Non-Members</h2> <table class="alignedsummary"> <tr><td class="memItemLeft rightAlign topAlign"> Q_COMPAT_EXPORT_INLINE </td><td class="memItemRight bottomAlign"><b><a href="q3cstring.html#operator-not-eq-47">operator!=</a></b> ( const Q3CString & <i>s1</i>, const Q3CString & <i>s2</i> )</td></tr> <tr><td class="memItemLeft rightAlign topAlign"> Q_COMPAT_EXPORT_INLINE </td><td class="memItemRight bottomAlign"><b><a href="q3cstring.html#operator-not-eq-70">operator!=</a></b> ( const Q3CString & <i>s1</i>, const char * <i>s2</i> )</td></tr> <tr><td class="memItemLeft rightAlign topAlign"> Q_COMPAT_EXPORT_INLINE </td><td class="memItemRight bottomAlign"><b><a href="q3cstring.html#operator-not-eq-71">operator!=</a></b> ( const char * <i>s1</i>, const Q3CString & <i>s2</i> )</td></tr> <tr><td class="memItemLeft rightAlign topAlign"> Q_COMPAT_EXPORT_INLINE const </td><td class="memItemRight bottomAlign"><b><a href="q3cstring.html#operator-2b-44">operator+</a></b> ( const Q3CString & <i>s1</i>, const char * <i>s2</i> )</td></tr> <tr><td class="memItemLeft rightAlign topAlign"> Q_COMPAT_EXPORT_INLINE const </td><td class="memItemRight bottomAlign"><b><a href="q3cstring.html#operator-2b-45">operator+</a></b> ( const char * <i>s1</i>, const Q3CString & <i>s2</i> )</td></tr> <tr><td class="memItemLeft rightAlign topAlign"> Q_COMPAT_EXPORT_INLINE const </td><td class="memItemRight bottomAlign"><b><a href="q3cstring.html#operator-2b-46">operator+</a></b> ( const Q3CString & <i>s</i>, char <i>c</i> )</td></tr> <tr><td class="memItemLeft rightAlign topAlign"> Q_COMPAT_EXPORT_INLINE const </td><td class="memItemRight bottomAlign"><b><a href="q3cstring.html#operator-2b-47">operator+</a></b> ( char <i>c</i>, const Q3CString & <i>s</i> )</td></tr> <tr><td class="memItemLeft rightAlign topAlign"> Q_COMPAT_EXPORT_INLINE const </td><td class="memItemRight bottomAlign"><b><a href="q3cstring.html#operator-2b-31">operator+</a></b> ( const Q3CString & <i>s1</i>, const Q3CString & <i>s2</i> )</td></tr> <tr><td class="memItemLeft rightAlign topAlign"> Q_COMPAT_EXPORT_INLINE </td><td class="memItemRight bottomAlign"><b><a href="q3cstring.html#operator-lt-17">operator<</a></b> ( const Q3CString & <i>s1</i>, const char * <i>s2</i> )</td></tr> <tr><td class="memItemLeft rightAlign topAlign"> Q_COMPAT_EXPORT_INLINE </td><td class="memItemRight bottomAlign"><b><a href="q3cstring.html#operator-lt-22">operator<</a></b> ( const char * <i>s1</i>, const Q3CString & <i>s2</i> )</td></tr> <tr><td class="memItemLeft rightAlign topAlign"> QDataStream & </td><td class="memItemRight bottomAlign"><b><a href="q3cstring.html#operator-lt-lt-132">operator<<</a></b> ( QDataStream & <i>s</i>, const Q3CString & <i>str</i> )</td></tr> <tr><td class="memItemLeft rightAlign topAlign"> Q_COMPAT_EXPORT_INLINE </td><td class="memItemRight bottomAlign"><b><a href="q3cstring.html#operator-lt-eq-11">operator<=</a></b> ( const Q3CString & <i>s1</i>, const char * <i>s2</i> )</td></tr> <tr><td class="memItemLeft rightAlign topAlign"> Q_COMPAT_EXPORT_INLINE </td><td class="memItemRight bottomAlign"><b><a href="q3cstring.html#operator-lt-eq-16">operator<=</a></b> ( const char * <i>s1</i>, const Q3CString & <i>s2</i> )</td></tr> <tr><td class="memItemLeft rightAlign topAlign"> Q_COMPAT_EXPORT_INLINE </td><td class="memItemRight bottomAlign"><b><a href="q3cstring.html#operator-eq-eq-68">operator==</a></b> ( const Q3CString & <i>s1</i>, const Q3CString & <i>s2</i> )</td></tr> <tr><td class="memItemLeft rightAlign topAlign"> Q_COMPAT_EXPORT_INLINE </td><td class="memItemRight bottomAlign"><b><a href="q3cstring.html#operator-eq-eq-99">operator==</a></b> ( const Q3CString & <i>s1</i>, const char * <i>s2</i> )</td></tr> <tr><td class="memItemLeft rightAlign topAlign"> Q_COMPAT_EXPORT_INLINE </td><td class="memItemRight bottomAlign"><b><a href="q3cstring.html#operator-eq-eq-100">operator==</a></b> ( const char * <i>s1</i>, const Q3CString & <i>s2</i> )</td></tr> <tr><td class="memItemLeft rightAlign topAlign"> Q_COMPAT_EXPORT_INLINE </td><td class="memItemRight bottomAlign"><b><a href="q3cstring.html#operator-gt-11">operator></a></b> ( const Q3CString & <i>s1</i>, const char * <i>s2</i> )</td></tr> <tr><td class="memItemLeft rightAlign topAlign"> Q_COMPAT_EXPORT_INLINE </td><td class="memItemRight bottomAlign"><b><a href="q3cstring.html#operator-gt-16">operator></a></b> ( const char * <i>s1</i>, const Q3CString & <i>s2</i> )</td></tr> <tr><td class="memItemLeft rightAlign topAlign"> Q_COMPAT_EXPORT_INLINE </td><td class="memItemRight bottomAlign"><b><a href="q3cstring.html#operator-gt-eq-11">operator>=</a></b> ( const Q3CString & <i>s1</i>, const char * <i>s2</i> )</td></tr> <tr><td class="memItemLeft rightAlign topAlign"> Q_COMPAT_EXPORT_INLINE </td><td class="memItemRight bottomAlign"><b><a href="q3cstring.html#operator-gt-eq-16">operator>=</a></b> ( const char * <i>s1</i>, const Q3CString & <i>s2</i> )</td></tr> <tr><td class="memItemLeft rightAlign topAlign"> QDataStream & </td><td class="memItemRight bottomAlign"><b><a href="q3cstring.html#operator-gt-gt-68">operator>></a></b> ( QDataStream & <i>s</i>, Q3CString & <i>str</i> )</td></tr> </table> <h3>Additional Inherited Members</h3> <ul> <li class="fn">9 static public members inherited from <a href="qbytearray.html#static-public-members">QByteArray</a></li> </ul> <a name="details"></a> <!-- $$$Q3CString-description --> <div class="descr"> <h2>Detailed Description</h2> <p>The Q3CString class provides an abstraction of the classic C zero-terminated char array (char *).</p> <p>Q3CString tries to behave like a more convenient <tt>const char *</tt>. The price of doing this is that some algorithms will perform badly. For example, <a href="q3cstring.html#append">append</a>() is O(<a href="qbytearray.html#length">length</a>()) since it scans for a null terminator. Although you might use Q3CString for text that is never exposed to the user, for most purposes, and especially for user-visible text, you should use <a href="qstring.html">QString</a>. <a href="qstring.html">QString</a> provides implicit sharing, Unicode and other internationalization support, and is well optimized.</p> <p>Note that for the Q3CString methods that take a <tt>const char *</tt> parameter the <tt>const char *</tt> must either be 0 (null) or not-null and '\0' (NUL byte) terminated; otherwise the results are undefined.</p> <p>A default constructed Q3CString is <i>null</i>, i.e. both the length and the data pointer are 0 and <a href="qbytearray.html#isNull">isNull</a>() returns true.</p> <p><b>Note:</b> However, if you ask for the data pointer of a null Q3CString by calling <a href="qbytearray.html#data">data</a>(), then because the internal representation of the null Q3CString is shared, it will be detached and replaced with a non-shared, empty representation, a non-null data pointer will be returned, and subsequent calls to <a href="qbytearray.html#isNull">isNull</a>() will return false. But if you ask for the data pointer of a null Q3CString by calling <a href="qbytearray.html#constData">constData</a>(), the shared internal representation is not detached, a null data pointer is returned, and subsequent calls to <a href="qbytearray.html#isNull">isNull</a>() will continue to return true.</p> <p>A Q3CString that references the empty string ("", a single '\0' char) is <i>empty</i>, i.e. <a href="qbytearray.html#isEmpty">isEmpty</a>() returns true. Both null and empty Q3CStrings are legal parameters to the methods. Assigning <tt>const char *</tt> 0 to Q3CString produces a null Q3CString.</p> <p>The <a href="qbytearray.html#length">length</a>() function returns the length of the string; <a href="qbytearray.html#resize">resize</a>() resizes the string and <a href="qbytearray.html#truncate">truncate</a>() truncates the string. A string can be filled with a character using <a href="qbytearray.html#fill">fill</a>(). Strings can be left or right padded with characters using <a href="q3cstring.html#leftJustify">leftJustify</a>() and <a href="q3cstring.html#rightJustify">rightJustify</a>(). Characters, strings and regular expressions can be searched for using <a href="qbytearray-qt3.html#find">find</a>() and <a href="qbytearray-qt3.html#findRev">findRev</a>(), and counted using <a href="qbytearray.html#contains">contains</a>().</p> <p>Strings and characters can be inserted with insert() and appended with <a href="q3cstring.html#append">append</a>(). A string can be prepended with prepend(). Characters can be removed from the string with remove() and replaced with replace().</p> <p>Portions of a string can be extracted using left(), right() and mid(). Whitespace can be removed using <a href="q3cstring.html#stripWhiteSpace">stripWhiteSpace</a>() and <a href="q3cstring.html#simplifyWhiteSpace">simplifyWhiteSpace</a>(). Strings can be converted to uppercase or lowercase with <a href="q3cstring.html#upper">upper</a>() and <a href="q3cstring.html#lower">lower</a>() respectively.</p> <p>Strings that contain numbers can be converted to numbers with <a href="q3cstring.html#toShort">toShort</a>(), <a href="q3cstring.html#toInt">toInt</a>(), <a href="q3cstring.html#toLong">toLong</a>(), <a href="q3cstring.html#toULong">toULong</a>(), <a href="q3cstring.html#toFloat">toFloat</a>() and <a href="q3cstring.html#toDouble">toDouble</a>(). Numbers can be converted to strings with <a href="q3cstring.html#setNum">setNum</a>().</p> <p>Many operators are overloaded to work with Q3CStrings. Q3CString also supports some more obscure functions, e.g. <a href="q3cstring.html#sprintf">sprintf</a>(), <a href="q3cstring.html#setStr">setStr</a>() and <a href="q3cstring.html#setExpand">setExpand</a>().</p> <p>Note on Character Comparisons</p> <p>In Q3CString the notion of uppercase and lowercase and of which character is greater than or less than another character is locale dependent. This affects functions which support a case insensitive option or which compare or lowercase or uppercase their arguments. Case insensitive operations and comparisons will be accurate if both strings contain only ASCII characters. (If <tt>$LC_CTYPE</tt> is set, most Unix systems do "the right thing".) Functions that this affects include <a href="qbytearray.html#contains">contains</a>(), <a href="qbytearray-qt3.html#find">find</a>(), <a href="qbytearray-qt3.html#findRev">findRev</a>(), <a href="qbytearray.html#operator-lt">operator<</a>(), <a href="qbytearray.html#operator-lt-eq">operator<=</a>(), <a href="qbytearray.html#operator-gt">operator></a>(), <a href="qbytearray.html#operator-gt-eq">operator>=</a>(), <a href="q3cstring.html#lower">lower</a>() and <a href="q3cstring.html#upper">upper</a>().</p> <p>This issue does not apply to <a href="qstring.html">QString</a>s since they represent characters using Unicode.</p> <p>Performance note: The Q3CString methods for <a href="qregexp.html">QRegExp</a> searching are implemented by converting the Q3CString to a <a href="qstring.html">QString</a> and performing the search on that. This implies a deep copy of the Q3CString data. If you are going to perform many <a href="qregexp.html">QRegExp</a> searches on a large Q3CString, you will get better performance by converting the Q3CString to a <a href="qstring.html">QString</a> yourself, and then searching in the <a href="qstring.html">QString</a>.</p> </div> <!-- @@@Q3CString --> <div class="func"> <h2>Member Function Documentation</h2> <!-- $$$Q3CString[overload1]$$$Q3CString --> <h3 class="fn"><a name="Q3CString"></a>Q3CString::<span class="name">Q3CString</span> ()</h3> <p>Constructs a null string.</p> <p><b>See also </b><a href="qbytearray.html#isNull">isNull</a>().</p> <!-- @@@Q3CString --> <!-- $$$Q3CString$$$Q3CStringint --> <h3 class="fn"><a name="Q3CString-2"></a>Q3CString::<span class="name">Q3CString</span> ( <span class="type">int</span> <i>size</i> )</h3> <p>Constructs a string with room for <i>size</i> characters, including the '\0'-terminator. Makes a null string if <i>size</i> == 0.</p> <p>If <i>size</i> > 0, then the first and last characters in the string are initialized to '\0'. All other characters are uninitialized.</p> <p><b>See also </b><a href="qbytearray.html#resize">resize</a>() and <a href="qbytearray.html#isNull">isNull</a>().</p> <!-- @@@Q3CString --> <!-- $$$Q3CString$$$Q3CStringconstQ3CString& --> <h3 class="fn"><a name="Q3CString-3"></a>Q3CString::<span class="name">Q3CString</span> ( const <span class="type">Q3CString</span> & <i>s</i> )</h3> <p>Constructs a shallow copy <i>s</i>.</p> <!-- @@@Q3CString --> <!-- $$$Q3CString$$$Q3CStringconstQByteArray& --> <h3 class="fn"><a name="Q3CString-4"></a>Q3CString::<span class="name">Q3CString</span> ( const <span class="type"><a href="qbytearray.html">QByteArray</a></span> & <i>ba</i> )</h3> <p>Constructs a copy of <i>ba</i>.</p> <!-- @@@Q3CString --> <!-- $$$Q3CString$$$Q3CStringconstchar* --> <h3 class="fn"><a name="Q3CString-5"></a>Q3CString::<span class="name">Q3CString</span> ( const <span class="type">char</span> * <i>str</i> )</h3> <p>Constructs a string that is a deep copy of <i>str</i>.</p> <p>If <i>str</i> is 0 a null string is created.</p> <p><b>See also </b><a href="qbytearray.html#isNull">isNull</a>().</p> <!-- @@@Q3CString --> <!-- $$$Q3CString$$$Q3CStringconstchar*uint --> <h3 class="fn"><a name="Q3CString-6"></a>Q3CString::<span class="name">Q3CString</span> ( const <span class="type">char</span> * <i>str</i>, <span class="type"><a href="qtglobal.html#uint-typedef">uint</a></span> <i>maxsize</i> )</h3> <p>Constructs a string that is a deep copy of <i>str</i>. The copy will be at most <i>maxsize</i> bytes long including the '\0'-terminator.</p> <p>Example:</p> <pre class="cpp"> <span class="type"><a href="q3cstring.html">Q3CString</a></span> str(<span class="string">"helloworld"</span><span class="operator">,</span> <span class="number">6</span>); <span class="comment">// assigns "hello" to str</span></pre> <p>If <i>str</i> contains a 0 byte within the first <i>maxsize</i> bytes, the resulting <a href="q3cstring.html" class="compat">Q3CString</a> will be terminated by this 0. If <i>str</i> is 0 a null string is created.</p> <p><b>See also </b><a href="qbytearray.html#isNull">isNull</a>().</p> <!-- @@@Q3CString --> <!-- $$$append[overload1]$$$appendconstchar* --> <h3 class="fn"><a name="append"></a><span class="type">Q3CString</span> & Q3CString::<span class="name">append</span> ( const <span class="type">char</span> * <i>str</i> )</h3> <p>Appends string <i>str</i> to the string and returns a reference to the string. Equivalent to operator+=().</p> <!-- @@@append --> <!-- $$$copy[overload1]$$$copy --> <h3 class="fn"><a name="copy"></a><span class="type">Q3CString</span> Q3CString::<span class="name">copy</span> () const</h3> <p>Returns a deep copy of this string.</p> <!-- @@@copy --> <!-- $$$leftJustify[overload1]$$$leftJustifyuintcharbool --> <h3 class="fn"><a name="leftJustify"></a><span class="type">Q3CString</span> Q3CString::<span class="name">leftJustify</span> ( <span class="type"><a href="qtglobal.html#uint-typedef">uint</a></span> <i>width</i>, <span class="type">char</span> <i>fill</i> = ' ', <span class="type">bool</span> <i>truncate</i> = false ) const</h3> <p>Returns a string of length <i>width</i> (plus one for the terminating '\0') that contains this string padded with the <i>fill</i> character.</p> <p>If the length of the string exceeds <i>width</i> and <i>truncate</i> is false (the default), then the returned string is a copy of the string. If the length of the string exceeds <i>width</i> and <i>truncate</i> is true, then the returned string is a left(<i>width</i>).</p> <p>Example:</p> <pre class="cpp"> <span class="type"><a href="q3cstring.html">Q3CString</a></span> s(<span class="string">"apple"</span>); <span class="type"><a href="q3cstring.html">Q3CString</a></span> t <span class="operator">=</span> s<span class="operator">.</span>leftJustify(<span class="number">8</span><span class="operator">,</span> <span class="char">'.'</span>); <span class="comment">// t == "apple..."</span></pre> <p><b>See also </b><a href="q3cstring.html#rightJustify">rightJustify</a>().</p> <!-- @@@leftJustify --> <!-- $$$lower[overload1]$$$lower --> <h3 class="fn"><a name="lower"></a><span class="type">Q3CString</span> Q3CString::<span class="name">lower</span> () const</h3> <p>Use <a href="qbytearray.html#toLower">QByteArray::toLower</a>() instead.</p> <!-- @@@lower --> <!-- $$$rightJustify[overload1]$$$rightJustifyuintcharbool --> <h3 class="fn"><a name="rightJustify"></a><span class="type">Q3CString</span> Q3CString::<span class="name">rightJustify</span> ( <span class="type"><a href="qtglobal.html#uint-typedef">uint</a></span> <i>width</i>, <span class="type">char</span> <i>fill</i> = ' ', <span class="type">bool</span> <i>truncate</i> = false ) const</h3> <p>Returns a string of length <i>width</i> (plus one for the terminating '\0') that contains zero or more of the <i>fill</i> character followed by this string.</p> <p>If the length of the string exceeds <i>width</i> and <i>truncate</i> is false (the default), then the returned string is a copy of the string. If the length of the string exceeds <i>width</i> and <i>truncate</i> is true, then the returned string is a left(<i>width</i>).</p> <p>Example:</p> <pre class="cpp"> <span class="type"><a href="q3cstring.html">Q3CString</a></span> s(<span class="string">"pie"</span>); <span class="type"><a href="q3cstring.html">Q3CString</a></span> t <span class="operator">=</span> s<span class="operator">.</span>rightJustify(<span class="number">8</span><span class="operator">,</span> <span class="char">'.'</span>); <span class="comment">// t == ".....pie"</span></pre> <p><b>See also </b><a href="q3cstring.html#leftJustify">leftJustify</a>().</p> <!-- @@@rightJustify --> <!-- $$$setExpand[overload1]$$$setExpanduintchar --> <h3 class="fn"><a name="setExpand"></a><span class="type">bool</span> Q3CString::<span class="name">setExpand</span> ( <span class="type"><a href="qtglobal.html#uint-typedef">uint</a></span> <i>index</i>, <span class="type">char</span> <i>c</i> )</h3> <p>Sets the character at position <i>index</i> to <i>c</i> and expands the string if necessary, padding with spaces.</p> <p>Returns false if <i>index</i> was out of range and the string could not be expanded; otherwise returns true.</p> <!-- @@@setExpand --> <!-- $$$setNum[overload1]$$$setNumdoublecharint --> <h3 class="fn"><a name="setNum"></a><span class="type">Q3CString</span> & Q3CString::<span class="name">setNum</span> ( <span class="type">double</span> <i>n</i>, <span class="type">char</span> <i>f</i> = 'g', <span class="type">int</span> <i>prec</i> = 6 )</h3> <p>Sets the string to the string representation of the number <i>n</i> and returns a reference to the string.</p> <p>The format of the string representation is specified by the format character <i>f</i>, and the precision (number of digits after the decimal point) is specified with <i>prec</i>.</p> <p>The valid formats for <i>f</i> are 'e', 'E', 'f', 'g' and 'G'. The formats are the same as for <a href="q3cstring.html#sprintf">sprintf</a>(); they are explained in <a href="qstring.html#arg">QString::arg</a>().</p> <!-- @@@setNum --> <!-- $$$setNum$$$setNumlong --> <h3 class="fn"><a name="setNum-2"></a><span class="type">Q3CString</span> & Q3CString::<span class="name">setNum</span> ( <span class="type">long</span> <i>n</i> )</h3> <p>This is an overloaded function.</p> <p>Sets the string to the string representation of the number <i>n</i> and returns a reference to the string.</p> <!-- @@@setNum --> <!-- $$$setNum$$$setNumulong --> <h3 class="fn"><a name="setNum-3"></a><span class="type">Q3CString</span> & Q3CString::<span class="name">setNum</span> ( <span class="type"><a href="qtglobal.html#ulong-typedef">ulong</a></span> <i>n</i> )</h3> <p>This is an overloaded function.</p> <p>Sets the string to the string representation of the number <i>n</i> and returns a reference to the string.</p> <!-- @@@setNum --> <!-- $$$setNum$$$setNumint --> <h3 class="fn"><a name="setNum-4"></a><span class="type">Q3CString</span> & Q3CString::<span class="name">setNum</span> ( <span class="type">int</span> <i>n</i> )</h3> <p>This is an overloaded function.</p> <p>Sets the string to the string representation of the number <i>n</i> and returns a reference to the string.</p> <!-- @@@setNum --> <!-- $$$setNum$$$setNumuint --> <h3 class="fn"><a name="setNum-5"></a><span class="type">Q3CString</span> & Q3CString::<span class="name">setNum</span> ( <span class="type"><a href="qtglobal.html#uint-typedef">uint</a></span> <i>n</i> )</h3> <p>This is an overloaded function.</p> <p>Sets the string to the string representation of the number <i>n</i> and returns a reference to the string.</p> <!-- @@@setNum --> <!-- $$$setNum$$$setNumshort --> <h3 class="fn"><a name="setNum-6"></a><span class="type">Q3CString</span> & Q3CString::<span class="name">setNum</span> ( <span class="type">short</span> <i>n</i> )</h3> <p>This is an overloaded function.</p> <p>Sets the string to the string representation of the number <i>n</i> and returns a reference to the string.</p> <!-- @@@setNum --> <!-- $$$setNum$$$setNumushort --> <h3 class="fn"><a name="setNum-7"></a><span class="type">Q3CString</span> & Q3CString::<span class="name">setNum</span> ( <span class="type"><a href="qtglobal.html#ushort-typedef">ushort</a></span> <i>n</i> )</h3> <p>This is an overloaded function.</p> <p>Sets the string to the string representation of the number <i>n</i> and returns a reference to the string.</p> <!-- @@@setNum --> <!-- $$$setNum$$$setNumfloatcharint --> <h3 class="fn"><a name="setNum-8"></a><span class="type">Q3CString</span> & Q3CString::<span class="name">setNum</span> ( <span class="type">float</span> <i>n</i>, <span class="type">char</span> <i>f</i> = 'g', <span class="type">int</span> <i>prec</i> = 6 )</h3> <p>This is an overloaded function.</p> <!-- @@@setNum --> <!-- $$$setStr[overload1]$$$setStrconstchar* --> <h3 class="fn"><a name="setStr"></a><span class="type">Q3CString</span> & Q3CString::<span class="name">setStr</span> ( const <span class="type">char</span> * <i>str</i> )</h3> <p>Makes a deep copy of <i>str</i>. Returns a reference to the string.</p> <!-- @@@setStr --> <!-- $$$simplifyWhiteSpace[overload1]$$$simplifyWhiteSpace --> <h3 class="fn"><a name="simplifyWhiteSpace"></a><span class="type">Q3CString</span> Q3CString::<span class="name">simplifyWhiteSpace</span> () const</h3> <p>Use <a href="qbytearray.html#simplified">QByteArray::simplified</a>() instead.</p> <!-- @@@simplifyWhiteSpace --> <!-- $$$sprintf[overload1]$$$sprintfconstchar*... --> <h3 class="fn"><a name="sprintf"></a><span class="type">Q3CString</span> & Q3CString::<span class="name">sprintf</span> ( const <span class="type">char</span> * <i>format</i>, ... )</h3> <p>Implemented as a call to the native vsprintf() (see the manual for your C library).</p> <p>If 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.</p> <p>Example:</p> <pre class="cpp"> <span class="type"><a href="q3cstring.html">Q3CString</a></span> s; s<span class="operator">.</span>sprintf(<span class="string">"%d - %s"</span><span class="operator">,</span> <span class="number">1</span><span class="operator">,</span> <span class="string">"first"</span>); <span class="comment">// result < 256 chars</span> <span class="type"><a href="q3cstring.html">Q3CString</a></span> big(<span class="number">25000</span>); <span class="comment">// very long string</span> big<span class="operator">.</span>sprintf(<span class="string">"%d - %s"</span><span class="operator">,</span> <span class="number">2</span><span class="operator">,</span> longString); <span class="comment">// result < 25000 chars</span></pre> <p><b>Warning:</b> All vsprintf() implementations will write past the end of the target string (*this) if the <i>format</i> 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.</p> <p>Giving user-supplied arguments to sprintf() is risky: Sooner or later someone will paste a huge line into your application.</p> <!-- @@@sprintf --> <!-- $$$stripWhiteSpace[overload1]$$$stripWhiteSpace --> <h3 class="fn"><a name="stripWhiteSpace"></a><span class="type">Q3CString</span> Q3CString::<span class="name">stripWhiteSpace</span> () const</h3> <p>Use <a href="qbytearray.html#trimmed">QByteArray::trimmed</a>() instead.</p> <!-- @@@stripWhiteSpace --> <!-- $$$toDouble[overload1]$$$toDoublebool* --> <h3 class="fn"><a name="toDouble"></a><span class="type">double</span> Q3CString::<span class="name">toDouble</span> ( <span class="type">bool</span> * <i>ok</i> = 0 ) const</h3> <p>Returns the string converted to a <tt>double</tt> value.</p> <p>If <i>ok</i> is not 0: *<i>ok</i> is set to false if the string is not a number, or if it has trailing garbage; otherwise *<i>ok</i> is set to true.</p> <!-- @@@toDouble --> <!-- $$$toFloat[overload1]$$$toFloatbool* --> <h3 class="fn"><a name="toFloat"></a><span class="type">float</span> Q3CString::<span class="name">toFloat</span> ( <span class="type">bool</span> * <i>ok</i> = 0 ) const</h3> <p>Returns the string converted to a <tt>float</tt> value.</p> <p>If <i>ok</i> is not 0: *<i>ok</i> is set to false if the string is not a number, or if it has trailing garbage; otherwise *<i>ok</i> is set to true.</p> <!-- @@@toFloat --> <!-- $$$toInt[overload1]$$$toIntbool* --> <h3 class="fn"><a name="toInt"></a><span class="type">int</span> Q3CString::<span class="name">toInt</span> ( <span class="type">bool</span> * <i>ok</i> = 0 ) const</h3> <p>Returns the string converted to a <tt>int</tt> value.</p> <p>If <i>ok</i> is not 0: *<i>ok</i> is set to false if the string is not a number, or if it has trailing garbage; otherwise *<i>ok</i> is set to true.</p> <!-- @@@toInt --> <!-- $$$toLong[overload1]$$$toLongbool* --> <h3 class="fn"><a name="toLong"></a><span class="type">long</span> Q3CString::<span class="name">toLong</span> ( <span class="type">bool</span> * <i>ok</i> = 0 ) const</h3> <p>Returns the string converted to a <tt>long</tt> value.</p> <p>If <i>ok</i> is not 0: *<i>ok</i> is set to false if the string is not a number, or if it has trailing garbage; otherwise *<i>ok</i> is set to true.</p> <!-- @@@toLong --> <!-- $$$toShort[overload1]$$$toShortbool* --> <h3 class="fn"><a name="toShort"></a><span class="type">short</span> Q3CString::<span class="name">toShort</span> ( <span class="type">bool</span> * <i>ok</i> = 0 ) const</h3> <p>Returns the string converted to a <tt>short</tt> value.</p> <p>If <i>ok</i> is not 0: *<i>ok</i> is set to false if the string is not a number, is out of range, or if it has trailing garbage; otherwise *<i>ok</i> is set to true.</p> <!-- @@@toShort --> <!-- $$$toUInt[overload1]$$$toUIntbool* --> <h3 class="fn"><a name="toUInt"></a><span class="type"><a href="qtglobal.html#uint-typedef">uint</a></span> Q3CString::<span class="name">toUInt</span> ( <span class="type">bool</span> * <i>ok</i> = 0 ) const</h3> <p>Returns the string converted to an <tt>unsigned int</tt> value.</p> <p>If <i>ok</i> is not 0: *<i>ok</i> is set to false if the string is not a number, or if it has trailing garbage; otherwise *<i>ok</i> is set to true.</p> <!-- @@@toUInt --> <!-- $$$toULong[overload1]$$$toULongbool* --> <h3 class="fn"><a name="toULong"></a><span class="type"><a href="qtglobal.html#ulong-typedef">ulong</a></span> Q3CString::<span class="name">toULong</span> ( <span class="type">bool</span> * <i>ok</i> = 0 ) const</h3> <p>Returns the string converted to an <tt>unsigned long</tt> value.</p> <p>If <i>ok</i> is not 0: *<i>ok</i> is set to false if the string is not a number, or if it has trailing garbage; otherwise *<i>ok</i> is set to true.</p> <!-- @@@toULong --> <!-- $$$toUShort[overload1]$$$toUShortbool* --> <h3 class="fn"><a name="toUShort"></a><span class="type"><a href="qtglobal.html#ushort-typedef">ushort</a></span> Q3CString::<span class="name">toUShort</span> ( <span class="type">bool</span> * <i>ok</i> = 0 ) const</h3> <p>Returns the string converted to an <tt>unsigned short</tt> value.</p> <p>If <i>ok</i> is not 0: *<i>ok</i> is set to false if the string is not a number, is out of range, or if it has trailing garbage; otherwise *<i>ok</i> is set to true.</p> <!-- @@@toUShort --> <!-- $$$upper[overload1]$$$upper --> <h3 class="fn"><a name="upper"></a><span class="type">Q3CString</span> Q3CString::<span class="name">upper</span> () const</h3> <p>Use <a href="qbytearray.html#toUpper">QByteArray::toUpper</a>() instead.</p> <!-- @@@upper --> <!-- $$$operator=[overload1]$$$operator=constQ3CString& --> <h3 class="fn"><a name="operator-eq"></a><span class="type">Q3CString</span> & Q3CString::<span class="name">operator=</span> ( const <span class="type">Q3CString</span> & <i>s</i> )</h3> <p>Assigns a shallow copy of <i>s</i> to this string and returns a reference to this string.</p> <!-- @@@operator= --> <!-- $$$operator=$$$operator=constQByteArray& --> <h3 class="fn"><a name="operator-eq-2"></a><span class="type">Q3CString</span> & Q3CString::<span class="name">operator=</span> ( const <span class="type"><a href="qbytearray.html">QByteArray</a></span> & <i>ba</i> )</h3> <p>Assigns byte array <i>ba</i> to this <a href="q3cstring.html" class="compat">Q3CString</a>.</p> <!-- @@@operator= --> <!-- $$$operator=$$$operator=constchar* --> <h3 class="fn"><a name="operator-eq-3"></a><span class="type">Q3CString</span> & Q3CString::<span class="name">operator=</span> ( const <span class="type">char</span> * <i>str</i> )</h3> <p>This is an overloaded function.</p> <p>Assigns a deep copy of <i>str</i> to this string and returns a reference to this string.</p> <p>If <i>str</i> is 0 a null string is created.</p> <p><b>See also </b><a href="qbytearray.html#isNull">isNull</a>().</p> <!-- @@@operator= --> </div> <div class="relnonmem"> <h2>Related Non-Members</h2> <!-- $$$operator!=$$$operator!=constQ3CString&constQ3CString& --> <h3 class="fn"><a name="operator-not-eq-47"></a><span class="type">Q_COMPAT_EXPORT_INLINE</span> <span class="name">operator!=</span> ( const <span class="type">Q3CString</span> & <i>s1</i>, const <span class="type">Q3CString</span> & <i>s2</i> )</h3> <p>Returns true if <i>s1</i> and <i>s2</i> are different; otherwise returns false.</p> <p>Equivalent to qstrcmp(<i>s1</i>, <i>s2</i>) != 0.</p> <!-- @@@operator!= --> <!-- $$$operator!=$$$operator!=constQ3CString&constchar* --> <h3 class="fn"><a name="operator-not-eq-70"></a><span class="type">Q_COMPAT_EXPORT_INLINE</span> <span class="name">operator!=</span> ( const <span class="type">Q3CString</span> & <i>s1</i>, const <span class="type">char</span> * <i>s2</i> )</h3> <p>This is an overloaded function.</p> <p>Returns true if <i>s1</i> and <i>s2</i> are different; otherwise returns false.</p> <p>Equivalent to qstrcmp(<i>s1</i>, <i>s2</i>) != 0.</p> <!-- @@@operator!= --> <!-- $$$operator!=$$$operator!=constchar*constQ3CString& --> <h3 class="fn"><a name="operator-not-eq-71"></a><span class="type">Q_COMPAT_EXPORT_INLINE</span> <span class="name">operator!=</span> ( const <span class="type">char</span> * <i>s1</i>, const <span class="type">Q3CString</span> & <i>s2</i> )</h3> <p>This is an overloaded function.</p> <p>Returns true if <i>s1</i> and <i>s2</i> are different; otherwise returns false.</p> <p>Equivalent to qstrcmp(<i>s1</i>, <i>s2</i>) != 0.</p> <!-- @@@operator!= --> <!-- $$$operator+$$$operator+constQ3CString&constchar* --> <h3 class="fn"><a name="operator-2b-44"></a><span class="type">Q_COMPAT_EXPORT_INLINE</span> const <span class="name">operator+</span> ( const <span class="type">Q3CString</span> & <i>s1</i>, const <span class="type">char</span> * <i>s2</i> )</h3> <p>This is an overloaded function.</p> <p>Returns a string which consists of the concatenation of <i>s1</i> and <i>s2</i>.</p> <!-- @@@operator+ --> <!-- $$$operator+$$$operator+constchar*constQ3CString& --> <h3 class="fn"><a name="operator-2b-45"></a><span class="type">Q_COMPAT_EXPORT_INLINE</span> const <span class="name">operator+</span> ( const <span class="type">char</span> * <i>s1</i>, const <span class="type">Q3CString</span> & <i>s2</i> )</h3> <p>This is an overloaded function.</p> <p>Returns a string which consists of the concatenation of <i>s1</i> and <i>s2</i>.</p> <!-- @@@operator+ --> <!-- $$$operator+$$$operator+constQ3CString&char --> <h3 class="fn"><a name="operator-2b-46"></a><span class="type">Q_COMPAT_EXPORT_INLINE</span> const <span class="name">operator+</span> ( const <span class="type">Q3CString</span> & <i>s</i>, <span class="type">char</span> <i>c</i> )</h3> <p>This is an overloaded function.</p> <p>Returns a string which consists of the concatenation of <i>s</i> and <i>c</i>.</p> <!-- @@@operator+ --> <!-- $$$operator+$$$operator+charconstQ3CString& --> <h3 class="fn"><a name="operator-2b-47"></a><span class="type">Q_COMPAT_EXPORT_INLINE</span> const <span class="name">operator+</span> ( <span class="type">char</span> <i>c</i>, const <span class="type">Q3CString</span> & <i>s</i> )</h3> <p>This is an overloaded function.</p> <p>Returns a string which consists of the concatenation of <i>c</i> and <i>s</i>.</p> <!-- @@@operator+ --> <!-- $$$operator+$$$operator+constQ3CString&constQ3CString& --> <h3 class="fn"><a name="operator-2b-31"></a><span class="type">Q_COMPAT_EXPORT_INLINE</span> const <span class="name">operator+</span> ( const <span class="type">Q3CString</span> & <i>s1</i>, const <span class="type">Q3CString</span> & <i>s2</i> )</h3> <p>Returns a string which consists of the concatenation of <i>s1</i> and <i>s2</i>.</p> <!-- @@@operator+ --> <!-- $$$operator<$$$operator<constQ3CString&constchar* --> <h3 class="fn"><a name="operator-lt-17"></a><span class="type">Q_COMPAT_EXPORT_INLINE</span> <span class="name">operator<</span> ( const <span class="type">Q3CString</span> & <i>s1</i>, const <span class="type">char</span> * <i>s2</i> )</h3> <p>Returns true if <i>s1</i> is less than <i>s2</i>; otherwise returns false.</p> <p>Equivalent to qstrcmp(<i>s1</i>, <i>s2</i>) < 0.</p> <!-- @@@operator< --> <!-- $$$operator<$$$operator<constchar*constQ3CString& --> <h3 class="fn"><a name="operator-lt-22"></a><span class="type">Q_COMPAT_EXPORT_INLINE</span> <span class="name">operator<</span> ( const <span class="type">char</span> * <i>s1</i>, const <span class="type">Q3CString</span> & <i>s2</i> )</h3> <p>This is an overloaded function.</p> <p>Returns true if <i>s1</i> is less than <i>s2</i>; otherwise returns false.</p> <p>Equivalent to qstrcmp(<i>s1</i>, <i>s2</i>) < 0.</p> <!-- @@@operator< --> <!-- $$$operator<<$$$operator<<QDataStream&constQ3CString& --> <h3 class="fn"><a name="operator-lt-lt-132"></a><span class="type"><a href="qdatastream.html">QDataStream</a></span> & <span class="name">operator<<</span> ( <span class="type"><a href="qdatastream.html">QDataStream</a></span> & <i>s</i>, const <span class="type">Q3CString</span> & <i>str</i> )</h3> <p>Writes string <i>str</i> to the stream <i>s</i>.</p> <p><b>See also </b><a href="datastreamformat.html">Format of the QDataStream operators</a>.</p> <!-- @@@operator<< --> <!-- $$$operator<=$$$operator<=constQ3CString&constchar* --> <h3 class="fn"><a name="operator-lt-eq-11"></a><span class="type">Q_COMPAT_EXPORT_INLINE</span> <span class="name">operator<=</span> ( const <span class="type">Q3CString</span> & <i>s1</i>, const <span class="type">char</span> * <i>s2</i> )</h3> <p>Returns true if <i>s1</i> is less than or equal to <i>s2</i>; otherwise returns false.</p> <p>Equivalent to qstrcmp(<i>s1</i>, <i>s2</i>) <= 0.</p> <!-- @@@operator<= --> <!-- $$$operator<=$$$operator<=constchar*constQ3CString& --> <h3 class="fn"><a name="operator-lt-eq-16"></a><span class="type">Q_COMPAT_EXPORT_INLINE</span> <span class="name">operator<=</span> ( const <span class="type">char</span> * <i>s1</i>, const <span class="type">Q3CString</span> & <i>s2</i> )</h3> <p>This is an overloaded function.</p> <p>Returns true if <i>s1</i> is less than or equal to <i>s2</i>; otherwise returns false.</p> <p>Equivalent to qstrcmp(<i>s1</i>, <i>s2</i>) <= 0.</p> <!-- @@@operator<= --> <!-- $$$operator==$$$operator==constQ3CString&constQ3CString& --> <h3 class="fn"><a name="operator-eq-eq-68"></a><span class="type">Q_COMPAT_EXPORT_INLINE</span> <span class="name">operator==</span> ( const <span class="type">Q3CString</span> & <i>s1</i>, const <span class="type">Q3CString</span> & <i>s2</i> )</h3> <p>Returns true if <i>s1</i> and <i>s2</i> are equal; otherwise returns false.</p> <p>Equivalent to qstrcmp(<i>s1</i>, <i>s2</i>) == 0.</p> <!-- @@@operator== --> <!-- $$$operator==$$$operator==constQ3CString&constchar* --> <h3 class="fn"><a name="operator-eq-eq-99"></a><span class="type">Q_COMPAT_EXPORT_INLINE</span> <span class="name">operator==</span> ( const <span class="type">Q3CString</span> & <i>s1</i>, const <span class="type">char</span> * <i>s2</i> )</h3> <p>This is an overloaded function.</p> <p>Returns true if <i>s1</i> and <i>s2</i> are equal; otherwise returns false.</p> <p>Equivalent to qstrcmp(<i>s1</i>, <i>s2</i>) == 0.</p> <!-- @@@operator== --> <!-- $$$operator==$$$operator==constchar*constQ3CString& --> <h3 class="fn"><a name="operator-eq-eq-100"></a><span class="type">Q_COMPAT_EXPORT_INLINE</span> <span class="name">operator==</span> ( const <span class="type">char</span> * <i>s1</i>, const <span class="type">Q3CString</span> & <i>s2</i> )</h3> <p>This is an overloaded function.</p> <p>Returns true if <i>s1</i> and <i>s2</i> are equal; otherwise returns false.</p> <p>Equivalent to qstrcmp(<i>s1</i>, <i>s2</i>) == 0.</p> <!-- @@@operator== --> <!-- $$$operator>$$$operator>constQ3CString&constchar* --> <h3 class="fn"><a name="operator-gt-11"></a><span class="type">Q_COMPAT_EXPORT_INLINE</span> <span class="name">operator></span> ( const <span class="type">Q3CString</span> & <i>s1</i>, const <span class="type">char</span> * <i>s2</i> )</h3> <p>Returns true if <i>s1</i> is greater than <i>s2</i>; otherwise returns false.</p> <p>Equivalent to qstrcmp(<i>s1</i>, <i>s2</i>) > 0.</p> <!-- @@@operator> --> <!-- $$$operator>$$$operator>constchar*constQ3CString& --> <h3 class="fn"><a name="operator-gt-16"></a><span class="type">Q_COMPAT_EXPORT_INLINE</span> <span class="name">operator></span> ( const <span class="type">char</span> * <i>s1</i>, const <span class="type">Q3CString</span> & <i>s2</i> )</h3> <p>This is an overloaded function.</p> <p>Returns true if <i>s1</i> is greater than <i>s2</i>; otherwise returns false.</p> <p>Equivalent to qstrcmp(<i>s1</i>, <i>s2</i>) > 0.</p> <!-- @@@operator> --> <!-- $$$operator>=$$$operator>=constQ3CString&constchar* --> <h3 class="fn"><a name="operator-gt-eq-11"></a><span class="type">Q_COMPAT_EXPORT_INLINE</span> <span class="name">operator>=</span> ( const <span class="type">Q3CString</span> & <i>s1</i>, const <span class="type">char</span> * <i>s2</i> )</h3> <p>Returns true if <i>s1</i> is greater than or equal to <i>s2</i>; otherwise returns false.</p> <p>Equivalent to qstrcmp(<i>s1</i>, <i>s2</i>) >= 0.</p> <!-- @@@operator>= --> <!-- $$$operator>=$$$operator>=constchar*constQ3CString& --> <h3 class="fn"><a name="operator-gt-eq-16"></a><span class="type">Q_COMPAT_EXPORT_INLINE</span> <span class="name">operator>=</span> ( const <span class="type">char</span> * <i>s1</i>, const <span class="type">Q3CString</span> & <i>s2</i> )</h3> <p>This is an overloaded function.</p> <p>Returns true if <i>s1</i> is greater than or equal to <i>s2</i>; otherwise returns false.</p> <p>Equivalent to qstrcmp(<i>s1</i>, <i>s2</i>) >= 0.</p> <!-- @@@operator>= --> <!-- $$$operator>>$$$operator>>QDataStream&Q3CString& --> <h3 class="fn"><a name="operator-gt-gt-68"></a><span class="type"><a href="qdatastream.html">QDataStream</a></span> & <span class="name">operator>></span> ( <span class="type"><a href="qdatastream.html">QDataStream</a></span> & <i>s</i>, <span class="type">Q3CString</span> & <i>str</i> )</h3> <p>Reads a string into <i>str</i> from the stream <i>s</i>.</p> <p><b>See also </b><a href="datastreamformat.html">Format of the QDataStream operators</a>.</p> <!-- @@@operator>> --> </div> </div> </div> </div> <div class="ft"> <span></span> </div> </div> <div class="footer"> <p> <acronym title="Copyright">©</acronym> 2015 The Qt Company Ltd. Documentation contributions included herein are the copyrights of their respective owners.</p> <br /> <p> The documentation provided herein is licensed under the terms of the <a href="http://www.gnu.org/licenses/fdl.html">GNU Free Documentation License version 1.3</a> as published by the Free Software Foundation.</p> <p> Documentation sources may be obtained from <a href="http://www.qt-project.org"> www.qt-project.org</a>.</p> <br /> <p> Qt and respective logos are trademarks of The Qt Company Ltd in Finland and/or other countries worldwide. All other trademarks are property of their respective owners. <a title="Privacy Policy" href="http://en.gitorious.org/privacy_policy/">Privacy Policy</a></p> </div> <script src="scripts/functions.js" type="text/javascript"></script> </body> </html>