File: classlog4cpp_1_1StringUtil.html

package info (click to toggle)
log4cpp-doc 0.3.5-rc3-1
  • links: PTS
  • area: main
  • in suites: etch, etch-m68k
  • size: 5,664 kB
  • ctags: 925
  • sloc: makefile: 34
file content (235 lines) | stat: -rw-r--r-- 11,640 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html><head><meta http-equiv="Content-Type" content="text/html;charset=iso-8859-1">
<title>log4cpp: log4cpp::StringUtil Class Reference</title>
<link href="doxygen.css" rel="stylesheet" type="text/css">
</head><body>
<!-- Generated by Doxygen 1.4.2 -->
<div class="qindex"><a class="qindex" href="index.html">Main&nbsp;Page</a> | <a class="qindex" href="namespaces.html">Namespace List</a> | <a class="qindex" href="hierarchy.html">Class&nbsp;Hierarchy</a> | <a class="qindex" href="annotated.html">Class&nbsp;List</a> | <a class="qindex" href="dirs.html">Directories</a> | <a class="qindex" href="files.html">File&nbsp;List</a> | <a class="qindex" href="namespacemembers.html">Namespace&nbsp;Members</a> | <a class="qindex" href="functions.html">Class&nbsp;Members</a> | <a class="qindex" href="globals.html">File&nbsp;Members</a> | <a class="qindex" href="pages.html">Related&nbsp;Pages</a></div>
<div class="nav">
<a class="el" href="namespacelog4cpp.html">log4cpp</a>::<a class="el" href="classlog4cpp_1_1StringUtil.html">StringUtil</a></div>
<h1>log4cpp::StringUtil Class Reference</h1><code>#include &lt;<a class="el" href="StringUtil_8hh-source.html">StringUtil.hh</a>&gt;</code>
<p>
<a href="classlog4cpp_1_1StringUtil-members.html">List of all members.</a><table border="0" cellpadding="0" cellspacing="0">
<tr><td></td></tr>
<tr><td colspan="2"><br><h2>Static Public Member Functions</h2></td></tr>
<tr><td class="memItemLeft" nowrap align="right" valign="top">static std::string&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="classlog4cpp_1_1StringUtil.html#e0">vform</a> (const char *format, va_list args)</td></tr>

<tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">Returns a string contructed from the a format specifier and a va_list of arguments, analogously to vprintf(3).  <a href="#e0"></a><br></td></tr>
<tr><td class="memItemLeft" nowrap align="right" valign="top">static std::string&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="classlog4cpp_1_1StringUtil.html#e1">trim</a> (const std::string &amp;s)</td></tr>

<tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">Returns a string identical to the given string but without leading or trailing HTABs or spaces.  <a href="#e1"></a><br></td></tr>
<tr><td class="memItemLeft" nowrap align="right" valign="top">static unsigned int&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="classlog4cpp_1_1StringUtil.html#e2">split</a> (std::vector&lt; std::string &gt; &amp;v, const std::string &amp;s, char delimiter, unsigned int maxSegments=INT_MAX)</td></tr>

<tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">splits a string into a vector of string segments based on the given delimiter.  <a href="#e2"></a><br></td></tr>
<tr><td class="memTemplParams" nowrap colspan="2">template&lt;typename T&gt; </td></tr>
<tr><td class="memTemplItemLeft" nowrap align="right" valign="top">static unsigned int&nbsp;</td><td class="memTemplItemRight" valign="bottom"><a class="el" href="classlog4cpp_1_1StringUtil.html#e3">split</a> (T &amp;output, const std::string &amp;s, char delimiter, unsigned int maxSegments=INT_MAX)</td></tr>

<tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">splits a string into string segments based on the given delimiter and assigns the segments through an output_iterator.  <a href="#e3"></a><br></td></tr>
</table>
<hr><h2>Member Function Documentation</h2>
<a class="anchor" name="e3" doxytag="log4cpp::StringUtil::split"></a><p>
<table class="mdTable" cellpadding="2" cellspacing="0">
  <tr>
    <td class="mdRow">
      <table cellpadding="0" cellspacing="0" border="0">
        <tr>
          <td class="mdPrefix" colspan="4">
template&lt;typename T&gt; </td>
        </tr>
        <tr>
          <td class="md" nowrap valign="top">static unsigned int log4cpp::StringUtil::split           </td>
          <td class="md" valign="top">(&nbsp;</td>
          <td class="md" nowrap valign="top">T &amp;&nbsp;</td>
          <td class="mdname" nowrap> <em>output</em>, </td>
        </tr>
        <tr>
          <td class="md" nowrap align="right"></td>
          <td class="md"></td>
          <td class="md" nowrap>const std::string &amp;&nbsp;</td>
          <td class="mdname" nowrap> <em>s</em>, </td>
        </tr>
        <tr>
          <td class="md" nowrap align="right"></td>
          <td class="md"></td>
          <td class="md" nowrap>char&nbsp;</td>
          <td class="mdname" nowrap> <em>delimiter</em>, </td>
        </tr>
        <tr>
          <td class="md" nowrap align="right"></td>
          <td class="md"></td>
          <td class="md" nowrap>unsigned int&nbsp;</td>
          <td class="mdname" nowrap> <em>maxSegments</em> = <code>INT_MAX</code></td>
        </tr>
        <tr>
          <td class="md"></td>
          <td class="md">)&nbsp;</td>
          <td class="md" colspan="2"><code> [inline, static]</code></td>
        </tr>
      </table>
    </td>
  </tr>
</table>
<table cellspacing="5" cellpadding="0" border="0">
  <tr>
    <td>
      &nbsp;
    </td>
    <td>

<p>
splits a string into string segments based on the given delimiter and assigns the segments through an output_iterator. 
<p>
<dl compact><dt><b>Parameters:</b></dt><dd>
  <table border="0" cellspacing="2" cellpadding="0">
    <tr><td valign="top"></td><td valign="top"><em>output</em>&nbsp;</td><td>The output_iterator through which to assign the string segments. Typically this will be a back_insertion_iterator. </td></tr>
    <tr><td valign="top"></td><td valign="top"><em>s</em>&nbsp;</td><td>The string to split into segments. </td></tr>
    <tr><td valign="top"></td><td valign="top"><em>delimiter</em>&nbsp;</td><td>The delimiter character </td></tr>
    <tr><td valign="top"></td><td valign="top"><em>maxSegments</em>&nbsp;</td><td>The maximum number of segments. </td></tr>
  </table>
</dl>
<dl compact><dt><b>Returns:</b></dt><dd>The actual number of segments (limited by maxSegments). </dd></dl>
    </td>
  </tr>
</table>
<a class="anchor" name="e2" doxytag="log4cpp::StringUtil::split"></a><p>
<table class="mdTable" cellpadding="2" cellspacing="0">
  <tr>
    <td class="mdRow">
      <table cellpadding="0" cellspacing="0" border="0">
        <tr>
          <td class="md" nowrap valign="top">unsigned int log4cpp::StringUtil::split           </td>
          <td class="md" valign="top">(&nbsp;</td>
          <td class="md" nowrap valign="top">std::vector&lt; std::string &gt; &amp;&nbsp;</td>
          <td class="mdname" nowrap> <em>v</em>, </td>
        </tr>
        <tr>
          <td class="md" nowrap align="right"></td>
          <td class="md"></td>
          <td class="md" nowrap>const std::string &amp;&nbsp;</td>
          <td class="mdname" nowrap> <em>s</em>, </td>
        </tr>
        <tr>
          <td class="md" nowrap align="right"></td>
          <td class="md"></td>
          <td class="md" nowrap>char&nbsp;</td>
          <td class="mdname" nowrap> <em>delimiter</em>, </td>
        </tr>
        <tr>
          <td class="md" nowrap align="right"></td>
          <td class="md"></td>
          <td class="md" nowrap>unsigned int&nbsp;</td>
          <td class="mdname" nowrap> <em>maxSegments</em> = <code>INT_MAX</code></td>
        </tr>
        <tr>
          <td class="md"></td>
          <td class="md">)&nbsp;</td>
          <td class="md" colspan="2"><code> [static]</code></td>
        </tr>
      </table>
    </td>
  </tr>
</table>
<table cellspacing="5" cellpadding="0" border="0">
  <tr>
    <td>
      &nbsp;
    </td>
    <td>

<p>
splits a string into a vector of string segments based on the given delimiter. 
<p>
<dl compact><dt><b>Parameters:</b></dt><dd>
  <table border="0" cellspacing="2" cellpadding="0">
    <tr><td valign="top"></td><td valign="top"><em>v</em>&nbsp;</td><td>The vector in which the segments will be stored. The vector will be emptied before storing the segments </td></tr>
    <tr><td valign="top"></td><td valign="top"><em>s</em>&nbsp;</td><td>The string to split into segments. </td></tr>
    <tr><td valign="top"></td><td valign="top"><em>delimiter</em>&nbsp;</td><td>The delimiter character </td></tr>
    <tr><td valign="top"></td><td valign="top"><em>maxSegments</em>&nbsp;</td><td>the maximum number of segments. Upon return v.size() &lt;= maxSegments. The string is scanned from left to right so v[maxSegments - 1] may contain a string containing the delimiter character. </td></tr>
  </table>
</dl>
<dl compact><dt><b>Returns:</b></dt><dd>The actual number of segments (limited by maxSegments). </dd></dl>
    </td>
  </tr>
</table>
<a class="anchor" name="e1" doxytag="log4cpp::StringUtil::trim"></a><p>
<table class="mdTable" cellpadding="2" cellspacing="0">
  <tr>
    <td class="mdRow">
      <table cellpadding="0" cellspacing="0" border="0">
        <tr>
          <td class="md" nowrap valign="top">std::string log4cpp::StringUtil::trim           </td>
          <td class="md" valign="top">(&nbsp;</td>
          <td class="md" nowrap valign="top">const std::string &amp;&nbsp;</td>
          <td class="mdname1" valign="top" nowrap> <em>s</em>          </td>
          <td class="md" valign="top">&nbsp;)&nbsp;</td>
          <td class="md" nowrap><code> [static]</code></td>
        </tr>
      </table>
    </td>
  </tr>
</table>
<table cellspacing="5" cellpadding="0" border="0">
  <tr>
    <td>
      &nbsp;
    </td>
    <td>

<p>
Returns a string identical to the given string but without leading or trailing HTABs or spaces. 
<p>
    </td>
  </tr>
</table>
<a class="anchor" name="e0" doxytag="log4cpp::StringUtil::vform"></a><p>
<table class="mdTable" cellpadding="2" cellspacing="0">
  <tr>
    <td class="mdRow">
      <table cellpadding="0" cellspacing="0" border="0">
        <tr>
          <td class="md" nowrap valign="top">std::string log4cpp::StringUtil::vform           </td>
          <td class="md" valign="top">(&nbsp;</td>
          <td class="md" nowrap valign="top">const char *&nbsp;</td>
          <td class="mdname" nowrap> <em>format</em>, </td>
        </tr>
        <tr>
          <td class="md" nowrap align="right"></td>
          <td class="md"></td>
          <td class="md" nowrap>va_list&nbsp;</td>
          <td class="mdname" nowrap> <em>args</em></td>
        </tr>
        <tr>
          <td class="md"></td>
          <td class="md">)&nbsp;</td>
          <td class="md" colspan="2"><code> [static]</code></td>
        </tr>
      </table>
    </td>
  </tr>
</table>
<table cellspacing="5" cellpadding="0" border="0">
  <tr>
    <td>
      &nbsp;
    </td>
    <td>

<p>
Returns a string contructed from the a format specifier and a va_list of arguments, analogously to vprintf(3). 
<p>
<dl compact><dt><b>Parameters:</b></dt><dd>
  <table border="0" cellspacing="2" cellpadding="0">
    <tr><td valign="top"></td><td valign="top"><em>format</em>&nbsp;</td><td>the format specifier. </td></tr>
    <tr><td valign="top"></td><td valign="top"><em>args</em>&nbsp;</td><td>the va_list of arguments. </td></tr>
  </table>
</dl>
    </td>
  </tr>
</table>
<hr>The documentation for this class was generated from the following files:<ul>
<li><a class="el" href="StringUtil_8hh-source.html">StringUtil.hh</a><li><a class="el" href="StringUtil_8cpp.html">StringUtil.cpp</a></ul>
<hr size="1"><address style="align: right;"><small>Generated on Fri Jul 29 14:13:21 2005 for log4cpp by&nbsp;
<a href="http://www.doxygen.org/index.html">
<img src="doxygen.png" alt="doxygen" align="middle" border="0"></a> 1.4.2 </small></address>
</body>
</html>