Sophie

Sophie

distrib > Mandriva > 8.2 > i586 > by-pkgid > 6282078ae76a671f49c6af38c67b1a07 > files > 543

kdelibs-devel-2.2.2-49.2mdk.i586.rpm

<HTML>
<HEAD>
<TITLE>class KSycocaDict</TITLE>

<META NAME="Generator" CONTENT="KDOC ">
</HEAD>
<BODY bgcolor="#ffffff" text="#000000" link="#0000ff" vlink="#000099" alink= "#ffffff">
<TABLE WIDTH="100%" BORDER="0">
<TR>
<TD>
	<TABLE BORDER="0">
		<TR><TD valign="top" align="left" cellspacing="10">
		<h1>class KSycocaDict</h1>
		</TD>
		<TD valign="top" align="right" colspan="1">
 <small><A HREF="#longdesc">More...</A></small></TD></TR>
	</TABLE>
	<HR>
	<TABLE BORDER="0">
		<TR><TH colspan="2">Internal Use Only</TH></TR><TR><TH>Definition</TH><TD><code>#include &lt;<A HREF="ksycocadict_h.html">ksycocadict.h</A>&gt;</code></TD></TR>
<TR><TH><A HREF="full-list-KSycocaDict.html">List of all Methods</A></TH></TR>
	</TABLE>
	</TD>
<TD align="right"><TABLE BORDER="0"><TR><TD><small><A HREF="index-long.html">Annotated List</A></small></TD></TR>
<TR><TD><small><A HREF="header-list.html">Files</A></small></TD></TR>
<TR><TD><small><A HREF="all-globals.html">Globals</A></small></TD></TR>
<TR><TD><small><A HREF="hier.html">Hierarchy</A></small></TD></TR>
<TR><TD><small><A HREF="index.html">Index</A></small></TD></TR>
</TABLE></TD></TR></TABLE>
<h4>Public Methods</h4><ul><LI>&nbsp;<b><A HREF="#ref1">KSycocaDict</A></b> () 
</LI>
<LI>&nbsp;<b><A HREF="#ref2">KSycocaDict</A></b> (<A HREF="../../../../../../../../../usr/share/doc/qt-2.3.1/html/qdatastream.html">QDataStream</A> *str, int offset) 
</LI>
<LI>&nbsp;<b><A HREF="#ref3">~KSycocaDict</A></b> () 
</LI>
<LI>void &nbsp;<b><A HREF="#ref4">add</A></b> (const <A HREF="../../../../../../../../../usr/share/doc/qt-2.3.1/html/qstring.html">QString</A> &key, <A HREF="KSycocaEntry.html">KSycocaEntry</A> *payload) 
</LI>
<LI>int &nbsp;<b><A HREF="#ref5">find_string</A></b> (const <A HREF="../../../../../../../../../usr/share/doc/qt-2.3.1/html/qstring.html">QString</A> &key ) 
</LI>
<LI>uint &nbsp;<b><A HREF="#ref6">count</A></b> () 
</LI>
<LI>void &nbsp;<b><A HREF="#ref7">clear</A></b> () 
</LI>
<LI>void &nbsp;<b><A HREF="#ref8">save</A></b> (<A HREF="../../../../../../../../../usr/share/doc/qt-2.3.1/html/qdatastream.html">QDataStream</A> &str) 
</LI>
</ul><h4>Protected Methods</h4><ul><LI>Q_UINT32 &nbsp;<b><A HREF="#ref9">hashKey</A></b> ( const <A HREF="../../../../../../../../../usr/share/doc/qt-2.3.1/html/qstring.html">QString</A> &) 
</LI>
</ul><HR><H2><A NAME="longdesc">Detailed Description</A></H2><p>
 Hash table implementation for the sycoca database file
 </p>
<A NAME="KSycocaDict"></A><A NAME="ref1"></A><table width="100%"><tr bgcolor="#eeeeee"><td>&nbsp;<strong>KSycocaDict</strong> ()
<br></td><td align="right"><h3><strong>KSycocaDict</strong></h3></td></tr></table><p></p><p>
 Create an empty dict, for building the database
    </p>
<A NAME="KSycocaDict"></A><A NAME="ref2"></A><table width="100%"><tr bgcolor="#eeeeee"><td>&nbsp;<strong>KSycocaDict</strong> (<A HREF="../../../../../../../../../usr/share/doc/qt-2.3.1/html/qdatastream.html">QDataStream</A> *str, int offset)
<br></td><td align="right"><h3><strong>KSycocaDict</strong></h3></td></tr></table><p></p><p>
 Create a dict from an existing database
    </p>
<A NAME="~KSycocaDict"></A><A NAME="ref3"></A><table width="100%"><tr bgcolor="#eeeeee"><td>&nbsp;<strong>~KSycocaDict</strong> ()
<br></td><td align="right"><h3><strong>~KSycocaDict</strong></h3></td></tr></table><p></p><A NAME="add"></A><A NAME="ref4"></A><table width="100%"><tr bgcolor="#eeeeee"><td>void &nbsp;<strong>add</strong> (const <A HREF="../../../../../../../../../usr/share/doc/qt-2.3.1/html/qstring.html">QString</A> &key, <A HREF="KSycocaEntry.html">KSycocaEntry</A> *payload)
<br></td><td align="right"><h3><strong>add</strong></h3></td></tr></table><p></p><p>
 Adds a 'payload' to the dictionary with key 'key'.
</p>
<p> 'payload' should have a valid offset by the time  
 the dictionary gets saved.
</p>
<A NAME="find_string"></A><A NAME="ref5"></A><table width="100%"><tr bgcolor="#eeeeee"><td>int &nbsp;<strong>find_string</strong> (const <A HREF="../../../../../../../../../usr/share/doc/qt-2.3.1/html/qstring.html">QString</A> &key )
<br></td><td align="right"><h3><strong>find_string</strong></h3></td></tr></table><p></p><p>
 Looks up an entry identified by 'key'.
</p>
<p> If 0 is returned, no matching entry exists.
 Otherwise, the offset of the entry is returned. 
</p>
<p> NOTE: It is not guaranteed that this entry is
 indeed the one you were looking for.
 After loading the entry you should check that it
 indeed matches the search key. If it doesn't
 then no matching entry exists.
    </p>
<A NAME="count"></A><A NAME="ref6"></A><table width="100%"><tr bgcolor="#eeeeee"><td>uint &nbsp;<strong>count</strong> ()
<br></td><td align="right"><h3><strong>count</strong></h3></td></tr></table><p></p><p>
 The number of entries in the dictionary.
</p>
<p> Only valid when building the database.
    </p>
<A NAME="clear"></A><A NAME="ref7"></A><table width="100%"><tr bgcolor="#eeeeee"><td>void &nbsp;<strong>clear</strong> ()
<br></td><td align="right"><h3><strong>clear</strong></h3></td></tr></table><p></p><p>
 Reset the dictionary.
</p>
<p> Only valid when building the database.
    </p>
<A NAME="save"></A><A NAME="ref8"></A><table width="100%"><tr bgcolor="#eeeeee"><td>void &nbsp;<strong>save</strong> (<A HREF="../../../../../../../../../usr/share/doc/qt-2.3.1/html/qdatastream.html">QDataStream</A> &str)
<br></td><td align="right"><h3><strong>save</strong></h3></td></tr></table><p></p><p>
 Save the dictionary to the stream
 A reasonable fast hash algorithm will be created.
</p>
<p> Typically this will find 90% of the entries directly.
 Average hash table size: nrOfItems * 20 bytes.
 Average duplicate list size: nrOfItms * avgKeyLength / 5.
</p>
<p> Unknown keys have an average 20% chance to give a false hit.
 (That's why your program should check the result)
</p>
<p> Example:
   Assume 1000 items with an average key length of 60 bytes.
</p>
<p>   Approx. 900 items will hash directly to the right entry.
   Approx. 100 items require a lookup in the duplicate list.
</p>
<p>   The hash table size will be approx. 20Kb.
   The duplicate list size will be approx. 12Kb.
</p>
<A NAME="hashKey"></A><A NAME="ref9"></A><table width="100%"><tr bgcolor="#eeeeee"><td>Q_UINT32 &nbsp;<strong>hashKey</strong> ( const <A HREF="../../../../../../../../../usr/share/doc/qt-2.3.1/html/qstring.html">QString</A> &)
<br></td><td align="right"><h3><strong>hashKey</strong></h3></td></tr></table><p> <small>[protected]</small></p><HR>
	<table>
	<tr><td><small>Generated by: qateam on updates.mandrakesoft.com on Mon Dec 30 16:08:56 2002, using kdoc 2.0a53.</small></td></tr>
	</table>
</BODY>
</HTML>