Sophie

Sophie

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

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" />
<!-- q3asciidict.qdoc -->
  <title>Qt 4.8: Q3AsciiDict 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>Qt3SupportLight</li>
<li>Q3AsciiDict</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="#protected-functions">Protected Functions</a></li>
<li class="level1"><a href="#details">Detailed Description</a></li>
</ul>
</div>
<h1 class="title">Q3AsciiDict Class Reference</h1>
<!-- $$$Q3AsciiDict-brief -->
<p>The Q3AsciiDict class is a template class that provides a dictionary based on char* keys. <a href="#details">More...</a></p>
<!-- @@@Q3AsciiDict -->
<pre class="cpp"> <span class="preprocessor">#include &lt;Q3AsciiDict&gt;</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">Porting to Qt 4</a> for more information.</p>
<p><b>Inherits: </b><a href="q3ptrcollection.html">Q3PtrCollection</a>.</p>
<ul>
<li><a href="q3asciidict-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="q3asciidict.html#Q3AsciiDict">Q3AsciiDict</a></b> ( int <i>size</i> = 17, bool <i>caseSensitive</i> = true, bool <i>copyKeys</i> = true )</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> </td><td class="memItemRight bottomAlign"><b><a href="q3asciidict.html#Q3AsciiDict-2">Q3AsciiDict</a></b> ( const Q3AsciiDict&lt;type&gt; &amp; <i>dict</i> )</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> </td><td class="memItemRight bottomAlign"><b><a href="q3asciidict.html#dtor.Q3AsciiDict">~Q3AsciiDict</a></b> ()</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> type * </td><td class="memItemRight bottomAlign"><b><a href="q3asciidict.html#find">find</a></b> ( const char * <i>key</i> ) const</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> void </td><td class="memItemRight bottomAlign"><b><a href="q3asciidict.html#insert">insert</a></b> ( const char * <i>key</i>, const type * <i>item</i> )</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> bool </td><td class="memItemRight bottomAlign"><b><a href="q3asciidict.html#isEmpty">isEmpty</a></b> () const</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> bool </td><td class="memItemRight bottomAlign"><b><a href="q3asciidict.html#remove">remove</a></b> ( const char * <i>key</i> )</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> void </td><td class="memItemRight bottomAlign"><b><a href="q3asciidict.html#replace">replace</a></b> ( const char * <i>key</i>, const type * <i>item</i> )</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> void </td><td class="memItemRight bottomAlign"><b><a href="q3asciidict.html#resize">resize</a></b> ( uint <i>newsize</i> )</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> uint </td><td class="memItemRight bottomAlign"><b><a href="q3asciidict.html#size">size</a></b> () const</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> void </td><td class="memItemRight bottomAlign"><b><a href="q3asciidict.html#statistics">statistics</a></b> () const</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> type * </td><td class="memItemRight bottomAlign"><b><a href="q3asciidict.html#take">take</a></b> ( const char * <i>key</i> )</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> Q3AsciiDict&lt;type&gt; &amp; </td><td class="memItemRight bottomAlign"><b><a href="q3asciidict.html#operator-eq">operator=</a></b> ( const Q3AsciiDict&lt;type&gt; &amp; <i>dict</i> )</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> type * </td><td class="memItemRight bottomAlign"><b><a href="q3asciidict.html#operator-5b-5d">operator[]</a></b> ( const char * <i>key</i> ) const</td></tr>
</table>
<a name="reimplemented-public-functions"></a>
<h2>Reimplemented Public Functions</h2>
<table class="alignedsummary">
<tr><td class="memItemLeft rightAlign topAlign"> virtual void </td><td class="memItemRight bottomAlign"><b><a href="q3asciidict.html#clear">clear</a></b> ()</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> virtual uint </td><td class="memItemRight bottomAlign"><b><a href="q3asciidict.html#count">count</a></b> () const</td></tr>
</table>
<ul>
<li class="fn">4 public functions inherited from <a href="q3ptrcollection.html#public-functions">Q3PtrCollection</a></li>
</ul>
<a name="protected-functions"></a>
<h2>Protected Functions</h2>
<table class="alignedsummary">
<tr><td class="memItemLeft rightAlign topAlign"> virtual QDataStream &amp; </td><td class="memItemRight bottomAlign"><b><a href="q3asciidict.html#read">read</a></b> ( QDataStream &amp; <i>s</i>, Q3PtrCollection::Item &amp; <i>item</i> )</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> virtual QDataStream &amp; </td><td class="memItemRight bottomAlign"><b><a href="q3asciidict.html#write">write</a></b> ( QDataStream &amp; <i>s</i>, Q3PtrCollection::Item <i>item</i> ) const</td></tr>
</table>
<ul>
<li class="fn">2 protected functions inherited from <a href="q3ptrcollection.html#protected-functions">Q3PtrCollection</a></li>
</ul>
<a name="details"></a>
<!-- $$$Q3AsciiDict-description -->
<div class="descr">
<h2>Detailed Description</h2>
<p>The Q3AsciiDict class is a template class that provides a dictionary based on char* keys.</p>
<p>Q3AsciiDict is implemented as a template class. Define a template instance Q3AsciiDict&lt;X&gt; to create a dictionary that operates on pointers to X (X*).</p>
<p>A dictionary is a collection of key-value pairs. The key is a char* used for insertion, removal and lookup. The value is a pointer. Dictionaries provide very fast insertion and lookup.</p>
<p>Q3AsciiDict cannot handle Unicode keys; use the <a href="q3dict.html">Q3Dict</a> template instead, which uses <a href="qstring.html">QString</a> keys. A <a href="q3dict.html">Q3Dict</a> has the same performace as a Q3AsciiDict.</p>
<p>Example:</p>
<pre class="cpp"> <span class="type">Q3AsciiDict</span><span class="operator">&lt;</span><span class="type"><a href="qlineedit.html">QLineEdit</a></span><span class="operator">&gt;</span> fields; <span class="comment">// char* keys, QLineEdit* values</span>
 fields<span class="operator">.</span><a href="q3asciidict.html#insert">insert</a>( <span class="string">&quot;forename&quot;</span><span class="operator">,</span> <span class="keyword">new</span> <span class="type"><a href="qlineedit.html">QLineEdit</a></span>( <span class="keyword">this</span> ) );
 fields<span class="operator">.</span><a href="q3asciidict.html#insert">insert</a>( <span class="string">&quot;surname&quot;</span><span class="operator">,</span> <span class="keyword">new</span> <span class="type"><a href="qlineedit.html">QLineEdit</a></span>( <span class="keyword">this</span> ) );

 fields<span class="operator">[</span><span class="string">&quot;forename&quot;</span><span class="operator">]</span><span class="operator">-</span><span class="operator">&gt;</span>setText( <span class="string">&quot;Homer&quot;</span> );
 fields<span class="operator">[</span><span class="string">&quot;surname&quot;</span><span class="operator">]</span><span class="operator">-</span><span class="operator">&gt;</span>setText( <span class="string">&quot;Simpson&quot;</span> );

 <span class="type"><a href="q3asciidictiterator.html">Q3AsciiDictIterator</a></span><span class="operator">&lt;</span><span class="type"><a href="qlineedit.html">QLineEdit</a></span><span class="operator">&gt;</span> it( fields ); <span class="comment">// See Q3AsciiDictIterator</span>
 <span class="keyword">for</span>( ; it<span class="operator">.</span>current(); <span class="operator">+</span><span class="operator">+</span>it )
     cout <span class="operator">&lt;</span><span class="operator">&lt;</span> it<span class="operator">.</span>currentKey() <span class="operator">&lt;</span><span class="operator">&lt;</span> <span class="string">&quot;: &quot;</span> <span class="operator">&lt;</span><span class="operator">&lt;</span> it<span class="operator">.</span>current()<span class="operator">-</span><span class="operator">&gt;</span>text() <span class="operator">&lt;</span><span class="operator">&lt;</span> endl;
 cout <span class="operator">&lt;</span><span class="operator">&lt;</span> endl;

 <span class="keyword">if</span> ( fields<span class="operator">[</span><span class="string">&quot;forename&quot;</span><span class="operator">]</span> <span class="operator">&amp;</span><span class="operator">&amp;</span> fields<span class="operator">[</span><span class="string">&quot;surname&quot;</span><span class="operator">]</span> )
     cout <span class="operator">&lt;</span><span class="operator">&lt;</span> fields<span class="operator">[</span><span class="string">&quot;forename&quot;</span><span class="operator">]</span><span class="operator">-</span><span class="operator">&gt;</span>text() <span class="operator">&lt;</span><span class="operator">&lt;</span> <span class="string">&quot; &quot;</span>
         <span class="operator">&lt;</span><span class="operator">&lt;</span> fields<span class="operator">[</span><span class="string">&quot;surname&quot;</span><span class="operator">]</span><span class="operator">-</span><span class="operator">&gt;</span>text() <span class="operator">&lt;</span><span class="operator">&lt;</span> endl;  <span class="comment">// Prints &quot;Homer Simpson&quot;</span>

 fields<span class="operator">.</span><a href="q3asciidict.html#remove">remove</a>( <span class="string">&quot;forename&quot;</span> ); <span class="comment">// Does not delete the line edit</span>
 <span class="keyword">if</span> ( <span class="operator">!</span> fields<span class="operator">[</span><span class="string">&quot;forename&quot;</span><span class="operator">]</span> )
     cout <span class="operator">&lt;</span><span class="operator">&lt;</span> <span class="string">&quot;forename is not in the dictionary&quot;</span> <span class="operator">&lt;</span><span class="operator">&lt;</span> endl;</pre>
<p>In this example we use a dictionary to keep track of the line edits we're using. We insert each line edit into the dictionary with a unique name and then access the line edits via the dictionary. See <a href="q3ptrdict.html">Q3PtrDict</a>, <a href="q3intdict.html">Q3IntDict</a> and <a href="q3dict.html">Q3Dict</a>.</p>
<p>See <a href="q3dict.html">Q3Dict</a> for full details, including the choice of dictionary size, and how deletions are handled.</p>
</div>
<p><b>See also </b><a href="q3asciidictiterator.html">Q3AsciiDictIterator</a>, <a href="q3dict.html">Q3Dict</a>, <a href="q3intdict.html">Q3IntDict</a>, and <a href="q3ptrdict.html">Q3PtrDict</a>.</p>
<!-- @@@Q3AsciiDict -->
<div class="func">
<h2>Member Function Documentation</h2>
<!-- $$$Q3AsciiDict[overload1]$$$Q3AsciiDictintboolbool -->
<h3 class="fn"><a name="Q3AsciiDict"></a>Q3AsciiDict::<span class="name">Q3AsciiDict</span> ( <span class="type">int</span> <i>size</i> = 17, <span class="type">bool</span> <i>caseSensitive</i> = true, <span class="type">bool</span> <i>copyKeys</i> = true )</h3>
<p>Constructs a dictionary optimized for less than <i>size</i> entries.</p>
<p>We recommend setting <i>size</i> to a suitably large prime number (a bit larger than the expected number of entries). This makes the hash distribution better and will improve lookup performance.</p>
<p>When <i>caseSensitive</i> is TRUE (the default) <a href="q3asciidict.html" class="compat">Q3AsciiDict</a> treats &quot;abc&quot; and &quot;Abc&quot; as different keys; when it is FALSE &quot;abc&quot; and &quot;Abc&quot; are the same. Case-insensitive comparison only considers the 26 letters in US-ASCII.</p>
<p>If <i>copyKeys</i> is TRUE (the default), the dictionary copies keys using strcpy(); if it is FALSE, the dictionary just copies the pointers.</p>
<!-- @@@Q3AsciiDict -->
<!-- $$$Q3AsciiDict$$$Q3AsciiDictconstQ3AsciiDict<type>& -->
<h3 class="fn"><a name="Q3AsciiDict-2"></a>Q3AsciiDict::<span class="name">Q3AsciiDict</span> ( const <span class="type">Q3AsciiDict</span>&lt;<span class="type">type</span>&gt; &amp; <i>dict</i> )</h3>
<p>Constructs a copy of <i>dict</i>.</p>
<p>Each item in <i>dict</i> is inserted into this dictionary. Only the pointers are copied (shallow copy).</p>
<!-- @@@Q3AsciiDict -->
<!-- $$$~Q3AsciiDict[overload1]$$$~Q3AsciiDict -->
<h3 class="fn"><a name="dtor.Q3AsciiDict"></a>Q3AsciiDict::<span class="name">~Q3AsciiDict</span> ()</h3>
<p>Removes all items from the dictionary and destroys it.</p>
<p>The items are deleted if auto-delete is enabled.</p>
<p>All iterators that access this dictionary will be reset.</p>
<p><b>See also </b><a href="q3ptrcollection.html#setAutoDelete">setAutoDelete</a>().</p>
<!-- @@@~Q3AsciiDict -->
<!-- $$$clear[overload1]$$$clear -->
<h3 class="fn"><a name="clear"></a><span class="type">void</span> Q3AsciiDict::<span class="name">clear</span> ()<tt> [virtual]</tt></h3>
<p>Reimplemented from <a href="q3ptrcollection.html#clear">Q3PtrCollection::clear</a>().</p>
<p>Removes all items from the dictionary.</p>
<p>The removed items are deleted if <a href="q3ptrcollection.html#setAutoDelete">auto-deletion</a> is enabled.</p>
<p>All dictionary iterators that operate on dictionary are reset.</p>
<p><b>See also </b><a href="q3asciidict.html#remove">remove</a>(), <a href="q3asciidict.html#take">take</a>(), and <a href="q3ptrcollection.html#setAutoDelete">setAutoDelete</a>().</p>
<!-- @@@clear -->
<!-- $$$count[overload1]$$$count -->
<h3 class="fn"><a name="count"></a><span class="type"><a href="qtglobal.html#uint-typedef">uint</a></span> Q3AsciiDict::<span class="name">count</span> () const<tt> [virtual]</tt></h3>
<p>Reimplemented from <a href="q3ptrcollection.html#count">Q3PtrCollection::count</a>().</p>
<p>Returns the number of items in the dictionary.</p>
<p><b>See also </b><a href="q3asciidict.html#isEmpty">isEmpty</a>().</p>
<!-- @@@count -->
<!-- $$$find[overload1]$$$findconstchar* -->
<h3 class="fn"><a name="find"></a><span class="type">type</span> * Q3AsciiDict::<span class="name">find</span> ( const <span class="type">char</span> * <i>key</i> ) const</h3>
<p>Returns the item associated with <i>key</i>, or 0 if the key does not exist in the dictionary.</p>
<p>This function uses an internal hashing algorithm to optimize lookup.</p>
<p>If there are two or more items with equal keys, then the item that was most recently inserted will be found.</p>
<p>Equivalent to the [] operator.</p>
<p><b>See also </b><a href="q3asciidict.html#operator-5b-5d">operator[]</a>().</p>
<!-- @@@find -->
<!-- $$$insert[overload1]$$$insertconstchar*consttype* -->
<h3 class="fn"><a name="insert"></a><span class="type">void</span> Q3AsciiDict::<span class="name">insert</span> ( const <span class="type">char</span> * <i>key</i>, const <span class="type">type</span> * <i>item</i> )</h3>
<p>Inserts the <i>key</i> with the <i>item</i> into the dictionary.</p>
<p>Multiple items can have the same key, in which case only the last item will be accessible using <a href="q3asciidict.html#operator-5b-5d">operator[]</a>().</p>
<p><i>item</i> may not be 0.</p>
<p><b>See also </b><a href="q3asciidict.html#replace">replace</a>().</p>
<!-- @@@insert -->
<!-- $$$isEmpty[overload1]$$$isEmpty -->
<h3 class="fn"><a name="isEmpty"></a><span class="type">bool</span> Q3AsciiDict::<span class="name">isEmpty</span> () const</h3>
<p>Returns TRUE if the dictionary is empty, i.e&#x2e; <a href="q3asciidict.html#count">count</a>() == 0; otherwise it returns FALSE.</p>
<p><b>See also </b><a href="q3asciidict.html#count">count</a>().</p>
<!-- @@@isEmpty -->
<!-- $$$read[overload1]$$$readQDataStream&Q3PtrCollection::Item& -->
<h3 class="fn"><a name="read"></a><span class="type"><a href="qdatastream.html">QDataStream</a></span> &amp; Q3AsciiDict::<span class="name">read</span> ( <span class="type"><a href="qdatastream.html">QDataStream</a></span> &amp; <i>s</i>, <span class="type"><a href="q3ptrcollection.html#Item-typedef">Q3PtrCollection::Item</a></span> &amp; <i>item</i> )<tt> [virtual protected]</tt></h3>
<p>Reads a dictionary item from the stream <i>s</i> and returns a reference to the stream.</p>
<p>The default implementation sets <i>item</i> to 0.</p>
<p><b>See also </b><a href="q3asciidict.html#write">write</a>().</p>
<!-- @@@read -->
<!-- $$$remove[overload1]$$$removeconstchar* -->
<h3 class="fn"><a name="remove"></a><span class="type">bool</span> Q3AsciiDict::<span class="name">remove</span> ( const <span class="type">char</span> * <i>key</i> )</h3>
<p>Removes the item associated with <i>key</i> from the dictionary. Returns TRUE if successful, i.e&#x2e; if the key existed in the dictionary; otherwise returns FALSE.</p>
<p>If there are two or more items with equal keys, then the most recently inserted item will be removed.</p>
<p>The removed item is deleted if <a href="q3ptrcollection.html#setAutoDelete">auto-deletion</a> is enabled.</p>
<p>All dictionary iterators that refer to the removed item will be set to point to the next item in the dictionary traversal order.</p>
<p><b>See also </b><a href="q3asciidict.html#take">take</a>(), <a href="q3asciidict.html#clear">clear</a>(), and <a href="q3ptrcollection.html#setAutoDelete">setAutoDelete</a>().</p>
<!-- @@@remove -->
<!-- $$$replace[overload1]$$$replaceconstchar*consttype* -->
<h3 class="fn"><a name="replace"></a><span class="type">void</span> Q3AsciiDict::<span class="name">replace</span> ( const <span class="type">char</span> * <i>key</i>, const <span class="type">type</span> * <i>item</i> )</h3>
<p>Replaces an item that has a key equal to <i>key</i> with <i>item</i>.</p>
<p>If the item does not already exist, it will be inserted.</p>
<p><i>item</i> may not be 0.</p>
<p>Equivalent to:</p>
<pre class="cpp"> <span class="type"><a href="q3asciidict.html">Q3AsciiDict</a></span><span class="operator">&lt;</span><span class="type">char</span><span class="operator">&gt;</span> dict;
     <span class="operator">.</span><span class="operator">.</span><span class="operator">.</span>
 <span class="keyword">if</span> ( dict<span class="operator">.</span>find(key) )
     dict<span class="operator">.</span><a href="q3asciidict.html#remove">remove</a>( key );
 dict<span class="operator">.</span><a href="q3asciidict.html#insert">insert</a>( key<span class="operator">,</span> item );</pre>
<p>If there are two or more items with equal keys, then the most recently inserted item will be replaced.</p>
<p><b>See also </b><a href="q3asciidict.html#insert">insert</a>().</p>
<!-- @@@replace -->
<!-- $$$resize[overload1]$$$resizeuint -->
<h3 class="fn"><a name="resize"></a><span class="type">void</span> Q3AsciiDict::<span class="name">resize</span> ( <span class="type"><a href="qtglobal.html#uint-typedef">uint</a></span> <i>newsize</i> )</h3>
<p>Changes the size of the hashtable to <i>newsize</i>. The contents of the dictionary are preserved but all iterators on the dictionary become invalid.</p>
<!-- @@@resize -->
<!-- $$$size[overload1]$$$size -->
<h3 class="fn"><a name="size"></a><span class="type"><a href="qtglobal.html#uint-typedef">uint</a></span> Q3AsciiDict::<span class="name">size</span> () const</h3>
<p>Returns the size of the internal hash array (as specified in the constructor).</p>
<p><b>See also </b><a href="q3asciidict.html#count">count</a>().</p>
<!-- @@@size -->
<!-- $$$statistics[overload1]$$$statistics -->
<h3 class="fn"><a name="statistics"></a><span class="type">void</span> Q3AsciiDict::<span class="name">statistics</span> () const</h3>
<p>Debugging-only function that prints out the dictionary distribution using <a href="qtglobal.html#qDebug">qDebug</a>().</p>
<!-- @@@statistics -->
<!-- $$$take[overload1]$$$takeconstchar* -->
<h3 class="fn"><a name="take"></a><span class="type">type</span> * Q3AsciiDict::<span class="name">take</span> ( const <span class="type">char</span> * <i>key</i> )</h3>
<p>Takes the item associated with <i>key</i> out of the dictionary without deleting it (even if <a href="q3ptrcollection.html#setAutoDelete">auto-deletion</a> is enabled).</p>
<p>If there are two or more items with equal keys, then the most recently inserted item will be taken.</p>
<p>Returns a pointer to the item taken out, or 0 if the key does not exist in the dictionary.</p>
<p>All dictionary iterators that refer to the taken item will be set to point to the next item in the dictionary traversal order.</p>
<p><b>See also </b><a href="q3asciidict.html#remove">remove</a>(), <a href="q3asciidict.html#clear">clear</a>(), and <a href="q3ptrcollection.html#setAutoDelete">setAutoDelete</a>().</p>
<!-- @@@take -->
<!-- $$$write[overload1]$$$writeQDataStream&Q3PtrCollection::Item -->
<h3 class="fn"><a name="write"></a><span class="type"><a href="qdatastream.html">QDataStream</a></span> &amp; Q3AsciiDict::<span class="name">write</span> ( <span class="type"><a href="qdatastream.html">QDataStream</a></span> &amp; <i>s</i>, <span class="type"><a href="q3ptrcollection.html#Item-typedef">Q3PtrCollection::Item</a></span> <i>item</i> ) const<tt> [virtual protected]</tt></h3>
<p>Writes a dictionary <i>item</i> to the stream <i>s</i> and returns a reference to the stream.</p>
<p><b>See also </b><a href="q3asciidict.html#read">read</a>().</p>
<!-- @@@write -->
<!-- $$$operator=[overload1]$$$operator=constQ3AsciiDict<type>& -->
<h3 class="fn"><a name="operator-eq"></a><span class="type">Q3AsciiDict</span>&lt;<span class="type">type</span>&gt; &amp; Q3AsciiDict::<span class="name">operator=</span> ( const <span class="type">Q3AsciiDict</span>&lt;<span class="type">type</span>&gt; &amp; <i>dict</i> )</h3>
<p>Assigns <i>dict</i> to this dictionary and returns a reference to this dictionary.</p>
<p>This dictionary is first cleared and then each item in <i>dict</i> is inserted into this dictionary. Only the pointers are copied (shallow copy) unless <a href="q3ptrcollection.html#newItem">newItem</a>() has been reimplemented().</p>
<!-- @@@operator= -->
<!-- $$$operator[][overload1]$$$operator[]constchar* -->
<h3 class="fn"><a name="operator-5b-5d"></a><span class="type">type</span> * Q3AsciiDict::<span class="name">operator[]</span> ( const <span class="type">char</span> * <i>key</i> ) const</h3>
<p>Returns the item associated with <i>key</i>, or 0 if the key does not exist in the dictionary.</p>
<p>This function uses an internal hashing algorithm to optimize lookup.</p>
<p>If there are two or more items with equal keys, then the item that was most recently inserted will be found.</p>
<p>Equivalent to the <a href="q3asciidict.html#find">find</a>() function.</p>
<p><b>See also </b><a href="q3asciidict.html#find">find</a>().</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>