1
<?xml version="1.0" encoding="iso-8859-1"?>
3
PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "DTD/xhtml1-strict.dtd">
4
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
5
<!-- /tmp/qt-4.0.0-espenr-1119621036935/qt-x11-opensource-desktop-4.0.0/src/corelib/tools/qstringlist.cpp -->
7
<title>Qt 4.0: Qt 3 Support Members for QStringList</title>
8
<style>h3.fn,span.fn { margin-left: 1cm; text-indent: -1cm; }
9
a:link { color: #004faf; text-decoration: none }
10
a:visited { color: #672967; text-decoration: none }
11
td.postheader { font-family: sans-serif }
12
tr.address { font-family: sans-serif }
13
body { background: #ffffff; color: black; }</style>
16
<table border="0" cellpadding="0" cellspacing="0" width="100%">
18
<td align="left" valign="top" width="32"><img src="images/qt-logo.png" align="left" width="32" height="32" border="0" /></td>
19
<td width="1"> </td><td class="postheader" valign="center"><a href="index.html"><font color="#004faf">Home</font></a> · <a href="classes.html"><font color="#004faf">All Classes</font></a> · <a href="mainclasses.html"><font color="#004faf">Main Classes</font></a> · <a href="annotated.html"><font color="#004faf">Annotated</font></a> · <a href="groups.html"><font color="#004faf">Grouped Classes</font></a> · <a href="functions.html"><font color="#004faf">Functions</font></a></td>
20
<td align="right" valign="top" width="230"><img src="images/trolltech-logo.png" align="right" width="203" height="32" border="0" /></td></tr></table><h1 align="center">Qt 3 Support Members for QStringList</h1>
21
<p><b>The following class members are part of the Qt 3 support layer.</b> They are provided to help you port old code to Qt 4. We advise against using them in new code.</p>
22
<p><ul><li><a href="qstringlist.html">QStringList class reference</a></li></ul></p>
23
<h3>Public Functions</h3>
25
<li><div class="fn"/>Iterator <b><a href="qstringlist-qt3.html#fromLast">fromLast</a></b> ()</li>
26
<li><div class="fn"/>ConstIterator <b><a href="qstringlist-qt3.html#fromLast-2">fromLast</a></b> () const</li>
27
<li><div class="fn"/>QStringList <b><a href="qstringlist-qt3.html#grep">grep</a></b> ( const QString & <i>str</i>, bool <i>cs</i> = true ) const</li>
28
<li><div class="fn"/>QStringList <b><a href="qstringlist-qt3.html#grep-2">grep</a></b> ( const QRegExp & <i>rx</i> ) const</li>
29
<li><div class="fn"/>QStringList & <b><a href="qstringlist-qt3.html#gres">gres</a></b> ( const QRegExp & <i>rx</i>, const QString & <i>after</i> )</li>
30
<li><div class="fn"/>QStringList & <b><a href="qstringlist-qt3.html#gres-2">gres</a></b> ( const QString & <i>before</i>, const QString & <i>after</i>, bool <i>cs</i> = true )</li>
33
<li><div class="fn"/>7 public functions inherited from <a href="qlist.html#public-functions">QList</a></li>
35
<h3>Static Public Members</h3>
37
<li><div class="fn"/>QStringList <b><a href="qstringlist-qt3.html#split">split</a></b> ( const QRegExp & <i>sep</i>, const QString & <i>str</i>, bool <i>allowEmptyEntries</i> = false )</li>
38
<li><div class="fn"/>QStringList <b><a href="qstringlist-qt3.html#split-2">split</a></b> ( const QChar & <i>sep</i>, const QString & <i>str</i>, bool <i>allowEmptyEntries</i> = false )</li>
39
<li><div class="fn"/>QStringList <b><a href="qstringlist-qt3.html#split-3">split</a></b> ( const QString & <i>sep</i>, const QString & <i>str</i>, bool <i>allowEmptyEntries</i> = false )</li>
42
<h2>Member Function Documentation</h2>
43
<h3 class="fn"><a name="fromLast"></a><a href="qlist.html#Iterator-typedef">Iterator</a> QStringList::fromLast ()</h3>
44
<p>Use <a href="qlist.html#end">end</a>() instead.</p>
45
<p>For example, if you have code like</p>
46
<pre><font color="#404040"> QStringList::Iterator i = list.fromLast();</font></pre>
47
<p>you can rewrite it as</p>
48
<pre> QStringList::Iterator i = list.isEmpty() ? list.end() : --list.end();</pre>
49
<h3 class="fn"><a name="fromLast-2"></a><a href="qlist.html#ConstIterator-typedef">ConstIterator</a> QStringList::fromLast () const</h3>
50
<p>This is an overloaded member function, provided for convenience. It behaves essentially like the above function.</p>
51
<p>Use <a href="qlist.html#end">end</a>() instead.</p>
52
<p>For example, if you have code like</p>
53
<pre><font color="#404040"> QStringList::ConstIterator i = list.fromLast();</font></pre>
54
<p>you can rewrite it as</p>
55
<pre> QStringList::ConstIterator i = list.isEmpty() ? list.end() : --list.end();</pre>
56
<h3 class="fn"><a name="grep"></a>QStringList QStringList::grep ( const <a href="qstring.html">QString</a> & <i>str</i>, bool <i>cs</i> = true ) const</h3>
57
<p>Use <a href="qlist-qt3.html#find">find</a>() instead.</p>
58
<h3 class="fn"><a name="grep-2"></a>QStringList QStringList::grep ( const <a href="qregexp.html">QRegExp</a> & <i>rx</i> ) const</h3>
59
<p>This is an overloaded member function, provided for convenience. It behaves essentially like the above function.</p>
60
<p>Use <a href="qlist-qt3.html#find">find</a>() instead.</p>
61
<h3 class="fn"><a name="gres"></a>QStringList & QStringList::gres ( const <a href="qregexp.html">QRegExp</a> & <i>rx</i>, const <a href="qstring.html">QString</a> & <i>after</i> )</h3>
62
<p>Use <a href="qlist.html#replace">replace</a>() instead.</p>
63
<h3 class="fn"><a name="gres-2"></a>QStringList & QStringList::gres ( const <a href="qstring.html">QString</a> & <i>before</i>, const <a href="qstring.html">QString</a> & <i>after</i>, bool <i>cs</i> = true )</h3>
64
<p>This is an overloaded member function, provided for convenience. It behaves essentially like the above function.</p>
65
<p>Use <a href="qlist.html#replace">replace</a>() instead.</p>
66
<h3 class="fn"><a name="split"></a>QStringList QStringList::split ( const <a href="qregexp.html">QRegExp</a> & <i>sep</i>, const <a href="qstring.html">QString</a> & <i>str</i>, bool <i>allowEmptyEntries</i> = false ) <tt> [static]</tt></h3>
67
<p>Splits the string <i>str</i> into strings wherever the regular expression <i>sep</i> occurs, and returns the list of those strings.</p>
68
<p>If <i>allowEmptyEntries</i> is true, an empty string is inserted in the list wherever the separator matches twice without intervening text.</p>
69
<p>For example, if you split the string "a,,b,c" on commas, split() returns the three-item list "a", "b", "c" if <i>allowEmptyEntries</i> is false (the default), and the four-item list "a", "", "b", "c" if <i>allowEmptyEntries</i> is true.</p>
70
<p>Use <tt>split(QRegExp("\\s+"), str)</tt> to split on arbitrary amounts of whitespace.</p>
71
<p>If <i>sep</i> does not match anywhere in <i>str</i>, split() returns a single element list with the element containing the original string, <i>str</i>.</p>
72
<p>See also <a href="qstringlist.html#join">join</a>() and <a href="qstring.html#section">QString::section</a>().</p>
73
<h3 class="fn"><a name="split-2"></a>QStringList QStringList::split ( const <a href="qchar.html">QChar</a> & <i>sep</i>, const <a href="qstring.html">QString</a> & <i>str</i>, bool <i>allowEmptyEntries</i> = false ) <tt> [static]</tt></h3>
74
<p>This is an overloaded member function, provided for convenience. It behaves essentially like the above function.</p>
75
<p>This version of the function uses a <a href="qchar.html">QChar</a> as separator.</p>
76
<p>See also <a href="qstringlist.html#join">join</a>() and <a href="qstring.html#section">QString::section</a>().</p>
77
<h3 class="fn"><a name="split-3"></a>QStringList QStringList::split ( const <a href="qstring.html">QString</a> & <i>sep</i>, const <a href="qstring.html">QString</a> & <i>str</i>, bool <i>allowEmptyEntries</i> = false ) <tt> [static]</tt></h3>
78
<p>This is an overloaded member function, provided for convenience. It behaves essentially like the above function.</p>
79
<p>This version of the function uses a <a href="qstring.html">QString</a> as separator.</p>
80
<p>If <i>sep</i> is an empty string, the return value is a list of one-character strings: split(<a href="qstring.html">QString</a>(""), "four") returns the four-item list, "f", "o", "u", "r".</p>
81
<p>If <i>allowEmptyEntries</i> is true, an empty string is inserted in the list wherever the separator matches twice without intervening text.</p>
82
<p>See also <a href="qstringlist.html#join">join</a>() and <a href="qstring.html#section">QString::section</a>().</p>
83
<p /><address><hr /><div align="center">
84
<table width="100%" cellspacing="0" border="0"><tr class="address">
85
<td width="30%">Copyright © 2005 <a href="trolltech.html">Trolltech</a></td>
86
<td width="40%" align="center"><a href="trademarks.html">Trademarks</a></td>
87
<td width="30%" align="right"><div align="right">Qt 4.0.0</div></td>
88
</tr></table></div></address></body>