File: classlog4cpp_1_1StringUtil.html

package info (click to toggle)
log4cpp-doc 1.0-4
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid, trixie
  • size: 8,528 kB
  • sloc: makefile: 10
file content (217 lines) | stat: -rw-r--r-- 11,374 bytes parent folder | download | duplicates (5)
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
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html><head><meta http-equiv="Content-Type" content="text/html;charset=UTF-8">
<title>log4cpp: log4cpp::StringUtil Class Reference</title>
<link href="doxygen.css" rel="stylesheet" type="text/css">
<link href="tabs.css" rel="stylesheet" type="text/css">
</head><body>
<!-- Generated by Doxygen 1.5.2 -->
<div class="tabs">
  <ul>
    <li><a href="index.html"><span>Main&nbsp;Page</span></a></li>
    <li><a href="namespaces.html"><span>Namespaces</span></a></li>
    <li class="current"><a href="annotated.html"><span>Classes</span></a></li>
    <li><a href="files.html"><span>Files</span></a></li>
    <li><a href="pages.html"><span>Related&nbsp;Pages</span></a></li>
  </ul>
</div>
<div class="tabs">
  <ul>
    <li><a href="annotated.html"><span>Class&nbsp;List</span></a></li>
    <li><a href="hierarchy.html"><span>Class&nbsp;Hierarchy</span></a></li>
    <li><a href="functions.html"><span>Class&nbsp;Members</span></a></li>
  </ul>
</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><!-- doxytag: class="log4cpp::StringUtil" --><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#2e0e62788cef69953a613e72d0d62516">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="#2e0e62788cef69953a613e72d0d62516"></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#135b34af8fadf914b7067fa2af7937ea">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="#135b34af8fadf914b7067fa2af7937ea"></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#24966cf8cacc3fb702b8466cfd5314b5">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="#24966cf8cacc3fb702b8466cfd5314b5"></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#b0cb488065a2630ea8d29f12ca5e1c77">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="#b0cb488065a2630ea8d29f12ca5e1c77"></a><br></td></tr>
</table>
<hr><h2>Member Function Documentation</h2>
<a class="anchor" name="2e0e62788cef69953a613e72d0d62516"></a><!-- doxytag: member="log4cpp::StringUtil::vform" ref="2e0e62788cef69953a613e72d0d62516" args="(const char *format, va_list args)" -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">std::string log4cpp::StringUtil::vform           </td>
          <td>(</td>
          <td class="paramtype">const char *&nbsp;</td>
          <td class="paramname"> <em>format</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">va_list&nbsp;</td>
          <td class="paramname"> <em>args</em></td><td>&nbsp;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td><td width="100%"><code> [static]</code></td>
        </tr>
      </table>
</div>
<div class="memdoc">

<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>

</div>
</div><p>
<a class="anchor" name="135b34af8fadf914b7067fa2af7937ea"></a><!-- doxytag: member="log4cpp::StringUtil::trim" ref="135b34af8fadf914b7067fa2af7937ea" args="(const std::string &amp;s)" -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">std::string log4cpp::StringUtil::trim           </td>
          <td>(</td>
          <td class="paramtype">const std::string &amp;&nbsp;</td>
          <td class="paramname"> <em>s</em>          </td>
          <td>&nbsp;)&nbsp;</td>
          <td width="100%"><code> [static]</code></td>
        </tr>
      </table>
</div>
<div class="memdoc">

<p>
Returns a string identical to the given string but without leading or trailing HTABs or spaces. 
<p>

</div>
</div><p>
<a class="anchor" name="24966cf8cacc3fb702b8466cfd5314b5"></a><!-- doxytag: member="log4cpp::StringUtil::split" ref="24966cf8cacc3fb702b8466cfd5314b5" args="(std::vector&lt; std::string &gt; &amp;v, const std::string &amp;s, char delimiter, unsigned int maxSegments=INT_MAX)" -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">unsigned int log4cpp::StringUtil::split           </td>
          <td>(</td>
          <td class="paramtype">std::vector&lt; std::string &gt; &amp;&nbsp;</td>
          <td class="paramname"> <em>v</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">const std::string &amp;&nbsp;</td>
          <td class="paramname"> <em>s</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">char&nbsp;</td>
          <td class="paramname"> <em>delimiter</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">unsigned int&nbsp;</td>
          <td class="paramname"> <em>maxSegments</em> = <code>INT_MAX</code></td><td>&nbsp;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td><td width="100%"><code> [static]</code></td>
        </tr>
      </table>
</div>
<div class="memdoc">

<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 class="return" compact><dt><b>Returns:</b></dt><dd>The actual number of segments (limited by maxSegments). </dd></dl>

</div>
</div><p>
<a class="anchor" name="b0cb488065a2630ea8d29f12ca5e1c77"></a><!-- doxytag: member="log4cpp::StringUtil::split" ref="b0cb488065a2630ea8d29f12ca5e1c77" args="(T &amp;output, const std::string &amp;s, char delimiter, unsigned int maxSegments=INT_MAX)" -->
<div class="memitem">
<div class="memproto">
<div class="memtemplate">
template&lt;typename T&gt; </div>
      <table class="memname">
        <tr>
          <td class="memname">static unsigned int log4cpp::StringUtil::split           </td>
          <td>(</td>
          <td class="paramtype">T &amp;&nbsp;</td>
          <td class="paramname"> <em>output</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">const std::string &amp;&nbsp;</td>
          <td class="paramname"> <em>s</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">char&nbsp;</td>
          <td class="paramname"> <em>delimiter</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">unsigned int&nbsp;</td>
          <td class="paramname"> <em>maxSegments</em> = <code>INT_MAX</code></td><td>&nbsp;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td><td width="100%"><code> [inline, static]</code></td>
        </tr>
      </table>
</div>
<div class="memdoc">

<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 class="return" compact><dt><b>Returns:</b></dt><dd>The actual number of segments (limited by maxSegments). </dd></dl>

</div>
</div><p>
<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="text-align: right;"><small>Generated on Mon Sep 3 11:55:08 2007 for log4cpp by&nbsp;
<a href="http://www.doxygen.org/index.html">
<img src="doxygen.png" alt="doxygen" align="middle" border="0"></a> 1.5.2 </small></address>
</body>
</html>