1 | <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
|
---|
2 | <!-- /home/espenr/tmp/qt-3.3.8-espenr-2499/qt-x11-free-3.3.8/doc/qptrlist.doc:1044 -->
|
---|
3 | <html>
|
---|
4 | <head>
|
---|
5 | <meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
|
---|
6 | <title>QStrList Class</title>
|
---|
7 | <style type="text/css"><!--
|
---|
8 | fn { margin-left: 1cm; text-indent: -1cm; }
|
---|
9 | a:link { color: #004faf; text-decoration: none }
|
---|
10 | a:visited { color: #672967; text-decoration: none }
|
---|
11 | body { background: #ffffff; color: black; }
|
---|
12 | --></style>
|
---|
13 | </head>
|
---|
14 | <body>
|
---|
15 |
|
---|
16 | <table border="0" cellpadding="0" cellspacing="0" width="100%">
|
---|
17 | <tr bgcolor="#E5E5E5">
|
---|
18 | <td valign=center>
|
---|
19 | <a href="index.html">
|
---|
20 | <font color="#004faf">Home</font></a>
|
---|
21 | | <a href="classes.html">
|
---|
22 | <font color="#004faf">All Classes</font></a>
|
---|
23 | | <a href="mainclasses.html">
|
---|
24 | <font color="#004faf">Main Classes</font></a>
|
---|
25 | | <a href="annotated.html">
|
---|
26 | <font color="#004faf">Annotated</font></a>
|
---|
27 | | <a href="groups.html">
|
---|
28 | <font color="#004faf">Grouped Classes</font></a>
|
---|
29 | | <a href="functions.html">
|
---|
30 | <font color="#004faf">Functions</font></a>
|
---|
31 | </td>
|
---|
32 | <td align="right" valign="center"><img src="logo32.png" align="right" width="64" height="32" border="0"></td></tr></table><h1 align=center>QStrList Class Reference</h1>
|
---|
33 |
|
---|
34 | <p>The QStrList class provides a doubly-linked list of char*.
|
---|
35 | <a href="#details">More...</a>
|
---|
36 | <p><tt>#include <<a href="qstrlist-h.html">qstrlist.h</a>></tt>
|
---|
37 | <p>Inherits <a href="qptrlist.html">QPtrList</a><char>.
|
---|
38 | <p>Inherited by <a href="qstrilist.html">QStrIList</a>.
|
---|
39 | <p><a href="qstrlist-members.html">List of all member functions.</a>
|
---|
40 | <h2>Public Members</h2>
|
---|
41 | <ul>
|
---|
42 | <li class=fn><a href="#QStrList"><b>QStrList</b></a> ( bool deepCopies = TRUE )</li>
|
---|
43 | <li class=fn><a href="#QStrList-2"><b>QStrList</b></a> ( const QStrList & list )</li>
|
---|
44 | <li class=fn><a href="#~QStrList"><b>~QStrList</b></a> ()</li>
|
---|
45 | <li class=fn>QStrList & <a href="#operator-eq"><b>operator=</b></a> ( const QStrList & list )</li>
|
---|
46 | </ul>
|
---|
47 | <hr><a name="details"></a><h2>Detailed Description</h2>
|
---|
48 |
|
---|
49 |
|
---|
50 | The QStrList class provides a doubly-linked list of char*.
|
---|
51 | <p>
|
---|
52 |
|
---|
53 |
|
---|
54 | <p> If you want a string list of <a href="qstring.html">QString</a>s use <a href="qstringlist.html">QStringList</a>.
|
---|
55 | <p> This class is a <a href="qptrlist.html">QPtrList</a><char> instance (a list of char*).
|
---|
56 | <p> QStrList can make deep or shallow copies of the strings that are
|
---|
57 | inserted.
|
---|
58 | <p> A <a href="shclass.html#deep-copy">deep copy</a> means that memory is allocated for the string and then
|
---|
59 | the string data is copied into that memory. A <a href="shclass.html#shallow-copy">shallow copy</a> is just
|
---|
60 | a copy of the pointer value and not of the string data itself.
|
---|
61 | <p> The disadvantage of shallow copies is that because a pointer can
|
---|
62 | be deleted only once, the program must put all strings in a
|
---|
63 | central place and know when it is safe to delete them (i.e. when
|
---|
64 | the strings are no longer referenced by other parts of the
|
---|
65 | program). This can make the program more complex. The advantage of
|
---|
66 | shallow copies is that they consume far less memory than deep
|
---|
67 | copies. It is also much faster to copy a pointer (typically 4 or 8
|
---|
68 | bytes) than to copy string data.
|
---|
69 | <p> A QStrList that operates on deep copies will, by default, turn on
|
---|
70 | auto-deletion (see <a href="qptrcollection.html#setAutoDelete">setAutoDelete</a>()). Thus, by default QStrList
|
---|
71 | will deallocate any string copies it allocates.
|
---|
72 | <p> The virtual <a href="qptrlist.html#compareItems">compareItems</a>() function is reimplemented and does a
|
---|
73 | case-sensitive string comparison. The <a href="qptrlist.html#inSort">inSort</a>() function will
|
---|
74 | insert strings in sorted order. In general it is fastest to insert
|
---|
75 | the strings as they come and <a href="qptrlist.html#sort">sort</a>() at the end; inSort() is useful
|
---|
76 | when you just have to add a few extra strings to an already sorted
|
---|
77 | list.
|
---|
78 | <p> The <a href="qstrlistiterator.html">QStrListIterator</a> class is an iterator for QStrList.
|
---|
79 | <p>See also <a href="collection.html">Collection Classes</a>, <a href="text.html">Text Related Classes</a>, and <a href="tools.html">Non-GUI Classes</a>.
|
---|
80 |
|
---|
81 | <hr><h2>Member Function Documentation</h2>
|
---|
82 | <h3 class=fn><a name="QStrList"></a>QStrList::QStrList ( bool deepCopies = TRUE )
|
---|
83 | </h3>
|
---|
84 |
|
---|
85 | <p> Constructs an empty list of strings. Will make deep copies of all
|
---|
86 | inserted strings if <em>deepCopies</em> is TRUE, or use shallow copies
|
---|
87 | if <em>deepCopies</em> is FALSE.
|
---|
88 |
|
---|
89 | <h3 class=fn><a name="QStrList-2"></a>QStrList::QStrList ( const <a href="qstrlist.html">QStrList</a> & list )
|
---|
90 | </h3>
|
---|
91 |
|
---|
92 | <p> Constructs a copy of <em>list</em>.
|
---|
93 | <p> If <em>list</em> has deep copies, this list will also get deep copies.
|
---|
94 | Only the pointers are copied (shallow copy) if the other list does
|
---|
95 | not use deep copies.
|
---|
96 |
|
---|
97 | <h3 class=fn><a name="~QStrList"></a>QStrList::~QStrList ()
|
---|
98 | </h3>
|
---|
99 |
|
---|
100 | <p> Destroys the list. All strings are removed.
|
---|
101 |
|
---|
102 | <h3 class=fn><a href="qstrlist.html">QStrList</a> & <a name="operator-eq"></a>QStrList::operator= ( const <a href="qstrlist.html">QStrList</a> & list )
|
---|
103 | </h3>
|
---|
104 |
|
---|
105 | <p> Assigns <em>list</em> to this list and returns a reference to this list.
|
---|
106 | <p> If <em>list</em> has deep copies, this list will also get deep copies.
|
---|
107 | Only the pointers are copied (shallow copy) if the other list does
|
---|
108 | not use deep copies.
|
---|
109 |
|
---|
110 | <!-- eof -->
|
---|
111 | <hr><p>
|
---|
112 | This file is part of the <a href="index.html">Qt toolkit</a>.
|
---|
113 | Copyright © 1995-2007
|
---|
114 | <a href="http://www.trolltech.com/">Trolltech</a>. All Rights Reserved.<p><address><hr><div align=center>
|
---|
115 | <table width=100% cellspacing=0 border=0><tr>
|
---|
116 | <td>Copyright © 2007
|
---|
117 | <a href="troll.html">Trolltech</a><td align=center><a href="trademarks.html">Trademarks</a>
|
---|
118 | <td align=right><div align=right>Qt 3.3.8</div>
|
---|
119 | </table></div></address></body>
|
---|
120 | </html>
|
---|