diff options
Diffstat (limited to 'doc/man/man3/tqdict.3qt')
-rw-r--r-- | doc/man/man3/tqdict.3qt | 72 |
1 files changed, 36 insertions, 36 deletions
diff --git a/doc/man/man3/tqdict.3qt b/doc/man/man3/tqdict.3qt index ae7e6eed3..677bf3df9 100644 --- a/doc/man/man3/tqdict.3qt +++ b/doc/man/man3/tqdict.3qt @@ -1,5 +1,5 @@ '\" t -.TH QDict 3qt "2 February 2007" "Trolltech AS" \" -*- nroff -*- +.TH TQDict 3qt "2 February 2007" "Trolltech AS" \" -*- nroff -*- .\" Copyright 1992-2007 Trolltech ASA. All rights reserved. See the .\" license file included in the distribution for a complete license .\" statement. @@ -7,25 +7,25 @@ .ad l .nh .SH NAME -QDict \- Template class that provides a dictionary based on TQString keys +TQDict \- Template class that provides a dictionary based on TQString keys .SH SYNOPSIS -\fC#include <ntqdict.h>\fR +\fC#include <tqdict.h>\fR .PP Inherits TQPtrCollection. .PP .SS "Public Members" .in +1c .ti -1c -.BI "\fBQDict\fR ( int size = 17, bool caseSensitive = TRUE )" +.BI "\fBTQDict\fR ( int size = 17, bool caseSensitive = TRUE )" .br .ti -1c -.BI "\fBQDict\fR ( const QDict<type> & dict )" +.BI "\fBTQDict\fR ( const TQDict<type> & dict )" .br .ti -1c -.BI "\fB~QDict\fR ()" +.BI "\fB~TQDict\fR ()" .br .ti -1c -.BI "QDict<type> & \fBoperator=\fR ( const QDict<type> & dict )" +.BI "TQDict<type> & \fBoperator=\fR ( const TQDict<type> & dict )" .br .ti -1c .BI "virtual uint \fBcount\fR () const" @@ -83,15 +83,15 @@ Inherits TQPtrCollection. .br .in -1c .SH DESCRIPTION -The QDict class is a template class that provides a dictionary based on TQString keys. +The TQDict class is a template class that provides a dictionary based on TQString keys. .PP TQMap is an STL-compatible alternative to this class. .PP -QDict is implemented as a template class. Define a template instance QDict<X> to create a dictionary that operates on pointers to X (X *). +TQDict is implemented as a template class. Define a template instance TQDict<X> to create a dictionary that operates on pointers to X (X *). .PP A dictionary is a collection of key-value pairs. The key is a TQString used for insertion, removal and lookup. The value is a pointer. Dictionaries provide very fast insertion and lookup. .PP -If you want to use non-Unicode, plain 8-bit \fCchar*\fR keys, use the QAsciiDict template. A QDict has the same performance as a QAsciiDict. If you want to have a dictionary that maps TQStrings to TQStrings use TQMap. +If you want to use non-Unicode, plain 8-bit \fCchar*\fR keys, use the TQAsciiDict template. A TQDict has the same performance as a TQAsciiDict. If you want to have a dictionary that maps TQStrings to TQStrings use TQMap. .PP The size() of the dictionary is very important. In order to get good performance, you should use a suitably large prime number. Suitable means equal to or larger than the maximum expected number of dictionary items. Size is set in the constructor but may be changed with resize(). .PP @@ -103,17 +103,17 @@ When an item is inserted, the key is converted (hashed) to an integer index into .PP Items with equal keys are allowed. When inserting two items with the same key, only the last inserted item will be accessible (last in, first out) until it is removed. .PP -The QDictIterator class can traverse the dictionary, but only in an arbitrary order. Multiple iterators may independently traverse the same dictionary. +The TQDictIterator class can traverse the dictionary, but only in an arbitrary order. Multiple iterators may independently traverse the same dictionary. .PP When inserting an item into a dictionary, only the pointer is copied, not the item itself, i.e. a shallow copy is made. It is possible to make the dictionary copy all of the item's data (a deep copy) when an item is inserted. insert() calls the virtual function TQPtrCollection::newItem() for the item to be inserted. Inherit a dictionary and reimplement newItem() if you want deep copies. .PP -When removing a dictionary item, the virtual function TQPtrCollection::deleteItem() is called. QDict's default implementation is to delete the item if auto-deletion is enabled. +When removing a dictionary item, the virtual function TQPtrCollection::deleteItem() is called. TQDict's default implementation is to delete the item if auto-deletion is enabled. .PP Example #1: .PP .nf .br - QDict<QLineEdit> fields; // TQString keys, QLineEdit* values + TQDict<QLineEdit> fields; // TQString keys, QLineEdit* values .br fields.insert( "forename", new QLineEdit( this ) ); .br @@ -125,7 +125,7 @@ Example #1: fields["surname"]->setText( "Simpson" ); .br .br - QDictIterator<QLineEdit> it( fields ); // See QDictIterator + TQDictIterator<QLineEdit> it( fields ); // See TQDictIterator .br for( ; it.current(); ++it ) .br @@ -159,7 +159,7 @@ Example #2: .br styleList.sort(); .br - QDict<int> letterDict( 17, FALSE ); + TQDict<int> letterDict( 17, FALSE ); .br for ( TQStringList::Iterator it = styleList.begin(); it != styleList.end(); ++it ) { .br @@ -200,19 +200,19 @@ In the example we are using the dictionary to provide fast random access to the .PP We first obtain the list of available styles, then sort them so that the menu items will be ordered alphabetically. Next we create a dictionary of int pointers. The keys in the dictionary are each one character long, representing letters that have been used for accelerators. We iterate through our list of style names. If the first letter of the style name is in the dictionary, i.e. has been used, we iterate over all the characters in the style name to see if we can find a letter that hasn't been used. If we find an unused letter we put the accelerator ampersand (&) in front of it and add that letter to the dictionary. If we can't find an unused letter the style will simply have no accelerator. If the first letter of the style name is not in the dictionary we use it for the accelerator and add it to the dictionary. Finally we create a TQAction for each style. .PP -See also QDictIterator, QAsciiDict, QIntDict, TQPtrDict, Collection Classes, and Non-GUI Classes. +See also TQDictIterator, TQAsciiDict, TQIntDict, TQPtrDict, Collection Classes, and Non-GUI Classes. .SH MEMBER FUNCTION DOCUMENTATION -.SH "QDict::QDict ( int size = 17, bool caseSensitive = TRUE )" +.SH "TQDict::TQDict ( int size = 17, bool caseSensitive = TRUE )" Constructs a dictionary optimized for less than \fIsize\fR entries. .PP We recommend setting \fIsize\fR to a suitably large prime number (e.g. a prime that's slightly larger than the expected number of entries). This makes the hash distribution better which will lead to faster lookup. .PP If \fIcaseSensitive\fR is TRUE (the default), keys which differ only by case are considered different. -.SH "QDict::QDict ( const QDict<type> & dict )" +.SH "TQDict::TQDict ( const TQDict<type> & dict )" Constructs a copy of \fIdict\fR. .PP Each item in \fIdict\fR is inserted into this dictionary. Only the pointers are copied (shallow copy). -.SH "QDict::~QDict ()" +.SH "TQDict::~TQDict ()" Removes all items from the dictionary and destroys it. If setAutoDelete() is TRUE, each value is deleted. All iterators that access this dictionary will be reset. .PP See also setAutoDelete(). @@ -220,7 +220,7 @@ See also setAutoDelete(). Returns the setting of the auto-delete option. The default is FALSE. .PP See also setAutoDelete(). -.SH "void QDict::clear ()\fC [virtual]\fR" +.SH "void TQDict::clear ()\fC [virtual]\fR" Removes all items from the dictionary. .PP The removed items are deleted if auto-deletion is enabled. @@ -230,13 +230,13 @@ All dictionary iterators that operate on the dictionary are reset. See also remove(), take(), and setAutoDelete(). .PP Reimplemented from TQPtrCollection. -.SH "uint QDict::count () const\fC [virtual]\fR" +.SH "uint TQDict::count () const\fC [virtual]\fR" Returns the number of items in the dictionary. .PP See also isEmpty(). .PP Reimplemented from TQPtrCollection. -.SH "type * QDict::find ( const TQString & key ) const" +.SH "type * TQDict::find ( const TQString & key ) const" Returns the item with key \fIkey\fR, or 0 if the key does not exist in the dictionary. .PP If there are two or more items with equal keys, then the most recently inserted item will be found. @@ -244,7 +244,7 @@ If there are two or more items with equal keys, then the most recently inserted Equivalent to the [] operator. .PP See also operator[](). -.SH "void QDict::insert ( const TQString & key, const type * item )" +.SH "void TQDict::insert ( const TQString & key, const type * item )" Inserts the key \fIkey\fR with value \fIitem\fR into the dictionary. .PP Multiple items can have the same key, in which case only the last item will be accessible using operator[](). @@ -254,15 +254,15 @@ Multiple items can have the same key, in which case only the last item will be a See also replace(). .PP Example: themes/themes.cpp. -.SH "bool QDict::isEmpty () const" +.SH "bool TQDict::isEmpty () const" Returns TRUE if the dictionary is empty, i.e. count() == 0; otherwise returns FALSE. .PP See also count(). -.SH "QDict<type> & QDict::operator= ( const QDict<type> & dict )" +.SH "TQDict<type> & TQDict::operator= ( const TQDict<type> & dict )" Assigns \fIdict\fR to this dictionary and returns a reference to this dictionary. .PP This dictionary is first cleared, then each item in \fIdict\fR is inserted into this dictionary. Only the pointers are copied (shallow copy), unless newItem() has been reimplemented. -.SH "type * QDict::operator[] ( const TQString & key ) const" +.SH "type * TQDict::operator[] ( const TQString & key ) const" Returns the item with key \fIkey\fR, or 0 if the key does not exist in the dictionary. .PP If there are two or more items with equal keys, then the most recently inserted item will be found. @@ -270,13 +270,13 @@ If there are two or more items with equal keys, then the most recently inserted Equivalent to the find() function. .PP See also find(). -.SH "QDataStream & QDict::read ( QDataStream & s, TQPtrCollection::Item & item )\fC [virtual protected]\fR" +.SH "QDataStream & TQDict::read ( QDataStream & s, TQPtrCollection::Item & item )\fC [virtual protected]\fR" Reads a dictionary item from the stream \fIs\fR and returns a reference to the stream. .PP The default implementation sets \fIitem\fR to 0. .PP See also write(). -.SH "bool QDict::remove ( const TQString & key )" +.SH "bool TQDict::remove ( const TQString & key )" Removes the item with \fIkey\fR from the dictionary. Returns TRUE if successful, i.e. if the item is in the dictionary; otherwise returns FALSE. .PP If there are two or more items with equal keys, then the last item that was inserted will be removed. @@ -286,7 +286,7 @@ The removed item is deleted if auto-deletion is enabled. All dictionary iterators that refer to the removed item will be set to point to the next item in the dictionary's traversal order. .PP See also take(), clear(), and setAutoDelete(). -.SH "void QDict::replace ( const TQString & key, const type * item )" +.SH "void TQDict::replace ( const TQString & key, const type * item )" Replaces the value of the key, \fIkey\fR with \fIitem\fR. .PP If the item does not already exist, it will be inserted. @@ -297,7 +297,7 @@ Equivalent to: .PP .nf .br - QDict<char> dict; + TQDict<char> dict; .br ... .br @@ -312,7 +312,7 @@ Equivalent to: If there are two or more items with equal keys, then the last item that was inserted will be replaced. .PP See also insert(). -.SH "void QDict::resize ( uint newsize )" +.SH "void TQDict::resize ( uint newsize )" Changes the size of the hash table to \fInewsize\fR. The contents of the dictionary are preserved, but all iterators on the dictionary become invalid. .SH "void TQPtrCollection::setAutoDelete ( bool enable )" Sets the collection to auto-delete its contents if \fIenable\fR is TRUE and to never delete them if \fIenable\fR is FALSE. @@ -327,13 +327,13 @@ See also autoDelete(). .PP Examples: .)l grapher/grapher.cpp, scribble/scribble.cpp, and table/bigtable/main.cpp. -.SH "uint QDict::size () const" +.SH "uint TQDict::size () const" Returns the size of the internal hash array (as specified in the constructor). .PP See also count(). -.SH "void QDict::statistics () const" +.SH "void TQDict::statistics () const" Debugging-only function that prints out the dictionary distribution using tqDebug(). -.SH "type * QDict::take ( const TQString & key )" +.SH "type * TQDict::take ( const TQString & key )" Takes the item with \fIkey\fR out of the dictionary without deleting it (even if auto-deletion is enabled). .PP If there are two or more items with equal keys, then the last item that was inserted will be taken. @@ -343,13 +343,13 @@ Returns a pointer to the item taken out, or 0 if the key does not exist in the d All dictionary iterators that refer to the taken item will be set to point to the next item in the dictionary traversal order. .PP See also remove(), clear(), and setAutoDelete(). -.SH "QDataStream & QDict::write ( QDataStream & s, TQPtrCollection::Item ) const\fC [virtual protected]\fR" +.SH "QDataStream & TQDict::write ( QDataStream & s, TQPtrCollection::Item ) const\fC [virtual protected]\fR" Writes a dictionary item to the stream \fIs\fR and returns a reference to the stream. .PP See also read(). .SH "SEE ALSO" -.BR http://doc.trolltech.com/ntqdict.html +.BR http://doc.trolltech.com/tqdict.html .BR http://www.trolltech.com/faq/tech.html .SH COPYRIGHT Copyright 1992-2007 Trolltech ASA, http://www.trolltech.com. See the |