Sophie

Sophie

distrib > Mageia > 7 > x86_64 > by-pkgid > 1dd17e0d683ef79b4bb6872bbf359d7f > files > 6486

qt4-doc-4.8.7-26.2.mga7.noarch.rpm

<?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" />
<!-- qstring.cpp -->
  <title>Qt 4.8: QStringRef 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 &amp; 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>&nbsp;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 &amp; 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><a href="qtcore.html">QtCore</a></li>
<li>QStringRef</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="#static-public-members">Static Public Members</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">QStringRef Class Reference</h1>
<!-- $$$QStringRef-brief -->
<p>The QStringRef class provides a thin wrapper around <a href="qstring.html">QString</a> substrings. <a href="#details">More...</a></p>
<!-- @@@QStringRef -->
<pre class="cpp"> <span class="preprocessor">#include &lt;QStringRef&gt;</span></pre><p><b>Note:</b> All functions in this class are <a href="threads-reentrancy.html#reentrant">reentrant</a>.</p>
<p>This class was introduced in Qt 4.3.</p>
<ul>
<li><a href="qstringref-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="qstringref.html#QStringRef">QStringRef</a></b> ()</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> </td><td class="memItemRight bottomAlign"><b><a href="qstringref.html#QStringRef-2">QStringRef</a></b> ( const QString * <i>string</i>, int <i>position</i>, int <i>length</i> )</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> </td><td class="memItemRight bottomAlign"><b><a href="qstringref.html#QStringRef-3">QStringRef</a></b> ( const QString * <i>string</i> )</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> </td><td class="memItemRight bottomAlign"><b><a href="qstringref.html#QStringRef-4">QStringRef</a></b> ( const QStringRef &amp; <i>other</i> )</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> </td><td class="memItemRight bottomAlign"><b><a href="qstringref.html#dtor.QStringRef">~QStringRef</a></b> ()</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> QStringRef </td><td class="memItemRight bottomAlign"><b><a href="qstringref.html#appendTo">appendTo</a></b> ( QString * <i>string</i> ) const</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> const QChar </td><td class="memItemRight bottomAlign"><b><a href="qstringref.html#at">at</a></b> ( int <i>position</i> ) const</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> void </td><td class="memItemRight bottomAlign"><b><a href="qstringref.html#clear">clear</a></b> ()</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> int </td><td class="memItemRight bottomAlign"><b><a href="qstringref.html#compare-4">compare</a></b> ( const QString &amp; <i>other</i>, Qt::CaseSensitivity <i>cs</i> = Qt::CaseSensitive ) const</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> int </td><td class="memItemRight bottomAlign"><b><a href="qstringref.html#compare-5">compare</a></b> ( const QStringRef &amp; <i>other</i>, Qt::CaseSensitivity <i>cs</i> = Qt::CaseSensitive ) const</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> int </td><td class="memItemRight bottomAlign"><b><a href="qstringref.html#compare-6">compare</a></b> ( QLatin1String <i>other</i>, Qt::CaseSensitivity <i>cs</i> = Qt::CaseSensitive ) const</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> const QChar * </td><td class="memItemRight bottomAlign"><b><a href="qstringref.html#constData">constData</a></b> () const</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> bool </td><td class="memItemRight bottomAlign"><b><a href="qstringref.html#contains">contains</a></b> ( const QString &amp; <i>str</i>, Qt::CaseSensitivity <i>cs</i> = Qt::CaseSensitive ) const</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> bool </td><td class="memItemRight bottomAlign"><b><a href="qstringref.html#contains-2">contains</a></b> ( QChar <i>ch</i>, Qt::CaseSensitivity <i>cs</i> = Qt::CaseSensitive ) const</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> bool </td><td class="memItemRight bottomAlign"><b><a href="qstringref.html#contains-3">contains</a></b> ( const QStringRef &amp; <i>str</i>, Qt::CaseSensitivity <i>cs</i> = Qt::CaseSensitive ) const</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> bool </td><td class="memItemRight bottomAlign"><b><a href="qstringref.html#contains-4">contains</a></b> ( QLatin1String <i>str</i>, Qt::CaseSensitivity <i>cs</i> = Qt::CaseSensitive ) const</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> int </td><td class="memItemRight bottomAlign"><b><a href="qstringref.html#count">count</a></b> () const</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> int </td><td class="memItemRight bottomAlign"><b><a href="qstringref.html#count-2">count</a></b> ( const QString &amp; <i>str</i>, Qt::CaseSensitivity <i>cs</i> = Qt::CaseSensitive ) const</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> int </td><td class="memItemRight bottomAlign"><b><a href="qstringref.html#count-3">count</a></b> ( QChar <i>ch</i>, Qt::CaseSensitivity <i>cs</i> = Qt::CaseSensitive ) const</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> int </td><td class="memItemRight bottomAlign"><b><a href="qstringref.html#count-4">count</a></b> ( const QStringRef &amp; <i>str</i>, Qt::CaseSensitivity <i>cs</i> = Qt::CaseSensitive ) const</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> const QChar * </td><td class="memItemRight bottomAlign"><b><a href="qstringref.html#data">data</a></b> () const</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> bool </td><td class="memItemRight bottomAlign"><b><a href="qstringref.html#endsWith">endsWith</a></b> ( const QString &amp; <i>str</i>, Qt::CaseSensitivity <i>cs</i> = Qt::CaseSensitive ) const</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> bool </td><td class="memItemRight bottomAlign"><b><a href="qstringref.html#endsWith-2">endsWith</a></b> ( QChar <i>ch</i>, Qt::CaseSensitivity <i>cs</i> = Qt::CaseSensitive ) const</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> bool </td><td class="memItemRight bottomAlign"><b><a href="qstringref.html#endsWith-3">endsWith</a></b> ( QLatin1String <i>str</i>, Qt::CaseSensitivity <i>cs</i> = Qt::CaseSensitive ) const</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> bool </td><td class="memItemRight bottomAlign"><b><a href="qstringref.html#endsWith-4">endsWith</a></b> ( const QStringRef &amp; <i>str</i>, Qt::CaseSensitivity <i>cs</i> = Qt::CaseSensitive ) const</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> int </td><td class="memItemRight bottomAlign"><b><a href="qstringref.html#indexOf">indexOf</a></b> ( const QString &amp; <i>str</i>, int <i>from</i> = 0, Qt::CaseSensitivity <i>cs</i> = Qt::CaseSensitive ) const</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> int </td><td class="memItemRight bottomAlign"><b><a href="qstringref.html#indexOf-2">indexOf</a></b> ( QLatin1String <i>str</i>, int <i>from</i> = 0, Qt::CaseSensitivity <i>cs</i> = Qt::CaseSensitive ) const</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> int </td><td class="memItemRight bottomAlign"><b><a href="qstringref.html#indexOf-3">indexOf</a></b> ( QChar <i>ch</i>, int <i>from</i> = 0, Qt::CaseSensitivity <i>cs</i> = Qt::CaseSensitive ) const</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> int </td><td class="memItemRight bottomAlign"><b><a href="qstringref.html#indexOf-4">indexOf</a></b> ( const QStringRef &amp; <i>str</i>, int <i>from</i> = 0, Qt::CaseSensitivity <i>cs</i> = Qt::CaseSensitive ) const</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> bool </td><td class="memItemRight bottomAlign"><b><a href="qstringref.html#isEmpty">isEmpty</a></b> () const</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> bool </td><td class="memItemRight bottomAlign"><b><a href="qstringref.html#isNull">isNull</a></b> () const</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> int </td><td class="memItemRight bottomAlign"><b><a href="qstringref.html#lastIndexOf">lastIndexOf</a></b> ( const QString &amp; <i>str</i>, int <i>from</i> = -1, Qt::CaseSensitivity <i>cs</i> = Qt::CaseSensitive ) const</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> int </td><td class="memItemRight bottomAlign"><b><a href="qstringref.html#lastIndexOf-2">lastIndexOf</a></b> ( QChar <i>ch</i>, int <i>from</i> = -1, Qt::CaseSensitivity <i>cs</i> = Qt::CaseSensitive ) const</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> int </td><td class="memItemRight bottomAlign"><b><a href="qstringref.html#lastIndexOf-3">lastIndexOf</a></b> ( QLatin1String <i>str</i>, int <i>from</i> = -1, Qt::CaseSensitivity <i>cs</i> = Qt::CaseSensitive ) const</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> int </td><td class="memItemRight bottomAlign"><b><a href="qstringref.html#lastIndexOf-4">lastIndexOf</a></b> ( const QStringRef &amp; <i>str</i>, int <i>from</i> = -1, Qt::CaseSensitivity <i>cs</i> = Qt::CaseSensitive ) const</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> int </td><td class="memItemRight bottomAlign"><b><a href="qstringref.html#length">length</a></b> () const</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> int </td><td class="memItemRight bottomAlign"><b><a href="qstringref.html#localeAwareCompare-3">localeAwareCompare</a></b> ( const QString &amp; <i>other</i> ) const</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> int </td><td class="memItemRight bottomAlign"><b><a href="qstringref.html#localeAwareCompare-4">localeAwareCompare</a></b> ( const QStringRef &amp; <i>other</i> ) const</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> int </td><td class="memItemRight bottomAlign"><b><a href="qstringref.html#position">position</a></b> () const</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> int </td><td class="memItemRight bottomAlign"><b><a href="qstringref.html#size">size</a></b> () const</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> bool </td><td class="memItemRight bottomAlign"><b><a href="qstringref.html#startsWith">startsWith</a></b> ( const QString &amp; <i>str</i>, Qt::CaseSensitivity <i>cs</i> = Qt::CaseSensitive ) const</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> bool </td><td class="memItemRight bottomAlign"><b><a href="qstringref.html#startsWith-2">startsWith</a></b> ( QLatin1String <i>str</i>, Qt::CaseSensitivity <i>cs</i> = Qt::CaseSensitive ) const</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> bool </td><td class="memItemRight bottomAlign"><b><a href="qstringref.html#startsWith-3">startsWith</a></b> ( const QStringRef &amp; <i>str</i>, Qt::CaseSensitivity <i>cs</i> = Qt::CaseSensitive ) const</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> bool </td><td class="memItemRight bottomAlign"><b><a href="qstringref.html#startsWith-4">startsWith</a></b> ( QChar <i>ch</i>, Qt::CaseSensitivity <i>cs</i> = Qt::CaseSensitive ) const</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> const QString * </td><td class="memItemRight bottomAlign"><b><a href="qstringref.html#string">string</a></b> () const</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> QByteArray </td><td class="memItemRight bottomAlign"><b><a href="qstringref.html#toAscii">toAscii</a></b> () const</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> QByteArray </td><td class="memItemRight bottomAlign"><b><a href="qstringref.html#toLatin1">toLatin1</a></b> () const</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> QByteArray </td><td class="memItemRight bottomAlign"><b><a href="qstringref.html#toLocal8Bit">toLocal8Bit</a></b> () const</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> QString </td><td class="memItemRight bottomAlign"><b><a href="qstringref.html#toString">toString</a></b> () const</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> QVector&lt;uint&gt; </td><td class="memItemRight bottomAlign"><b><a href="qstringref.html#toUcs4">toUcs4</a></b> () const</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> QByteArray </td><td class="memItemRight bottomAlign"><b><a href="qstringref.html#toUtf8">toUtf8</a></b> () const</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> const QChar * </td><td class="memItemRight bottomAlign"><b><a href="qstringref.html#unicode">unicode</a></b> () const</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> QStringRef &amp; </td><td class="memItemRight bottomAlign"><b><a href="qstringref.html#operator-eq">operator=</a></b> ( const QStringRef &amp; <i>other</i> )</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> QStringRef &amp; </td><td class="memItemRight bottomAlign"><b><a href="qstringref.html#operator-eq-2">operator=</a></b> ( const QString * <i>string</i> )</td></tr>
</table>
<a name="static-public-members"></a>
<h2>Static Public Members</h2>
<table class="alignedsummary">
<tr><td class="memItemLeft rightAlign topAlign"> int </td><td class="memItemRight bottomAlign"><b><a href="qstringref.html#compare">compare</a></b> ( const QStringRef &amp; <i>s1</i>, const QString &amp; <i>s2</i>, Qt::CaseSensitivity <i>cs</i> = Qt::CaseSensitive )</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> int </td><td class="memItemRight bottomAlign"><b><a href="qstringref.html#compare-2">compare</a></b> ( const QStringRef &amp; <i>s1</i>, const QStringRef &amp; <i>s2</i>, Qt::CaseSensitivity <i>cs</i> = Qt::CaseSensitive )</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> int </td><td class="memItemRight bottomAlign"><b><a href="qstringref.html#compare-3">compare</a></b> ( const QStringRef &amp; <i>s1</i>, QLatin1String <i>s2</i>, Qt::CaseSensitivity <i>cs</i> = Qt::CaseSensitive )</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> int </td><td class="memItemRight bottomAlign"><b><a href="qstringref.html#localeAwareCompare">localeAwareCompare</a></b> ( const QStringRef &amp; <i>s1</i>, const QString &amp; <i>s2</i> )</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> int </td><td class="memItemRight bottomAlign"><b><a href="qstringref.html#localeAwareCompare-2">localeAwareCompare</a></b> ( const QStringRef &amp; <i>s1</i>, const QStringRef &amp; <i>s2</i> )</td></tr>
</table>
<a name="related-non-members"></a>
<h2>Related Non-Members</h2>
<table class="alignedsummary">
<tr><td class="memItemLeft rightAlign topAlign"> bool </td><td class="memItemRight bottomAlign"><b><a href="qstringref.html#operator-lt-7">operator&lt;</a></b> ( const QStringRef &amp; <i>s1</i>, const QStringRef &amp; <i>s2</i> )</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> bool </td><td class="memItemRight bottomAlign"><b><a href="qstringref.html#operator-lt-eq-7">operator&lt;=</a></b> ( const QStringRef &amp; <i>s1</i>, const QStringRef &amp; <i>s2</i> )</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> bool </td><td class="memItemRight bottomAlign"><b><a href="qstringref.html#operator-eq-eq-14">operator==</a></b> ( const QStringRef &amp; <i>s1</i>, const QStringRef &amp; <i>s2</i> )</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> bool </td><td class="memItemRight bottomAlign"><b><a href="qstringref.html#operator-eq-eq-15">operator==</a></b> ( const QString &amp; <i>s1</i>, const QStringRef &amp; <i>s2</i> )</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> bool </td><td class="memItemRight bottomAlign"><b><a href="qstringref.html#operator-eq-eq-17">operator==</a></b> ( const QLatin1String &amp; <i>s1</i>, const QStringRef &amp; <i>s2</i> )</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> bool </td><td class="memItemRight bottomAlign"><b><a href="qstringref.html#operator-gt-7">operator&gt;</a></b> ( const QStringRef &amp; <i>s1</i>, const QStringRef &amp; <i>s2</i> )</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> bool </td><td class="memItemRight bottomAlign"><b><a href="qstringref.html#operator-gt-eq-7">operator&gt;=</a></b> ( const QStringRef &amp; <i>s1</i>, const QStringRef &amp; <i>s2</i> )</td></tr>
</table>
<a name="details"></a>
<!-- $$$QStringRef-description -->
<div class="descr">
<h2>Detailed Description</h2>
<p>The QStringRef class provides a thin wrapper around <a href="qstring.html">QString</a> substrings.</p>
<p>QStringRef provides a read-only subset of the <a href="qstring.html">QString</a> API.</p>
<p>A string reference explicitly references a portion of a <a href="qstringref.html#string">string</a>() with a given <a href="qstringref.html#size">size</a>(), starting at a specific <a href="qstringref.html#position">position</a>(). Calling <a href="qstringref.html#toString">toString</a>() returns a copy of the data as a real <a href="qstring.html">QString</a> instance.</p>
<p>This class is designed to improve the performance of substring handling when manipulating substrings obtained from existing <a href="qstring.html">QString</a> instances. QStringRef avoids the memory allocation and reference counting overhead of a standard <a href="qstring.html">QString</a> by simply referencing a part of the original string. This can prove to be advantageous in low level code, such as that used in a parser, at the expense of potentially more complex code.</p>
<p>For most users, there are no semantic benefits to using QStringRef instead of <a href="qstring.html">QString</a> since QStringRef requires attention to be paid to memory management issues, potentially making code more complex to write and maintain.</p>
<p><b>Warning:</b> A QStringRef is only valid as long as the referenced string exists. If the original string is deleted, the string reference points to an invalid memory location.</p>
<p>We suggest that you only use this class in stable code where profiling has clearly identified that performance improvements can be made by replacing standard string operations with the optimized substring handling provided by this class.</p>
</div>
<p><b>See also </b><a href="shared.html">Implicitly Shared Classes</a>.</p>
<!-- @@@QStringRef -->
<div class="func">
<h2>Member Function Documentation</h2>
<!-- $$$QStringRef[overload1]$$$QStringRef -->
<h3 class="fn"><a name="QStringRef"></a>QStringRef::<span class="name">QStringRef</span> ()</h3>
<p>Constructs an empty string reference.</p>
<!-- @@@QStringRef -->
<!-- $$$QStringRef$$$QStringRefconstQString*intint -->
<h3 class="fn"><a name="QStringRef-2"></a>QStringRef::<span class="name">QStringRef</span> ( const <span class="type"><a href="qstring.html">QString</a></span> * <i>string</i>, <span class="type">int</span> <i>position</i>, <span class="type">int</span> <i>length</i> )</h3>
<p>Constructs a string reference to the range of characters in the given <i>string</i> specified by the starting <i>position</i> and <i>length</i> in characters.</p>
<p><b>Warning:</b> This function exists to improve performance as much as possible, and performs no bounds checking. For program correctness, <i>position</i> and <i>length</i> must describe a valid substring of <i>string</i>.</p>
<p>This means that the starting <i>position</i> must be positive or 0 and smaller than <i>string</i>'s length, and <i>length</i> must be positive or 0 but smaller than the string's length minus the starting <i>position</i>; i.e, 0 &lt;= position &lt; string-&gt;<a href="qstringref.html#length">length</a>() and 0 &lt;= length &lt;= string-&gt;<a href="qstringref.html#length">length</a>() - position must both be satisfied.</p>
<!-- @@@QStringRef -->
<!-- $$$QStringRef$$$QStringRefconstQString* -->
<h3 class="fn"><a name="QStringRef-3"></a>QStringRef::<span class="name">QStringRef</span> ( const <span class="type"><a href="qstring.html">QString</a></span> * <i>string</i> )</h3>
<p>Constructs a string reference to the given <i>string</i>.</p>
<!-- @@@QStringRef -->
<!-- $$$QStringRef$$$QStringRefconstQStringRef& -->
<h3 class="fn"><a name="QStringRef-4"></a>QStringRef::<span class="name">QStringRef</span> ( const <span class="type">QStringRef</span> &amp; <i>other</i> )</h3>
<p>Constructs a copy of the <i>other</i> string reference.</p>
<!-- @@@QStringRef -->
<!-- $$$~QStringRef[overload1]$$$~QStringRef -->
<h3 class="fn"><a name="dtor.QStringRef"></a>QStringRef::<span class="name">~QStringRef</span> ()</h3>
<p>Destroys the string reference.</p>
<p>Since this class is only used to refer to string data, and does not take ownership of it, no memory is freed when instances are destroyed.</p>
<!-- @@@~QStringRef -->
<!-- $$$appendTo[overload1]$$$appendToQString* -->
<h3 class="fn"><a name="appendTo"></a><span class="type">QStringRef</span> QStringRef::<span class="name">appendTo</span> ( <span class="type"><a href="qstring.html">QString</a></span> * <i>string</i> ) const</h3>
<p>Appends the string reference to <i>string</i>, and returns a new reference to the combined string data.</p>
<!-- @@@appendTo -->
<!-- $$$at[overload1]$$$atint -->
<h3 class="fn"><a name="at"></a>const <span class="type"><a href="qchar.html">QChar</a></span> QStringRef::<span class="name">at</span> ( <span class="type">int</span> <i>position</i> ) const</h3>
<p>Returns the character at the given index <i>position</i> in the string reference.</p>
<p>The <i>position</i> must be a valid index position in the string (i.e&#x2e;, 0 &lt;= <i>position</i> &lt; <a href="qstringref.html#size">size</a>()).</p>
<!-- @@@at -->
<!-- $$$clear[overload1]$$$clear -->
<h3 class="fn"><a name="clear"></a><span class="type">void</span> QStringRef::<span class="name">clear</span> ()</h3>
<p>Clears the contents of the string reference by making it null and empty.</p>
<p><b>See also </b><a href="qstringref.html#isEmpty">isEmpty</a>() and <a href="qstringref.html#isNull">isNull</a>().</p>
<!-- @@@clear -->
<!-- $$$compare[overload1]$$$compareconstQStringRef&constQString&Qt::CaseSensitivity -->
<h3 class="fn"><a name="compare"></a><span class="type">int</span> QStringRef::<span class="name">compare</span> ( const <span class="type">QStringRef</span> &amp; <i>s1</i>, const <span class="type"><a href="qstring.html">QString</a></span> &amp; <i>s2</i>, <span class="type"><a href="qt.html#CaseSensitivity-enum">Qt::CaseSensitivity</a></span> <i>cs</i> = Qt::CaseSensitive )<tt> [static]</tt></h3>
<p>Compares the string <i>s1</i> with the string <i>s2</i> and returns an integer less than, equal to, or greater than zero if <i>s1</i> is less than, equal to, or greater than <i>s2</i>.</p>
<p>If <i>cs</i> is <a href="qt.html#CaseSensitivity-enum">Qt::CaseSensitive</a>, the comparison is case sensitive; otherwise the comparison is case insensitive.</p>
<p>This function was introduced in Qt 4.5.</p>
<!-- @@@compare -->
<!-- $$$compare$$$compareconstQStringRef&constQStringRef&Qt::CaseSensitivity -->
<h3 class="fn"><a name="compare-2"></a><span class="type">int</span> QStringRef::<span class="name">compare</span> ( const <span class="type">QStringRef</span> &amp; <i>s1</i>, const <span class="type">QStringRef</span> &amp; <i>s2</i>, <span class="type"><a href="qt.html#CaseSensitivity-enum">Qt::CaseSensitivity</a></span> <i>cs</i> = Qt::CaseSensitive )<tt> [static]</tt></h3>
<p>This is an overloaded function.</p>
<p>Compares the string <i>s1</i> with the string <i>s2</i> and returns an integer less than, equal to, or greater than zero if <i>s1</i> is less than, equal to, or greater than <i>s2</i>.</p>
<p>If <i>cs</i> is <a href="qt.html#CaseSensitivity-enum">Qt::CaseSensitive</a>, the comparison is case sensitive; otherwise the comparison is case insensitive.</p>
<p>This function was introduced in Qt 4.5.</p>
<!-- @@@compare -->
<!-- $$$compare$$$compareconstQStringRef&QLatin1StringQt::CaseSensitivity -->
<h3 class="fn"><a name="compare-3"></a><span class="type">int</span> QStringRef::<span class="name">compare</span> ( const <span class="type">QStringRef</span> &amp; <i>s1</i>, <span class="type"><a href="qlatin1string.html">QLatin1String</a></span> <i>s2</i>, <span class="type"><a href="qt.html#CaseSensitivity-enum">Qt::CaseSensitivity</a></span> <i>cs</i> = Qt::CaseSensitive )<tt> [static]</tt></h3>
<p>This is an overloaded function.</p>
<p>Compares the string <i>s1</i> with the string <i>s2</i> and returns an integer less than, equal to, or greater than zero if <i>s1</i> is less than, equal to, or greater than <i>s2</i>.</p>
<p>If <i>cs</i> is <a href="qt.html#CaseSensitivity-enum">Qt::CaseSensitive</a>, the comparison is case sensitive; otherwise the comparison is case insensitive.</p>
<p>This function was introduced in Qt 4.5.</p>
<!-- @@@compare -->
<!-- $$$compare$$$compareconstQString&Qt::CaseSensitivity -->
<h3 class="fn"><a name="compare-4"></a><span class="type">int</span> QStringRef::<span class="name">compare</span> ( const <span class="type"><a href="qstring.html">QString</a></span> &amp; <i>other</i>, <span class="type"><a href="qt.html#CaseSensitivity-enum">Qt::CaseSensitivity</a></span> <i>cs</i> = Qt::CaseSensitive ) const</h3>
<p>This is an overloaded function.</p>
<p>Compares this string with the <i>other</i> string and returns an integer less than, equal to, or greater than zero if this string is less than, equal to, or greater than the <i>other</i> string.</p>
<p>If <i>cs</i> is <a href="qt.html#CaseSensitivity-enum">Qt::CaseSensitive</a>, the comparison is case sensitive; otherwise the comparison is case insensitive.</p>
<p>Equivalent to <tt>compare(*this, other, cs)</tt>.</p>
<p>This function was introduced in Qt 4.5.</p>
<p><b>See also </b><a href="qstring.html#compare">QString::compare</a>().</p>
<!-- @@@compare -->
<!-- $$$compare$$$compareconstQStringRef&Qt::CaseSensitivity -->
<h3 class="fn"><a name="compare-5"></a><span class="type">int</span> QStringRef::<span class="name">compare</span> ( const <span class="type">QStringRef</span> &amp; <i>other</i>, <span class="type"><a href="qt.html#CaseSensitivity-enum">Qt::CaseSensitivity</a></span> <i>cs</i> = Qt::CaseSensitive ) const</h3>
<p>This is an overloaded function.</p>
<p>Compares this string with the <i>other</i> string and returns an integer less than, equal to, or greater than zero if this string is less than, equal to, or greater than the <i>other</i> string.</p>
<p>If <i>cs</i> is <a href="qt.html#CaseSensitivity-enum">Qt::CaseSensitive</a>, the comparison is case sensitive; otherwise the comparison is case insensitive.</p>
<p>Equivalent to <tt>compare(*this, other, cs)</tt>.</p>
<p>This function was introduced in Qt 4.5.</p>
<p><b>See also </b><a href="qstring.html#compare">QString::compare</a>().</p>
<!-- @@@compare -->
<!-- $$$compare$$$compareQLatin1StringQt::CaseSensitivity -->
<h3 class="fn"><a name="compare-6"></a><span class="type">int</span> QStringRef::<span class="name">compare</span> ( <span class="type"><a href="qlatin1string.html">QLatin1String</a></span> <i>other</i>, <span class="type"><a href="qt.html#CaseSensitivity-enum">Qt::CaseSensitivity</a></span> <i>cs</i> = Qt::CaseSensitive ) const</h3>
<p>This is an overloaded function.</p>
<p>Compares this string with the <i>other</i> string and returns an integer less than, equal to, or greater than zero if this string is less than, equal to, or greater than the <i>other</i> string.</p>
<p>If <i>cs</i> is <a href="qt.html#CaseSensitivity-enum">Qt::CaseSensitive</a>, the comparison is case sensitive; otherwise the comparison is case insensitive.</p>
<p>Equivalent to <tt>compare(*this, other, cs)</tt>.</p>
<p>This function was introduced in Qt 4.5.</p>
<p><b>See also </b><a href="qstring.html#compare">QString::compare</a>().</p>
<!-- @@@compare -->
<!-- $$$constData[overload1]$$$constData -->
<h3 class="fn"><a name="constData"></a>const <span class="type"><a href="qchar.html">QChar</a></span> * QStringRef::<span class="name">constData</span> () const</h3>
<p>Same as <a href="qstringref.html#unicode">unicode</a>().</p>
<!-- @@@constData -->
<!-- $$$contains[overload1]$$$containsconstQString&Qt::CaseSensitivity -->
<h3 class="fn"><a name="contains"></a><span class="type">bool</span> QStringRef::<span class="name">contains</span> ( const <span class="type"><a href="qstring.html">QString</a></span> &amp; <i>str</i>, <span class="type"><a href="qt.html#CaseSensitivity-enum">Qt::CaseSensitivity</a></span> <i>cs</i> = Qt::CaseSensitive ) const</h3>
<p>Returns true if this string reference contains an occurrence of the string <i>str</i>; otherwise returns false.</p>
<p>If <i>cs</i> is <a href="qt.html#CaseSensitivity-enum">Qt::CaseSensitive</a> (default), the search is case sensitive; otherwise the search is case insensitive.</p>
<p>This function was introduced in Qt 4.8.</p>
<p><b>See also </b><a href="qstringref.html#indexOf">indexOf</a>() and <a href="qstringref.html#count">count</a>().</p>
<!-- @@@contains -->
<!-- $$$contains$$$containsQCharQt::CaseSensitivity -->
<h3 class="fn"><a name="contains-2"></a><span class="type">bool</span> QStringRef::<span class="name">contains</span> ( <span class="type"><a href="qchar.html">QChar</a></span> <i>ch</i>, <span class="type"><a href="qt.html#CaseSensitivity-enum">Qt::CaseSensitivity</a></span> <i>cs</i> = Qt::CaseSensitive ) const</h3>
<p>This function overloads <a href="qstringref.html#contains">contains</a>().</p>
<p>Returns true if this string contains an occurrence of the character <i>ch</i>; otherwise returns false.</p>
<p>If <i>cs</i> is <a href="qt.html#CaseSensitivity-enum">Qt::CaseSensitive</a> (default), the search is case sensitive; otherwise the search is case insensitive.</p>
<p>This function was introduced in Qt 4.8.</p>
<!-- @@@contains -->
<!-- $$$contains$$$containsconstQStringRef&Qt::CaseSensitivity -->
<h3 class="fn"><a name="contains-3"></a><span class="type">bool</span> QStringRef::<span class="name">contains</span> ( const <span class="type">QStringRef</span> &amp; <i>str</i>, <span class="type"><a href="qt.html#CaseSensitivity-enum">Qt::CaseSensitivity</a></span> <i>cs</i> = Qt::CaseSensitive ) const</h3>
<p>This function overloads <a href="qstringref.html#contains">contains</a>().</p>
<p>Returns true if this string reference contains an occurrence of the string reference <i>str</i>; otherwise returns false.</p>
<p>If <i>cs</i> is <a href="qt.html#CaseSensitivity-enum">Qt::CaseSensitive</a> (default), the search is case sensitive; otherwise the search is case insensitive.</p>
<p>This function was introduced in Qt 4.8.</p>
<p><b>See also </b><a href="qstringref.html#indexOf">indexOf</a>() and <a href="qstringref.html#count">count</a>().</p>
<!-- @@@contains -->
<!-- $$$contains$$$containsQLatin1StringQt::CaseSensitivity -->
<h3 class="fn"><a name="contains-4"></a><span class="type">bool</span> QStringRef::<span class="name">contains</span> ( <span class="type"><a href="qlatin1string.html">QLatin1String</a></span> <i>str</i>, <span class="type"><a href="qt.html#CaseSensitivity-enum">Qt::CaseSensitivity</a></span> <i>cs</i> = Qt::CaseSensitive ) const</h3>
<p>This function overloads <a href="qstringref.html#contains">contains</a>().</p>
<p>Returns true if this string reference contains an occurrence of the string <i>str</i>; otherwise returns false.</p>
<p>If <i>cs</i> is <a href="qt.html#CaseSensitivity-enum">Qt::CaseSensitive</a> (default), the search is case sensitive; otherwise the search is case insensitive.</p>
<p>This function was introduced in Qt 4,8.</p>
<p><b>See also </b><a href="qstringref.html#indexOf">indexOf</a>() and <a href="qstringref.html#count">count</a>().</p>
<!-- @@@contains -->
<!-- $$$count[overload1]$$$count -->
<h3 class="fn"><a name="count"></a><span class="type">int</span> QStringRef::<span class="name">count</span> () const</h3>
<p>Returns the number of characters referred to by the string reference. Equivalent to <a href="qstringref.html#size">size</a>() and <a href="qstringref.html#length">length</a>().</p>
<p><b>See also </b><a href="qstringref.html#position">position</a>() and <a href="qstringref.html#string">string</a>().</p>
<!-- @@@count -->
<!-- $$$count$$$countconstQString&Qt::CaseSensitivity -->
<h3 class="fn"><a name="count-2"></a><span class="type">int</span> QStringRef::<span class="name">count</span> ( const <span class="type"><a href="qstring.html">QString</a></span> &amp; <i>str</i>, <span class="type"><a href="qt.html#CaseSensitivity-enum">Qt::CaseSensitivity</a></span> <i>cs</i> = Qt::CaseSensitive ) const</h3>
<p>Returns the number of (potentially overlapping) occurrences of the string <i>str</i> in this string reference.</p>
<p>If <i>cs</i> is <a href="qt.html#CaseSensitivity-enum">Qt::CaseSensitive</a> (default), the search is case sensitive; otherwise the search is case insensitive.</p>
<p>This function was introduced in Qt 4.8.</p>
<p><b>See also </b><a href="qstring.html#count">QString::count</a>(), <a href="qstringref.html#contains">contains</a>(), and <a href="qstringref.html#indexOf">indexOf</a>().</p>
<!-- @@@count -->
<!-- $$$count$$$countQCharQt::CaseSensitivity -->
<h3 class="fn"><a name="count-3"></a><span class="type">int</span> QStringRef::<span class="name">count</span> ( <span class="type"><a href="qchar.html">QChar</a></span> <i>ch</i>, <span class="type"><a href="qt.html#CaseSensitivity-enum">Qt::CaseSensitivity</a></span> <i>cs</i> = Qt::CaseSensitive ) const</h3>
<p>This function overloads <a href="qstringref.html#count">count</a>().</p>
<p>Returns the number of occurrences of the character <i>ch</i> in the string reference.</p>
<p>If <i>cs</i> is <a href="qt.html#CaseSensitivity-enum">Qt::CaseSensitive</a> (default), the search is case sensitive; otherwise the search is case insensitive.</p>
<p>This function was introduced in Qt 4.8.</p>
<p><b>See also </b><a href="qstring.html#count">QString::count</a>(), <a href="qstringref.html#contains">contains</a>(), and <a href="qstringref.html#indexOf">indexOf</a>().</p>
<!-- @@@count -->
<!-- $$$count$$$countconstQStringRef&Qt::CaseSensitivity -->
<h3 class="fn"><a name="count-4"></a><span class="type">int</span> QStringRef::<span class="name">count</span> ( const <span class="type">QStringRef</span> &amp; <i>str</i>, <span class="type"><a href="qt.html#CaseSensitivity-enum">Qt::CaseSensitivity</a></span> <i>cs</i> = Qt::CaseSensitive ) const</h3>
<p>This function overloads <a href="qstringref.html#count">count</a>().</p>
<p>Returns the number of (potentially overlapping) occurrences of the string reference <i>str</i> in this string reference.</p>
<p>If <i>cs</i> is <a href="qt.html#CaseSensitivity-enum">Qt::CaseSensitive</a> (default), the search is case sensitive; otherwise the search is case insensitive.</p>
<p>This function was introduced in Qt 4.8.</p>
<p><b>See also </b><a href="qstring.html#count">QString::count</a>(), <a href="qstringref.html#contains">contains</a>(), and <a href="qstringref.html#indexOf">indexOf</a>().</p>
<!-- @@@count -->
<!-- $$$data[overload1]$$$data -->
<h3 class="fn"><a name="data"></a>const <span class="type"><a href="qchar.html">QChar</a></span> * QStringRef::<span class="name">data</span> () const</h3>
<p>Same as <a href="qstringref.html#unicode">unicode</a>().</p>
<!-- @@@data -->
<!-- $$$endsWith[overload1]$$$endsWithconstQString&Qt::CaseSensitivity -->
<h3 class="fn"><a name="endsWith"></a><span class="type">bool</span> QStringRef::<span class="name">endsWith</span> ( const <span class="type"><a href="qstring.html">QString</a></span> &amp; <i>str</i>, <span class="type"><a href="qt.html#CaseSensitivity-enum">Qt::CaseSensitivity</a></span> <i>cs</i> = Qt::CaseSensitive ) const</h3>
<p>Returns true if the string reference ends with <i>str</i>; otherwise returns false.</p>
<p>If <i>cs</i> is <a href="qt.html#CaseSensitivity-enum">Qt::CaseSensitive</a> (default), the search is case sensitive; otherwise the search is case insensitive.</p>
<p>This function was introduced in Qt 4.8.</p>
<p><b>See also </b><a href="qstring.html#endsWith">QString::endsWith</a>() and <a href="qstringref.html#startsWith">startsWith</a>().</p>
<!-- @@@endsWith -->
<!-- $$$endsWith$$$endsWithQCharQt::CaseSensitivity -->
<h3 class="fn"><a name="endsWith-2"></a><span class="type">bool</span> QStringRef::<span class="name">endsWith</span> ( <span class="type"><a href="qchar.html">QChar</a></span> <i>ch</i>, <span class="type"><a href="qt.html#CaseSensitivity-enum">Qt::CaseSensitivity</a></span> <i>cs</i> = Qt::CaseSensitive ) const</h3>
<p>This function overloads <a href="qstringref.html#endsWith">endsWith</a>().</p>
<p>Returns true if the string reference ends with <i>ch</i>; otherwise returns false.</p>
<p>If <i>cs</i> is <a href="qt.html#CaseSensitivity-enum">Qt::CaseSensitive</a> (default), the search is case sensitive; otherwise the search is case insensitive.</p>
<p>This function was introduced in Qt 4.8.</p>
<p><b>See also </b><a href="qstring.html#endsWith">QString::endsWith</a>() and <a href="qstringref.html#endsWith">endsWith</a>().</p>
<!-- @@@endsWith -->
<!-- $$$endsWith$$$endsWithQLatin1StringQt::CaseSensitivity -->
<h3 class="fn"><a name="endsWith-3"></a><span class="type">bool</span> QStringRef::<span class="name">endsWith</span> ( <span class="type"><a href="qlatin1string.html">QLatin1String</a></span> <i>str</i>, <span class="type"><a href="qt.html#CaseSensitivity-enum">Qt::CaseSensitivity</a></span> <i>cs</i> = Qt::CaseSensitive ) const</h3>
<p>This function overloads <a href="qstringref.html#endsWith">endsWith</a>().</p>
<p>This function was introduced in Qt 4.8.</p>
<p><b>See also </b><a href="qstring.html#endsWith">QString::endsWith</a>() and <a href="qstringref.html#endsWith">endsWith</a>().</p>
<!-- @@@endsWith -->
<!-- $$$endsWith$$$endsWithconstQStringRef&Qt::CaseSensitivity -->
<h3 class="fn"><a name="endsWith-4"></a><span class="type">bool</span> QStringRef::<span class="name">endsWith</span> ( const <span class="type">QStringRef</span> &amp; <i>str</i>, <span class="type"><a href="qt.html#CaseSensitivity-enum">Qt::CaseSensitivity</a></span> <i>cs</i> = Qt::CaseSensitive ) const</h3>
<p>This function overloads <a href="qstringref.html#endsWith">endsWith</a>().</p>
<p>This function was introduced in Qt 4.8.</p>
<p><b>See also </b><a href="qstring.html#endsWith">QString::endsWith</a>() and <a href="qstringref.html#endsWith">endsWith</a>().</p>
<!-- @@@endsWith -->
<!-- $$$indexOf[overload1]$$$indexOfconstQString&intQt::CaseSensitivity -->
<h3 class="fn"><a name="indexOf"></a><span class="type">int</span> QStringRef::<span class="name">indexOf</span> ( const <span class="type"><a href="qstring.html">QString</a></span> &amp; <i>str</i>, <span class="type">int</span> <i>from</i> = 0, <span class="type"><a href="qt.html#CaseSensitivity-enum">Qt::CaseSensitivity</a></span> <i>cs</i> = Qt::CaseSensitive ) const</h3>
<p>Returns the index position of the first occurrence of the string <i>str</i> in this string reference, searching forward from index position <i>from</i>. Returns -1 if <i>str</i> is not found.</p>
<p>If <i>cs</i> is <a href="qt.html#CaseSensitivity-enum">Qt::CaseSensitive</a> (default), the search is case sensitive; otherwise the search is case insensitive.</p>
<p>If <i>from</i> is -1, the search starts at the last character; if it is -2, at the next to last character and so on.</p>
<p>This function was introduced in Qt 4.8.</p>
<p><b>See also </b><a href="qstring.html#indexOf">QString::indexOf</a>(), <a href="qstringref.html#lastIndexOf">lastIndexOf</a>(), <a href="qstringref.html#contains">contains</a>(), and <a href="qstringref.html#count">count</a>().</p>
<!-- @@@indexOf -->
<!-- $$$indexOf$$$indexOfQLatin1StringintQt::CaseSensitivity -->
<h3 class="fn"><a name="indexOf-2"></a><span class="type">int</span> QStringRef::<span class="name">indexOf</span> ( <span class="type"><a href="qlatin1string.html">QLatin1String</a></span> <i>str</i>, <span class="type">int</span> <i>from</i> = 0, <span class="type"><a href="qt.html#CaseSensitivity-enum">Qt::CaseSensitivity</a></span> <i>cs</i> = Qt::CaseSensitive ) const</h3>
<p>Returns the index position of the first occurrence of the string <i>str</i> in this string reference, searching forward from index position <i>from</i>. Returns -1 if <i>str</i> is not found.</p>
<p>If <i>cs</i> is <a href="qt.html#CaseSensitivity-enum">Qt::CaseSensitive</a> (default), the search is case sensitive; otherwise the search is case insensitive.</p>
<p>If <i>from</i> is -1, the search starts at the last character; if it is -2, at the next to last character and so on.</p>
<p>This function was introduced in Qt 4.8.</p>
<p><b>See also </b><a href="qstring.html#indexOf">QString::indexOf</a>(), <a href="qstringref.html#lastIndexOf">lastIndexOf</a>(), <a href="qstringref.html#contains">contains</a>(), and <a href="qstringref.html#count">count</a>().</p>
<!-- @@@indexOf -->
<!-- $$$indexOf$$$indexOfQCharintQt::CaseSensitivity -->
<h3 class="fn"><a name="indexOf-3"></a><span class="type">int</span> QStringRef::<span class="name">indexOf</span> ( <span class="type"><a href="qchar.html">QChar</a></span> <i>ch</i>, <span class="type">int</span> <i>from</i> = 0, <span class="type"><a href="qt.html#CaseSensitivity-enum">Qt::CaseSensitivity</a></span> <i>cs</i> = Qt::CaseSensitive ) const</h3>
<p>This function overloads <a href="qstringref.html#indexOf">indexOf</a>().</p>
<p>Returns the index position of the first occurrence of the character <i>ch</i> in the string reference, searching forward from index position <i>from</i>. Returns -1 if <i>ch</i> could not be found.</p>
<p>This function was introduced in Qt 4.8.</p>
<p><b>See also </b><a href="qstring.html#indexOf">QString::indexOf</a>(), <a href="qstringref.html#lastIndexOf">lastIndexOf</a>(), <a href="qstringref.html#contains">contains</a>(), and <a href="qstringref.html#count">count</a>().</p>
<!-- @@@indexOf -->
<!-- $$$indexOf$$$indexOfconstQStringRef&intQt::CaseSensitivity -->
<h3 class="fn"><a name="indexOf-4"></a><span class="type">int</span> QStringRef::<span class="name">indexOf</span> ( const <span class="type">QStringRef</span> &amp; <i>str</i>, <span class="type">int</span> <i>from</i> = 0, <span class="type"><a href="qt.html#CaseSensitivity-enum">Qt::CaseSensitivity</a></span> <i>cs</i> = Qt::CaseSensitive ) const</h3>
<p>This function overloads <a href="qstringref.html#indexOf">indexOf</a>().</p>
<p>Returns the index position of the first occurrence of the string reference <i>str</i> in this string reference, searching forward from index position <i>from</i>. Returns -1 if <i>str</i> is not found.</p>
<p>If <i>cs</i> is <a href="qt.html#CaseSensitivity-enum">Qt::CaseSensitive</a> (default), the search is case sensitive; otherwise the search is case insensitive.</p>
<p>This function was introduced in Qt 4.8.</p>
<p><b>See also </b><a href="qstring.html#indexOf">QString::indexOf</a>(), <a href="qstringref.html#lastIndexOf">lastIndexOf</a>(), <a href="qstringref.html#contains">contains</a>(), and <a href="qstringref.html#count">count</a>().</p>
<!-- @@@indexOf -->
<!-- $$$isEmpty[overload1]$$$isEmpty -->
<h3 class="fn"><a name="isEmpty"></a><span class="type">bool</span> QStringRef::<span class="name">isEmpty</span> () const</h3>
<p>Returns true if the string reference has no characters; otherwise returns false.</p>
<p>A string reference is empty if its size is zero.</p>
<p><b>See also </b><a href="qstringref.html#size">size</a>().</p>
<!-- @@@isEmpty -->
<!-- $$$isNull[overload1]$$$isNull -->
<h3 class="fn"><a name="isNull"></a><span class="type">bool</span> QStringRef::<span class="name">isNull</span> () const</h3>
<p>Returns true if <a href="qstringref.html#string">string</a>() returns a null pointer or a pointer to a null string; otherwise returns true.</p>
<p><b>See also </b><a href="qstringref.html#size">size</a>().</p>
<!-- @@@isNull -->
<!-- $$$lastIndexOf[overload1]$$$lastIndexOfconstQString&intQt::CaseSensitivity -->
<h3 class="fn"><a name="lastIndexOf"></a><span class="type">int</span> QStringRef::<span class="name">lastIndexOf</span> ( const <span class="type"><a href="qstring.html">QString</a></span> &amp; <i>str</i>, <span class="type">int</span> <i>from</i> = -1, <span class="type"><a href="qt.html#CaseSensitivity-enum">Qt::CaseSensitivity</a></span> <i>cs</i> = Qt::CaseSensitive ) const</h3>
<p>Returns the index position of the last occurrence of the string <i>str</i> in this string reference, searching backward from index position <i>from</i>. If <i>from</i> is -1 (default), the search starts at the last character; if <i>from</i> is -2, at the next to last character and so on. Returns -1 if <i>str</i> is not found.</p>
<p>If <i>cs</i> is <a href="qt.html#CaseSensitivity-enum">Qt::CaseSensitive</a> (default), the search is case sensitive; otherwise the search is case insensitive.</p>
<p>This function was introduced in Qt 4.8.</p>
<p><b>See also </b><a href="qstring.html#lastIndexOf">QString::lastIndexOf</a>(), <a href="qstringref.html#indexOf">indexOf</a>(), <a href="qstringref.html#contains">contains</a>(), and <a href="qstringref.html#count">count</a>().</p>
<!-- @@@lastIndexOf -->
<!-- $$$lastIndexOf$$$lastIndexOfQCharintQt::CaseSensitivity -->
<h3 class="fn"><a name="lastIndexOf-2"></a><span class="type">int</span> QStringRef::<span class="name">lastIndexOf</span> ( <span class="type"><a href="qchar.html">QChar</a></span> <i>ch</i>, <span class="type">int</span> <i>from</i> = -1, <span class="type"><a href="qt.html#CaseSensitivity-enum">Qt::CaseSensitivity</a></span> <i>cs</i> = Qt::CaseSensitive ) const</h3>
<p>This function overloads <a href="qstringref.html#lastIndexOf">lastIndexOf</a>().</p>
<p>Returns the index position of the last occurrence of the character <i>ch</i>, searching backward from position <i>from</i>.</p>
<p>This function was introduced in Qt 4.8.</p>
<p><b>See also </b><a href="qstring.html#lastIndexOf">QString::lastIndexOf</a>(), <a href="qstringref.html#indexOf">indexOf</a>(), <a href="qstringref.html#contains">contains</a>(), and <a href="qstringref.html#count">count</a>().</p>
<!-- @@@lastIndexOf -->
<!-- $$$lastIndexOf$$$lastIndexOfQLatin1StringintQt::CaseSensitivity -->
<h3 class="fn"><a name="lastIndexOf-3"></a><span class="type">int</span> QStringRef::<span class="name">lastIndexOf</span> ( <span class="type"><a href="qlatin1string.html">QLatin1String</a></span> <i>str</i>, <span class="type">int</span> <i>from</i> = -1, <span class="type"><a href="qt.html#CaseSensitivity-enum">Qt::CaseSensitivity</a></span> <i>cs</i> = Qt::CaseSensitive ) const</h3>
<p>This function overloads <a href="qstringref.html#lastIndexOf">lastIndexOf</a>().</p>
<p>Returns the index position of the last occurrence of the string <i>str</i> in this string reference, searching backward from index position <i>from</i>. If <i>from</i> is -1 (default), the search starts at the last character; if <i>from</i> is -2, at the next to last character and so on. Returns -1 if <i>str</i> is not found.</p>
<p>If <i>cs</i> is <a href="qt.html#CaseSensitivity-enum">Qt::CaseSensitive</a> (default), the search is case sensitive; otherwise the search is case insensitive.</p>
<p>This function was introduced in Qt 4.8.</p>
<p><b>See also </b><a href="qstring.html#lastIndexOf">QString::lastIndexOf</a>(), <a href="qstringref.html#indexOf">indexOf</a>(), <a href="qstringref.html#contains">contains</a>(), and <a href="qstringref.html#count">count</a>().</p>
<!-- @@@lastIndexOf -->
<!-- $$$lastIndexOf$$$lastIndexOfconstQStringRef&intQt::CaseSensitivity -->
<h3 class="fn"><a name="lastIndexOf-4"></a><span class="type">int</span> QStringRef::<span class="name">lastIndexOf</span> ( const <span class="type">QStringRef</span> &amp; <i>str</i>, <span class="type">int</span> <i>from</i> = -1, <span class="type"><a href="qt.html#CaseSensitivity-enum">Qt::CaseSensitivity</a></span> <i>cs</i> = Qt::CaseSensitive ) const</h3>
<p>This function overloads <a href="qstringref.html#lastIndexOf">lastIndexOf</a>().</p>
<p>Returns the index position of the last occurrence of the string reference <i>str</i> in this string reference, searching backward from index position <i>from</i>. If <i>from</i> is -1 (default), the search starts at the last character; if <i>from</i> is -2, at the next to last character and so on. Returns -1 if <i>str</i> is not found.</p>
<p>If <i>cs</i> is <a href="qt.html#CaseSensitivity-enum">Qt::CaseSensitive</a> (default), the search is case sensitive; otherwise the search is case insensitive.</p>
<p>This function was introduced in Qt 4.8.</p>
<p><b>See also </b><a href="qstring.html#lastIndexOf">QString::lastIndexOf</a>(), <a href="qstringref.html#indexOf">indexOf</a>(), <a href="qstringref.html#contains">contains</a>(), and <a href="qstringref.html#count">count</a>().</p>
<!-- @@@lastIndexOf -->
<!-- $$$length[overload1]$$$length -->
<h3 class="fn"><a name="length"></a><span class="type">int</span> QStringRef::<span class="name">length</span> () const</h3>
<p>Returns the number of characters referred to by the string reference. Equivalent to <a href="qstringref.html#size">size</a>() and <a href="qstringref.html#count">count</a>().</p>
<p><b>See also </b><a href="qstringref.html#position">position</a>() and <a href="qstringref.html#string">string</a>().</p>
<!-- @@@length -->
<!-- $$$localeAwareCompare[overload1]$$$localeAwareCompareconstQStringRef&constQString& -->
<h3 class="fn"><a name="localeAwareCompare"></a><span class="type">int</span> QStringRef::<span class="name">localeAwareCompare</span> ( const <span class="type">QStringRef</span> &amp; <i>s1</i>, const <span class="type"><a href="qstring.html">QString</a></span> &amp; <i>s2</i> )<tt> [static]</tt></h3>
<p>Compares <i>s1</i> with <i>s2</i> and returns an integer less than, equal to, or greater than zero if <i>s1</i> is less than, equal to, or greater than <i>s2</i>.</p>
<p>The comparison is performed in a locale- and also platform-dependent manner. Use this function to present sorted lists of strings to the user.</p>
<p>On Mac OS X, this function compares according the &quot;Order for sorted lists&quot; setting in the International prefereces panel.</p>
<p>This function was introduced in Qt 4.5.</p>
<p><b>See also </b><a href="qstringref.html#compare">compare</a>() and <a href="qtextcodec-qt3.html#locale" class="compat">QTextCodec::locale</a>().</p>
<!-- @@@localeAwareCompare -->
<!-- $$$localeAwareCompare$$$localeAwareCompareconstQStringRef&constQStringRef& -->
<h3 class="fn"><a name="localeAwareCompare-2"></a><span class="type">int</span> QStringRef::<span class="name">localeAwareCompare</span> ( const <span class="type">QStringRef</span> &amp; <i>s1</i>, const <span class="type">QStringRef</span> &amp; <i>s2</i> )<tt> [static]</tt></h3>
<p>This is an overloaded function.</p>
<p>Compares <i>s1</i> with <i>s2</i> and returns an integer less than, equal to, or greater than zero if <i>s1</i> is less than, equal to, or greater than <i>s2</i>.</p>
<p>The comparison is performed in a locale- and also platform-dependent manner. Use this function to present sorted lists of strings to the user.</p>
<p>This function was introduced in Qt 4.5.</p>
<!-- @@@localeAwareCompare -->
<!-- $$$localeAwareCompare$$$localeAwareCompareconstQString& -->
<h3 class="fn"><a name="localeAwareCompare-3"></a><span class="type">int</span> QStringRef::<span class="name">localeAwareCompare</span> ( const <span class="type"><a href="qstring.html">QString</a></span> &amp; <i>other</i> ) const</h3>
<p>This is an overloaded function.</p>
<p>Compares this string with the <i>other</i> string and returns an integer less than, equal to, or greater than zero if this string is less than, equal to, or greater than the <i>other</i> string.</p>
<p>The comparison is performed in a locale- and also platform-dependent manner. Use this function to present sorted lists of strings to the user.</p>
<p>This function was introduced in Qt 4.5.</p>
<!-- @@@localeAwareCompare -->
<!-- $$$localeAwareCompare$$$localeAwareCompareconstQStringRef& -->
<h3 class="fn"><a name="localeAwareCompare-4"></a><span class="type">int</span> QStringRef::<span class="name">localeAwareCompare</span> ( const <span class="type">QStringRef</span> &amp; <i>other</i> ) const</h3>
<p>This is an overloaded function.</p>
<p>Compares this string with the <i>other</i> string and returns an integer less than, equal to, or greater than zero if this string is less than, equal to, or greater than the <i>other</i> string.</p>
<p>The comparison is performed in a locale- and also platform-dependent manner. Use this function to present sorted lists of strings to the user.</p>
<p>This function was introduced in Qt 4.5.</p>
<!-- @@@localeAwareCompare -->
<!-- $$$position[overload1]$$$position -->
<h3 class="fn"><a name="position"></a><span class="type">int</span> QStringRef::<span class="name">position</span> () const</h3>
<p>Returns the starting position in the referenced string that is referred to by the string reference.</p>
<p><b>See also </b><a href="qstringref.html#size">size</a>() and <a href="qstringref.html#string">string</a>().</p>
<!-- @@@position -->
<!-- $$$size[overload1]$$$size -->
<h3 class="fn"><a name="size"></a><span class="type">int</span> QStringRef::<span class="name">size</span> () const</h3>
<p>Returns the number of characters referred to by the string reference. Equivalent to <a href="qstringref.html#length">length</a>() and <a href="qstringref.html#count">count</a>().</p>
<p><b>See also </b><a href="qstringref.html#position">position</a>() and <a href="qstringref.html#string">string</a>().</p>
<!-- @@@size -->
<!-- $$$startsWith[overload1]$$$startsWithconstQString&Qt::CaseSensitivity -->
<h3 class="fn"><a name="startsWith"></a><span class="type">bool</span> QStringRef::<span class="name">startsWith</span> ( const <span class="type"><a href="qstring.html">QString</a></span> &amp; <i>str</i>, <span class="type"><a href="qt.html#CaseSensitivity-enum">Qt::CaseSensitivity</a></span> <i>cs</i> = Qt::CaseSensitive ) const</h3>
<p>Returns true if the string reference starts with <i>str</i>; otherwise returns false.</p>
<p>If <i>cs</i> is <a href="qt.html#CaseSensitivity-enum">Qt::CaseSensitive</a> (default), the search is case sensitive; otherwise the search is case insensitive.</p>
<p>This function was introduced in Qt 4.8.</p>
<p><b>See also </b><a href="qstring.html#startsWith">QString::startsWith</a>() and <a href="qstringref.html#endsWith">endsWith</a>().</p>
<!-- @@@startsWith -->
<!-- $$$startsWith$$$startsWithQLatin1StringQt::CaseSensitivity -->
<h3 class="fn"><a name="startsWith-2"></a><span class="type">bool</span> QStringRef::<span class="name">startsWith</span> ( <span class="type"><a href="qlatin1string.html">QLatin1String</a></span> <i>str</i>, <span class="type"><a href="qt.html#CaseSensitivity-enum">Qt::CaseSensitivity</a></span> <i>cs</i> = Qt::CaseSensitive ) const</h3>
<p>This function overloads <a href="qstringref.html#startsWith">startsWith</a>().</p>
<p>This function was introduced in Qt 4.8.</p>
<p><b>See also </b><a href="qstring.html#startsWith">QString::startsWith</a>() and <a href="qstringref.html#endsWith">endsWith</a>().</p>
<!-- @@@startsWith -->
<!-- $$$startsWith$$$startsWithconstQStringRef&Qt::CaseSensitivity -->
<h3 class="fn"><a name="startsWith-3"></a><span class="type">bool</span> QStringRef::<span class="name">startsWith</span> ( const <span class="type">QStringRef</span> &amp; <i>str</i>, <span class="type"><a href="qt.html#CaseSensitivity-enum">Qt::CaseSensitivity</a></span> <i>cs</i> = Qt::CaseSensitive ) const</h3>
<p>This function overloads <a href="qstringref.html#startsWith">startsWith</a>().</p>
<p>This function was introduced in Qt 4.8.</p>
<p><b>See also </b><a href="qstring.html#startsWith">QString::startsWith</a>() and <a href="qstringref.html#endsWith">endsWith</a>().</p>
<!-- @@@startsWith -->
<!-- $$$startsWith$$$startsWithQCharQt::CaseSensitivity -->
<h3 class="fn"><a name="startsWith-4"></a><span class="type">bool</span> QStringRef::<span class="name">startsWith</span> ( <span class="type"><a href="qchar.html">QChar</a></span> <i>ch</i>, <span class="type"><a href="qt.html#CaseSensitivity-enum">Qt::CaseSensitivity</a></span> <i>cs</i> = Qt::CaseSensitive ) const</h3>
<p>This function overloads <a href="qstringref.html#startsWith">startsWith</a>().</p>
<p>Returns true if the string reference starts with <i>ch</i>; otherwise returns false.</p>
<p>If <i>cs</i> is <a href="qt.html#CaseSensitivity-enum">Qt::CaseSensitive</a> (default), the search is case sensitive; otherwise the search is case insensitive.</p>
<p>This function was introduced in Qt 4.8.</p>
<p><b>See also </b><a href="qstring.html#startsWith">QString::startsWith</a>() and <a href="qstringref.html#endsWith">endsWith</a>().</p>
<!-- @@@startsWith -->
<!-- $$$string[overload1]$$$string -->
<h3 class="fn"><a name="string"></a>const <span class="type"><a href="qstring.html">QString</a></span> * QStringRef::<span class="name">string</span> () const</h3>
<p>Returns a pointer to the string referred to by the string reference, or 0 if it does not reference a string.</p>
<p><b>See also </b><a href="qstringref.html#unicode">unicode</a>().</p>
<!-- @@@string -->
<!-- $$$toAscii[overload1]$$$toAscii -->
<h3 class="fn"><a name="toAscii"></a><span class="type"><a href="qbytearray.html">QByteArray</a></span> QStringRef::<span class="name">toAscii</span> () const</h3>
<p>Returns an 8-bit representation of the string as a <a href="qbytearray.html">QByteArray</a>.</p>
<p>If a codec has been set using <a href="qtextcodec.html#setCodecForCStrings">QTextCodec::setCodecForCStrings</a>(), it is used to convert Unicode to 8-bit char; otherwise this function does the same as <a href="qstringref.html#toLatin1">toLatin1</a>().</p>
<p>Note that, despite the name, this function does not necessarily return an US-ASCII (ANSI X3.4-1986) string and its result may not be US-ASCII compatible.</p>
<p>This function was introduced in Qt 4.8.</p>
<p><b>See also </b><a href="qstringref.html#toLatin1">toLatin1</a>(), <a href="qstringref.html#toUtf8">toUtf8</a>(), <a href="qstringref.html#toLocal8Bit">toLocal8Bit</a>(), and <a href="qtextcodec.html">QTextCodec</a>.</p>
<!-- @@@toAscii -->
<!-- $$$toLatin1[overload1]$$$toLatin1 -->
<h3 class="fn"><a name="toLatin1"></a><span class="type"><a href="qbytearray.html">QByteArray</a></span> QStringRef::<span class="name">toLatin1</span> () const</h3>
<p>Returns a Latin-1 representation of the string as a <a href="qbytearray.html">QByteArray</a>.</p>
<p>The returned byte array is undefined if the string contains non-Latin1 characters. Those characters may be suppressed or replaced with a question mark.</p>
<p>This function was introduced in Qt 4.8.</p>
<p><b>See also </b><a href="qstringref.html#toAscii">toAscii</a>(), <a href="qstringref.html#toUtf8">toUtf8</a>(), <a href="qstringref.html#toLocal8Bit">toLocal8Bit</a>(), and <a href="qtextcodec.html">QTextCodec</a>.</p>
<!-- @@@toLatin1 -->
<!-- $$$toLocal8Bit[overload1]$$$toLocal8Bit -->
<h3 class="fn"><a name="toLocal8Bit"></a><span class="type"><a href="qbytearray.html">QByteArray</a></span> QStringRef::<span class="name">toLocal8Bit</span> () const</h3>
<p>Returns the local 8-bit representation of the string as a <a href="qbytearray.html">QByteArray</a>. The returned byte array is undefined if the string contains characters not supported by the local 8-bit encoding.</p>
<p><a href="qtextcodec.html#codecForLocale">QTextCodec::codecForLocale</a>() is used to perform the conversion from Unicode. If the locale encoding could not be determined, this function does the same as <a href="qstringref.html#toLatin1">toLatin1</a>().</p>
<p>If this string contains any characters that cannot be encoded in the locale, the returned byte array is undefined. Those characters may be suppressed or replaced by another.</p>
<p>This function was introduced in Qt 4.8.</p>
<p><b>See also </b><a href="qstringref.html#toAscii">toAscii</a>(), <a href="qstringref.html#toLatin1">toLatin1</a>(), <a href="qstringref.html#toUtf8">toUtf8</a>(), and <a href="qtextcodec.html">QTextCodec</a>.</p>
<!-- @@@toLocal8Bit -->
<!-- $$$toString[overload1]$$$toString -->
<h3 class="fn"><a name="toString"></a><span class="type"><a href="qstring.html">QString</a></span> QStringRef::<span class="name">toString</span> () const</h3>
<p>Returns a copy of the string reference as a <a href="qstring.html">QString</a> object.</p>
<p>If the string reference is not a complete reference of the string (meaning that <a href="qstringref.html#position">position</a>() is 0 and <a href="qstringref.html#size">size</a>() equals <a href="qstringref.html#string">string</a>()-&gt;<a href="qstringref.html#size">size</a>()), this function will allocate a new string to return.</p>
<p><b>See also </b><a href="qstringref.html#string">string</a>().</p>
<!-- @@@toString -->
<!-- $$$toUcs4[overload1]$$$toUcs4 -->
<h3 class="fn"><a name="toUcs4"></a><span class="type"><a href="qvector.html">QVector</a></span>&lt;<span class="type"><a href="qtglobal.html#uint-typedef">uint</a></span>&gt; QStringRef::<span class="name">toUcs4</span> () const</h3>
<p>Returns a UCS-4/UTF-32 representation of the string as a <a href="qvector.html">QVector</a>&lt;uint&gt;.</p>
<p>UCS-4 is a Unicode codec and is lossless. All characters from this string can be encoded in UCS-4.</p>
<p>This function was introduced in Qt 4.8.</p>
<p><b>See also </b><a href="qstringref.html#toAscii">toAscii</a>(), <a href="qstringref.html#toLatin1">toLatin1</a>(), <a href="qstringref.html#toLocal8Bit">toLocal8Bit</a>(), and <a href="qtextcodec.html">QTextCodec</a>.</p>
<!-- @@@toUcs4 -->
<!-- $$$toUtf8[overload1]$$$toUtf8 -->
<h3 class="fn"><a name="toUtf8"></a><span class="type"><a href="qbytearray.html">QByteArray</a></span> QStringRef::<span class="name">toUtf8</span> () const</h3>
<p>Returns a UTF-8 representation of the string as a <a href="qbytearray.html">QByteArray</a>.</p>
<p>UTF-8 is a Unicode codec and can represent all characters in a Unicode string like <a href="qstring.html">QString</a>.</p>
<p>However, in the Unicode range, there are certain codepoints that are not considered characters. The Unicode standard reserves the last two codepoints in each Unicode Plane (U+FFFE, U+FFFF, U+1FFFE, U+1FFFF, U+2FFFE, etc.), as well as 16 codepoints in the range U+FDD0..U+FDDF, inclusive, as non-characters. If any of those appear in the string, they may be discarded and will not appear in the UTF-8 representation, or they may be replaced by one or more replacement characters.</p>
<p>This function was introduced in Qt 4.8.</p>
<p><b>See also </b><a href="qstringref.html#toAscii">toAscii</a>(), <a href="qstringref.html#toLatin1">toLatin1</a>(), <a href="qstringref.html#toLocal8Bit">toLocal8Bit</a>(), and <a href="qtextcodec.html">QTextCodec</a>.</p>
<!-- @@@toUtf8 -->
<!-- $$$unicode[overload1]$$$unicode -->
<h3 class="fn"><a name="unicode"></a>const <span class="type"><a href="qchar.html">QChar</a></span> * QStringRef::<span class="name">unicode</span> () const</h3>
<p>Returns a Unicode representation of the string reference. Since the data stems directly from the referenced string, it is not null-terminated unless the string reference includes the string's null terminator.</p>
<p><b>See also </b><a href="qstringref.html#string">string</a>().</p>
<!-- @@@unicode -->
<!-- $$$operator=[overload1]$$$operator=constQStringRef& -->
<h3 class="fn"><a name="operator-eq"></a><span class="type">QStringRef</span> &amp; QStringRef::<span class="name">operator=</span> ( const <span class="type">QStringRef</span> &amp; <i>other</i> )</h3>
<p>Assigns the <i>other</i> string reference to this string reference, and returns the result.</p>
<!-- @@@operator= -->
<!-- $$$operator=$$$operator=constQString* -->
<h3 class="fn"><a name="operator-eq-2"></a><span class="type">QStringRef</span> &amp; QStringRef::<span class="name">operator=</span> ( const <span class="type"><a href="qstring.html">QString</a></span> * <i>string</i> )</h3>
<p>Constructs a string reference to the given <i>string</i> and assigns it to this string reference, returning the result.</p>
<!-- @@@operator= -->
</div>
<div class="relnonmem">
<h2>Related Non-Members</h2>
<!-- $$$operator<$$$operator<constQStringRef&constQStringRef& -->
<h3 class="fn"><a name="operator-lt-7"></a><span class="type">bool</span> <span class="name">operator&lt;</span> ( const <span class="type">QStringRef</span> &amp; <i>s1</i>, const <span class="type">QStringRef</span> &amp; <i>s2</i> )</h3>
<p>Returns true if string reference <i>s1</i> is lexically less than string reference <i>s2</i>; otherwise returns false.</p>
<p>The comparison is based exclusively on the numeric Unicode values of the characters and is very fast, but is not what a human would expect. Consider sorting user-interface strings using the <a href="qstring.html#localeAwareCompare">QString::localeAwareCompare</a>() function.</p>
<!-- @@@operator< -->
<!-- $$$operator<=$$$operator<=constQStringRef&constQStringRef& -->
<h3 class="fn"><a name="operator-lt-eq-7"></a><span class="type">bool</span> <span class="name">operator&lt;=</span> ( const <span class="type">QStringRef</span> &amp; <i>s1</i>, const <span class="type">QStringRef</span> &amp; <i>s2</i> )</h3>
<p>Returns true if string reference <i>s1</i> is lexically less than or equal to string reference <i>s2</i>; otherwise returns false.</p>
<p>The comparison is based exclusively on the numeric Unicode values of the characters and is very fast, but is not what a human would expect. Consider sorting user-interface strings using the <a href="qstring.html#localeAwareCompare">QString::localeAwareCompare</a>() function.</p>
<!-- @@@operator<= -->
<!-- $$$operator==$$$operator==constQStringRef&constQStringRef& -->
<h3 class="fn"><a name="operator-eq-eq-14"></a><span class="type">bool</span> <span class="name">operator==</span> ( const <span class="type">QStringRef</span> &amp; <i>s1</i>, const <span class="type">QStringRef</span> &amp; <i>s2</i> )</h3>
<p>Returns true if string reference <i>s1</i> is lexically equal to string reference <i>s2</i>; otherwise returns false.</p>
<!-- @@@operator== -->
<!-- $$$operator==$$$operator==constQString&constQStringRef& -->
<h3 class="fn"><a name="operator-eq-eq-15"></a><span class="type">bool</span> <span class="name">operator==</span> ( const <span class="type"><a href="qstring.html">QString</a></span> &amp; <i>s1</i>, const <span class="type">QStringRef</span> &amp; <i>s2</i> )</h3>
<p>Returns true if string <i>s1</i> is lexically equal to string reference <i>s2</i>; otherwise returns false.</p>
<!-- @@@operator== -->
<!-- $$$operator==$$$operator==constQLatin1String&constQStringRef& -->
<h3 class="fn"><a name="operator-eq-eq-17"></a><span class="type">bool</span> <span class="name">operator==</span> ( const <span class="type"><a href="qlatin1string.html">QLatin1String</a></span> &amp; <i>s1</i>, const <span class="type">QStringRef</span> &amp; <i>s2</i> )</h3>
<p>Returns true if string <i>s1</i> is lexically equal to string reference <i>s2</i>; otherwise returns false.</p>
<!-- @@@operator== -->
<!-- $$$operator>$$$operator>constQStringRef&constQStringRef& -->
<h3 class="fn"><a name="operator-gt-7"></a><span class="type">bool</span> <span class="name">operator&gt;</span> ( const <span class="type">QStringRef</span> &amp; <i>s1</i>, const <span class="type">QStringRef</span> &amp; <i>s2</i> )</h3>
<p>Returns true if string reference <i>s1</i> is lexically greater than string reference <i>s2</i>; otherwise returns false.</p>
<p>The comparison is based exclusively on the numeric Unicode values of the characters and is very fast, but is not what a human would expect. Consider sorting user-interface strings using the <a href="qstring.html#localeAwareCompare">QString::localeAwareCompare</a>() function.</p>
<!-- @@@operator> -->
<!-- $$$operator>=$$$operator>=constQStringRef&constQStringRef& -->
<h3 class="fn"><a name="operator-gt-eq-7"></a><span class="type">bool</span> <span class="name">operator&gt;=</span> ( const <span class="type">QStringRef</span> &amp; <i>s1</i>, const <span class="type">QStringRef</span> &amp; <i>s2</i> )</h3>
<p>Returns true if string reference <i>s1</i> is lexically greater than or equal to string reference <i>s2</i>; otherwise returns false.</p>
<p>The comparison is based exclusively on the numeric Unicode values of the characters and is very fast, but is not what a human would expect. Consider sorting user-interface strings using the <a href="qstring.html#localeAwareCompare">QString::localeAwareCompare</a>() function.</p>
<!-- @@@operator>= -->
</div>
      </div>
    </div>
    </div> 
    <div class="ft">
      <span></span>
    </div>
  </div> 
  <div class="footer">
    <p>
      <acronym title="Copyright">&copy;</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>