Sophie

Sophie

distrib > Fedora > 15 > i386 > by-pkgid > d2229253b8f3127ab89b179a82cc8466 > files > 461

libqxt-devel-0.6.1-2.fc15.i686.rpm

<?xml version="1.0" encoding="iso-8859-1"?>
<!DOCTYPE html
    PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
<!-- /builddir/build/BUILD/libqxt/src/berkeley/qxtbdbhash.cpp -->
<head>
  <title>QxtBdbHash Class Reference</title>
  <link href="stylesheet.css" rel="stylesheet" type="text/css" />
</head>
<body>
<table border="0" cellpadding="0" cellspacing="0" width="100%">
<tr>
<td align="left" valign="top" width="32"><a href="http://libqxt.org"><img src="images/qxt-logo.png" width="50" height="40" align="left" border="0" /></a></td>
<td width="1">&nbsp;&nbsp;</td><td class="postheader" valign="center"><a href="index.html"><font color="#004faf">Home</font></a>&nbsp;&middot; <a href="modules.html"><font color="#004faf">Modules</font></a>&nbsp;&middot; <a href="classes.html"><font color="#004faf">Classes</font></a>&nbsp;&middot; <a href="namespaces.html"><font color="#004faf">Namespaces</font></a>&nbsp;&middot; <a href="functions.html"><font color="#004faf">Functions</font></a></td>
<td align="right" valign="top" width="230"></td></tr></table><h1 class="title">QxtBdbHash Class Reference<br /><span class="small-subtitle">[<a href="qxtberkeley.html">QxtBerkeley</a> module]</span>
</h1>
<p>The QxtBdbHash class is a template class that provides key/value access to a berkeley db file. <a href="#details">More...</a></p>
<pre>    #include &lt;QxtBdbHash&gt;</pre><ul>
<li><a href="qxtbdbhash-members.html">List of all members, including inherited members</a></li>
</ul>
<a name="public-functions"></a>
<h3>Public Functions</h3>
<ul>
<li><div class="fn"></div><b><a href="qxtbdbhash.html#QxtBdbHash">QxtBdbHash</a></b> ()</li>
<li><div class="fn"></div><b><a href="qxtbdbhash.html#QxtBdbHash-2">QxtBdbHash</a></b> ( QString <i>file</i> )</li>
<li><div class="fn"></div>QxtBdbHashIterator&lt;KEY, VAL&gt; <b><a href="qxtbdbhash.html#begin">begin</a></b> ()</li>
<li><div class="fn"></div>void <b><a href="qxtbdbhash.html#clear">clear</a></b> ()</li>
<li><div class="fn"></div>bool <b><a href="qxtbdbhash.html#contains">contains</a></b> ( const KEY &amp; <i>key</i> ) const</li>
<li><div class="fn"></div>QxtBdbHashIterator&lt;KEY, VAL&gt; <b><a href="qxtbdbhash.html#end">end</a></b> ()</li>
<li><div class="fn"></div>QxtBdbHashIterator&lt;KEY, VAL&gt; <b><a href="qxtbdbhash.html#find">find</a></b> ( const KEY &amp; <i>key</i> )</li>
<li><div class="fn"></div>bool <b><a href="qxtbdbhash.html#flush">flush</a></b> ()</li>
<li><div class="fn"></div>bool <b><a href="qxtbdbhash.html#insert">insert</a></b> ( KEY <i>key</i>, VAL <i>value</i> )</li>
<li><div class="fn"></div>bool <b><a href="qxtbdbhash.html#open">open</a></b> ( QString <i>file</i> )</li>
<li><div class="fn"></div>bool <b><a href="qxtbdbhash.html#remove">remove</a></b> ( const KEY &amp; <i>key</i> )</li>
<li><div class="fn"></div>const VAL <b><a href="qxtbdbhash.html#value">value</a></b> ( const KEY &amp; <i>key</i> ) const</li>
<li><div class="fn"></div>const VAL <b><a href="qxtbdbhash.html#operator-5b-5d">operator[]</a></b> ( const KEY &amp; <i>key</i> ) const</li>
</ul>
<a name="details"></a>
<hr />
<h2>Detailed Description</h2>
<p>The QxtBdbHash class is a template class that provides key/value access to a berkeley db file.</p>
<p>Both value and key must be registered with the qt meta system. You may not touch the file while a QxtBdbHash instance is running on it.</p>
<p>examples usage:</p>
<pre>    QxtBdbHash&lt;qreal,QStringList&gt; db(&quot;test.db&quot;);
    db.insert(344.4,QStringList&lt;&lt;&quot;HI&quot;&lt;&lt;&quot;:)&quot;);
    qDebug()&lt;&lt;db[344.4];</pre>
<p>There is an extensive example in /examples/berkeley/adressbook.</p>
<p>All functions of this class are thread safe. Calling <a href="qxtbdbhash.html#open">open</a>() multiple times is undefined. An iterator may only be used from one thread at once, but you can have multiple iterators.</p>
<p>TODO: {implicitshared}</p>
<p>See also <a href="qxtbdbhashiterator.html">QxtBdbHashIterator</a>.</p>
<hr />
<h2>Member Function Documentation</h2>
<h3 class="fn"><a name="QxtBdbHash"></a>QxtBdbHash::QxtBdbHash ()</h3>
<p>Constructs an invalid <a href="qxtbdbhash.html">QxtBdbHash</a></p>
<h3 class="fn"><a name="QxtBdbHash-2"></a>QxtBdbHash::QxtBdbHash ( <a href="http://doc.qtsoftware.com/4.5/qstring.html">QString</a> <i>file</i> )</h3>
<p>Constructs a <a href="qxtbdbhash.html">QxtBdbHash</a>, and opens the <i>file</i> specified as its database.</p>
<h3 class="fn"><a name="begin"></a><a href="qxtbdbhashiterator.html">QxtBdbHashIterator</a>&lt;KEY, VAL&gt; QxtBdbHash::begin ()</h3>
<p>Returns an iterator to the first key,value pair.</p>
<p>See also <a href="qxtbdbhashiterator.html">QxtBdbHashIterator</a>.</p>
<h3 class="fn"><a name="clear"></a>void QxtBdbHash::clear ()</h3>
<p>Erase all records. This does not delete the underlying file.</p>
<h3 class="fn"><a name="contains"></a>bool QxtBdbHash::contains ( const KEY &amp; <i>key</i> ) const</h3>
<p>Returns <tt>true</tt> if there is a record for the specified <i>key</i>.</p>
<h3 class="fn"><a name="end"></a><a href="qxtbdbhashiterator.html">QxtBdbHashIterator</a>&lt;KEY, VAL&gt; QxtBdbHash::end ()</h3>
<p>Return an iterator to the last key,value pair</p>
<p>See also <a href="qxtbdbhashiterator.html">QxtBdbHashIterator</a>.</p>
<h3 class="fn"><a name="find"></a><a href="qxtbdbhashiterator.html">QxtBdbHashIterator</a>&lt;KEY, VAL&gt; QxtBdbHash::find ( const KEY &amp; <i>key</i> )</h3>
<p>Returns an iterator to the position of the pair identified by <i>key</i></p>
<p>See also <a href="qxtbdbhashiterator.html">QxtBdbHashIterator</a>.</p>
<h3 class="fn"><a name="flush"></a>bool QxtBdbHash::flush ()</h3>
<p>Flushes the underlying DB file. All changes are synced to disk.</p>
<h3 class="fn"><a name="insert"></a>bool QxtBdbHash::insert ( KEY <i>key</i>, VAL <i>value</i> )</h3>
<p>Inserts a record with the specified <i>key</i> / <i>value</i> combination. Replaces any record with the same key. <b>Note:</b> When working with iterators, keep in mind that inserting pairs, works reverse to the iteration.</p>
<h3 class="fn"><a name="open"></a>bool QxtBdbHash::open ( <a href="http://doc.qtsoftware.com/4.5/qstring.html">QString</a> <i>file</i> )</h3>
<p>Opens the specified <i>file</i>.</p>
<p>Returns <tt>true</tt> on success and <tt>false</tt> on failure. <b>Note:</b> A sanity check is performed before opening the file.</p>
<h3 class="fn"><a name="remove"></a>bool QxtBdbHash::remove ( const KEY &amp; <i>key</i> )</h3>
<p>Removes all records with the specified <i>key</i>. Returns <tt>true</tt> on success and <tt>false</tt> on failure.</p>
<h3 class="fn"><a name="value"></a>const VAL QxtBdbHash::value ( const KEY &amp; <i>key</i> ) const</h3>
<p>Returns the value associated with the specified <i>key</i>, or a default contructed value, if no such key exists.</p>
<h3 class="fn"><a name="operator-5b-5d"></a>const VAL QxtBdbHash::operator[] ( const KEY &amp; <i>key</i> ) const</h3>
<p>Same as <a href="qxtbdbhash.html#value">value</a>()</p>
<p /><address><hr /><div align="center">
<table width="100%" cellspacing="0" border="0"><tr class="address">
<td align="left">Copyright &copy; 2007-2010
<a href="mailto:foundation@libqxt.org">Qxt Foundation</a></td>
<td align="right"><div align="right">
<a href="http://libqxt.org">Qxt</a> 0.6.1</div></td>
</tr></table></div></address></body>
</html>