Sophie

Sophie

distrib > Mageia > 4 > x86_64 > by-pkgid > b293cf61b174f6cb974e48c9096dc9b3 > files > 332

lib64commoncpp-devel-1.8.1-7.mga4.x86_64.rpm

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
<meta http-equiv="X-UA-Compatible" content="IE=9"/>
<meta name="generator" content="Doxygen 1.8.5"/>
<title>GNU CommonC++: ost::StringTokenizer Class Reference</title>
<link href="tabs.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="jquery.js"></script>
<script type="text/javascript" src="dynsections.js"></script>
<link href="doxygen.css" rel="stylesheet" type="text/css" />
</head>
<body>
<div id="top"><!-- do not remove this div, it is closed by doxygen! -->
<div id="titlearea">
<table cellspacing="0" cellpadding="0">
 <tbody>
 <tr style="height: 56px;">
  <td style="padding-left: 0.5em;">
   <div id="projectname">GNU CommonC++
   </div>
  </td>
 </tr>
 </tbody>
</table>
</div>
<!-- end header part -->
<!-- Generated by Doxygen 1.8.5 -->
  <div id="navrow1" class="tabs">
    <ul class="tablist">
      <li><a href="index.html"><span>Main&#160;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="examples.html"><span>Examples</span></a></li>
    </ul>
  </div>
  <div id="navrow2" class="tabs2">
    <ul class="tablist">
      <li><a href="annotated.html"><span>Class&#160;List</span></a></li>
      <li><a href="classes.html"><span>Class&#160;Index</span></a></li>
      <li><a href="hierarchy.html"><span>Class&#160;Hierarchy</span></a></li>
      <li><a href="functions.html"><span>Class&#160;Members</span></a></li>
    </ul>
  </div>
<div id="nav-path" class="navpath">
  <ul>
<li class="navelem"><a class="el" href="namespaceost.html">ost</a></li><li class="navelem"><a class="el" href="classost_1_1_string_tokenizer.html">StringTokenizer</a></li>  </ul>
</div>
</div><!-- top -->
<div class="header">
  <div class="summary">
<a href="#nested-classes">Classes</a> &#124;
<a href="#pub-methods">Public Member Functions</a> &#124;
<a href="#pub-static-attribs">Static Public Attributes</a> &#124;
<a href="#friends">Friends</a> &#124;
<a href="classost_1_1_string_tokenizer-members.html">List of all members</a>  </div>
  <div class="headertitle">
<div class="title">ost::StringTokenizer Class Reference</div>  </div>
</div><!--header-->
<div class="contents">

<p>Splits delimited string into tokens.  
 <a href="classost_1_1_string_tokenizer.html#details">More...</a></p>

<p><code>#include &lt;<a class="el" href="tokenizer_8h_source.html">tokenizer.h</a>&gt;</code></p>
<table class="memberdecls">
<tr class="heading"><td colspan="2"><h2 class="groupheader"><a name="nested-classes"></a>
Classes</h2></td></tr>
<tr class="memitem:"><td class="memItemLeft" align="right" valign="top">class &#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classost_1_1_string_tokenizer_1_1iterator.html">iterator</a></td></tr>
<tr class="memdesc:"><td class="mdescLeft">&#160;</td><td class="mdescRight">The input forward iterator for tokens.  <a href="classost_1_1_string_tokenizer_1_1iterator.html#details">More...</a><br/></td></tr>
<tr class="separator:"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:"><td class="memItemLeft" align="right" valign="top">class &#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classost_1_1_string_tokenizer_1_1_no_such_element_exception.html">NoSuchElementException</a></td></tr>
<tr class="memdesc:"><td class="mdescLeft">&#160;</td><td class="mdescRight">Exception thrown, if someone tried to read beyond the end of the tokens.  <a href="classost_1_1_string_tokenizer_1_1_no_such_element_exception.html#details">More...</a><br/></td></tr>
<tr class="separator:"><td class="memSeparator" colspan="2">&#160;</td></tr>
</table><table class="memberdecls">
<tr class="heading"><td colspan="2"><h2 class="groupheader"><a name="pub-methods"></a>
Public Member Functions</h2></td></tr>
<tr class="memitem:a67c853d283920854b98c41fbe4e84d52"><td class="memItemLeft" align="right" valign="top">&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classost_1_1_string_tokenizer.html#a67c853d283920854b98c41fbe4e84d52">StringTokenizer</a> (const char *str, const char *delim, bool skipAllDelim=false, bool trim=false)</td></tr>
<tr class="memdesc:a67c853d283920854b98c41fbe4e84d52"><td class="mdescLeft">&#160;</td><td class="mdescRight">creates a new <a class="el" href="classost_1_1_string_tokenizer.html" title="Splits delimited string into tokens. ">StringTokenizer</a> for a string and a given set of delimiters.  <a href="#a67c853d283920854b98c41fbe4e84d52">More...</a><br/></td></tr>
<tr class="separator:a67c853d283920854b98c41fbe4e84d52"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:ad92ba14c987eee96b10f9fa177b5a4e0"><td class="memItemLeft" align="right" valign="top">&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classost_1_1_string_tokenizer.html#ad92ba14c987eee96b10f9fa177b5a4e0">StringTokenizer</a> (const char *s)</td></tr>
<tr class="memdesc:ad92ba14c987eee96b10f9fa177b5a4e0"><td class="mdescLeft">&#160;</td><td class="mdescRight">create a new <a class="el" href="classost_1_1_string_tokenizer.html" title="Splits delimited string into tokens. ">StringTokenizer</a> which splits the input string at whitespaces.  <a href="#ad92ba14c987eee96b10f9fa177b5a4e0">More...</a><br/></td></tr>
<tr class="separator:ad92ba14c987eee96b10f9fa177b5a4e0"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:aec7ea216033f881b2bac13777525e415"><td class="memItemLeft" align="right" valign="top"><a class="el" href="classost_1_1_string_tokenizer_1_1iterator.html">iterator</a>&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classost_1_1_string_tokenizer.html#aec7ea216033f881b2bac13777525e415">begin</a> () const </td></tr>
<tr class="memdesc:aec7ea216033f881b2bac13777525e415"><td class="mdescLeft">&#160;</td><td class="mdescRight">returns the begin iterator  <a href="#aec7ea216033f881b2bac13777525e415">More...</a><br/></td></tr>
<tr class="separator:aec7ea216033f881b2bac13777525e415"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a192f7b20b494671b6f69225b4df3e299"><td class="memItemLeft" align="right" valign="top">void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classost_1_1_string_tokenizer.html#a192f7b20b494671b6f69225b4df3e299">setDelimiters</a> (const char *d)</td></tr>
<tr class="memdesc:a192f7b20b494671b6f69225b4df3e299"><td class="mdescLeft">&#160;</td><td class="mdescRight">changes the set of delimiters used in subsequent iterations.  <a href="#a192f7b20b494671b6f69225b4df3e299">More...</a><br/></td></tr>
<tr class="separator:a192f7b20b494671b6f69225b4df3e299"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:af3dfeb0e48c9d2fc9629076da65acd86"><td class="memItemLeft" align="right" valign="top"><a class="el" href="classost_1_1_string_tokenizer_1_1iterator.html">iterator</a>&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classost_1_1_string_tokenizer.html#af3dfeb0e48c9d2fc9629076da65acd86">begin</a> (const char *d)</td></tr>
<tr class="memdesc:af3dfeb0e48c9d2fc9629076da65acd86"><td class="mdescLeft">&#160;</td><td class="mdescRight">returns a begin iterator with an alternate set of delimiters.  <a href="#af3dfeb0e48c9d2fc9629076da65acd86">More...</a><br/></td></tr>
<tr class="separator:af3dfeb0e48c9d2fc9629076da65acd86"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a74b3471e3e481c0144758385c29cbfbf"><td class="memItemLeft" align="right" valign="top">const <a class="el" href="classost_1_1_string_tokenizer_1_1iterator.html">iterator</a> &amp;&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classost_1_1_string_tokenizer.html#a74b3471e3e481c0144758385c29cbfbf">end</a> () const </td></tr>
<tr class="memdesc:a74b3471e3e481c0144758385c29cbfbf"><td class="mdescLeft">&#160;</td><td class="mdescRight">the iterator marking the end.  <a href="#a74b3471e3e481c0144758385c29cbfbf">More...</a><br/></td></tr>
<tr class="separator:a74b3471e3e481c0144758385c29cbfbf"><td class="memSeparator" colspan="2">&#160;</td></tr>
</table><table class="memberdecls">
<tr class="heading"><td colspan="2"><h2 class="groupheader"><a name="pub-static-attribs"></a>
Static Public Attributes</h2></td></tr>
<tr class="memitem:a4018e923303101ebd6d01cdbca10ce38"><td class="memItemLeft" align="right" valign="top">static const char *const&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classost_1_1_string_tokenizer.html#a4018e923303101ebd6d01cdbca10ce38">SPACE</a></td></tr>
<tr class="memdesc:a4018e923303101ebd6d01cdbca10ce38"><td class="mdescLeft">&#160;</td><td class="mdescRight">a delimiter string containing all usual whitespace delimiters.  <a href="#a4018e923303101ebd6d01cdbca10ce38">More...</a><br/></td></tr>
<tr class="separator:a4018e923303101ebd6d01cdbca10ce38"><td class="memSeparator" colspan="2">&#160;</td></tr>
</table><table class="memberdecls">
<tr class="heading"><td colspan="2"><h2 class="groupheader"><a name="friends"></a>
Friends</h2></td></tr>
<tr class="memitem:a46c74d7c3ebac303a827a759155b5879"><td class="memItemLeft" align="right" valign="top">class&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classost_1_1_string_tokenizer.html#a46c74d7c3ebac303a827a759155b5879">StringTokenizer::iterator</a></td></tr>
<tr class="separator:a46c74d7c3ebac303a827a759155b5879"><td class="memSeparator" colspan="2">&#160;</td></tr>
</table>
<a name="details" id="details"></a><h2 class="groupheader">Detailed Description</h2>
<div class="textblock"><p>Splits delimited string into tokens. </p>
<p>The <a class="el" href="classost_1_1_string_tokenizer.html" title="Splits delimited string into tokens. ">StringTokenizer</a> takes a pointer to a string and a pointer to a string containing a number of possible delimiters. The <a class="el" href="classost_1_1_string_tokenizer.html" title="Splits delimited string into tokens. ">StringTokenizer</a> provides an input forward iterator which allows to iterate through all tokens. An iterator behaves like a logical pointer to the tokens, i.e. to shift to the next token, you've to increment the iterator, you get the token by dereferencing the iterator.</p>
<p>Memory consumption: This class operates on the original string and only allocates memory for the individual tokens actually requested, so this class allocates at maximum the space required for the longest token in the given string. Since for each iteration, memory is reclaimed for the last token, you MAY NOT store pointers to them; if you need them afterwards, copy them. You may not modify the original string while you operate on it with the <a class="el" href="classost_1_1_string_tokenizer.html" title="Splits delimited string into tokens. ">StringTokenizer</a>; the behaviour is undefined in that case.</p>
<p>The iterator has one special method 'nextDelimiter()' which returns a character containing the next delimiter following this tokenization process or '\0', if there are no following delimiters. In case of skipAllDelim, it returns the FIRST delimiter.</p>
<p>With the method '<a class="el" href="classost_1_1_string_tokenizer.html#a192f7b20b494671b6f69225b4df3e299" title="changes the set of delimiters used in subsequent iterations. ">setDelimiters(const char*)</a>' you may change the set of delimiters. It affects all running iterators.</p>
<p>Example: <code></p>
<pre>
 <a class="el" href="classost_1_1_string_tokenizer.html" title="Splits delimited string into tokens. ">StringTokenizer</a> st("mary had a little lamb;its fleece was..", " ;");
 <a class="el" href="classost_1_1_string_tokenizer_1_1iterator.html" title="The input forward iterator for tokens. ">StringTokenizer::iterator</a> i;
 for (i = st.begin() ; i != st.end() ; ++i) {
       cout &lt;&lt; "Token: '" &lt;&lt; *i &lt;&lt; "'\t";
       cout &lt;&lt; " next Delim: '" &lt;&lt; i.nextDelimiter() &lt;&lt; "'" &lt;&lt; endl;
 }
 </pre><p></code></p>
<dl class="section author"><dt>Author</dt><dd>Henner Zeller <a href="#" onclick="location.href='mai'+'lto:'+'H.Z'+'el'+'ler'+'@a'+'cm.'+'or'+'g'; return false;">H.Zel<span style="display: none;">.nosp@m.</span>ler@<span style="display: none;">.nosp@m.</span>acm.o<span style="display: none;">.nosp@m.</span>rg</a> </dd></dl>
<dl class="section user"><dt>License:</dt><dd>LGPL </dd></dl>
</div><h2 class="groupheader">Constructor &amp; Destructor Documentation</h2>
<a class="anchor" id="a67c853d283920854b98c41fbe4e84d52"></a>
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">ost::StringTokenizer::StringTokenizer </td>
          <td>(</td>
          <td class="paramtype">const char *&#160;</td>
          <td class="paramname"><em>str</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">const char *&#160;</td>
          <td class="paramname"><em>delim</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">bool&#160;</td>
          <td class="paramname"><em>skipAllDelim</em> = <code>false</code>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">bool&#160;</td>
          <td class="paramname"><em>trim</em> = <code>false</code>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
</div><div class="memdoc">

<p>creates a new <a class="el" href="classost_1_1_string_tokenizer.html" title="Splits delimited string into tokens. ">StringTokenizer</a> for a string and a given set of delimiters. </p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">str</td><td><a class="el" href="classost_1_1_string.html" title="This is a generic and portable string class. ">String</a> to be split up. This string will not be modified by this <a class="el" href="classost_1_1_string_tokenizer.html" title="Splits delimited string into tokens. ">StringTokenizer</a>, but you may as well not modfiy this string while tokenizing is in process, which may lead to undefined behaviour.</td></tr>
    <tr><td class="paramname">delim</td><td><a class="el" href="classost_1_1_string.html" title="This is a generic and portable string class. ">String</a> containing the characters which should be regarded as delimiters.</td></tr>
    <tr><td class="paramname">skipAllDelim</td><td>OPTIONAL. true, if subsequent delimiters should be skipped at once or false, if empty tokens should be returned for two delimiters with no other text inbetween. The first behaviour may be desirable for whitespace skipping, the second for input with delimited entry e.g. /etc/passwd like files or CSV input. NOTE, that 'true' here resembles the ANSI-C strtok(char *s,char *d) behaviour. DEFAULT = false</td></tr>
    <tr><td class="paramname">trim</td><td>OPTIONAL. true, if the tokens returned should be trimmed, so that they don't have any whitespaces at the beginning or end. Whitespaces are any of the characters defined in <a class="el" href="classost_1_1_string_tokenizer.html#a4018e923303101ebd6d01cdbca10ce38" title="a delimiter string containing all usual whitespace delimiters. ">StringTokenizer::SPACE</a>. If delim itself is <a class="el" href="classost_1_1_string_tokenizer.html#a4018e923303101ebd6d01cdbca10ce38" title="a delimiter string containing all usual whitespace delimiters. ">StringTokenizer::SPACE</a>, this will result in a behaviour with skipAllDelim = true. DEFAULT = false </td></tr>
  </table>
  </dd>
</dl>

</div>
</div>
<a class="anchor" id="ad92ba14c987eee96b10f9fa177b5a4e0"></a>
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">ost::StringTokenizer::StringTokenizer </td>
          <td>(</td>
          <td class="paramtype">const char *&#160;</td>
          <td class="paramname"><em>s</em></td><td>)</td>
          <td></td>
        </tr>
      </table>
</div><div class="memdoc">

<p>create a new <a class="el" href="classost_1_1_string_tokenizer.html" title="Splits delimited string into tokens. ">StringTokenizer</a> which splits the input string at whitespaces. </p>
<p>The tokens are stripped from whitespaces. This means, if you change the set of delimiters in either the '<a class="el" href="classost_1_1_string_tokenizer.html#af3dfeb0e48c9d2fc9629076da65acd86" title="returns a begin iterator with an alternate set of delimiters. ">begin(const char *delim)</a>' method or in '<a class="el" href="classost_1_1_string_tokenizer.html#a192f7b20b494671b6f69225b4df3e299" title="changes the set of delimiters used in subsequent iterations. ">setDelimiters()</a>', you then get whitespace trimmed tokens, delimited by the new set. Behaves like StringTokenizer(s, StringTokenizer::SPACE,false,true); </p>

</div>
</div>
<h2 class="groupheader">Member Function Documentation</h2>
<a class="anchor" id="aec7ea216033f881b2bac13777525e415"></a>
<div class="memitem">
<div class="memproto">
<table class="mlabels">
  <tr>
  <td class="mlabels-left">
      <table class="memname">
        <tr>
          <td class="memname"><a class="el" href="classost_1_1_string_tokenizer_1_1iterator.html">iterator</a> ost::StringTokenizer::begin </td>
          <td>(</td>
          <td class="paramname"></td><td>)</td>
          <td> const</td>
        </tr>
      </table>
  </td>
  <td class="mlabels-right">
<span class="mlabels"><span class="mlabel">inline</span></span>  </td>
  </tr>
</table>
</div><div class="memdoc">

<p>returns the begin iterator </p>

</div>
</div>
<a class="anchor" id="af3dfeb0e48c9d2fc9629076da65acd86"></a>
<div class="memitem">
<div class="memproto">
<table class="mlabels">
  <tr>
  <td class="mlabels-left">
      <table class="memname">
        <tr>
          <td class="memname"><a class="el" href="classost_1_1_string_tokenizer_1_1iterator.html">iterator</a> ost::StringTokenizer::begin </td>
          <td>(</td>
          <td class="paramtype">const char *&#160;</td>
          <td class="paramname"><em>d</em></td><td>)</td>
          <td></td>
        </tr>
      </table>
  </td>
  <td class="mlabels-right">
<span class="mlabels"><span class="mlabel">inline</span></span>  </td>
  </tr>
</table>
</div><div class="memdoc">

<p>returns a begin iterator with an alternate set of delimiters. </p>

</div>
</div>
<a class="anchor" id="a74b3471e3e481c0144758385c29cbfbf"></a>
<div class="memitem">
<div class="memproto">
<table class="mlabels">
  <tr>
  <td class="mlabels-left">
      <table class="memname">
        <tr>
          <td class="memname">const <a class="el" href="classost_1_1_string_tokenizer_1_1iterator.html">iterator</a>&amp; ost::StringTokenizer::end </td>
          <td>(</td>
          <td class="paramtype">void&#160;</td>
          <td class="paramname"></td><td>)</td>
          <td> const</td>
        </tr>
      </table>
  </td>
  <td class="mlabels-right">
<span class="mlabels"><span class="mlabel">inline</span></span>  </td>
  </tr>
</table>
</div><div class="memdoc">

<p>the iterator marking the end. </p>

</div>
</div>
<a class="anchor" id="a192f7b20b494671b6f69225b4df3e299"></a>
<div class="memitem">
<div class="memproto">
<table class="mlabels">
  <tr>
  <td class="mlabels-left">
      <table class="memname">
        <tr>
          <td class="memname">void ost::StringTokenizer::setDelimiters </td>
          <td>(</td>
          <td class="paramtype">const char *&#160;</td>
          <td class="paramname"><em>d</em></td><td>)</td>
          <td></td>
        </tr>
      </table>
  </td>
  <td class="mlabels-right">
<span class="mlabels"><span class="mlabel">inline</span></span>  </td>
  </tr>
</table>
</div><div class="memdoc">

<p>changes the set of delimiters used in subsequent iterations. </p>

</div>
</div>
<h2 class="groupheader">Friends And Related Function Documentation</h2>
<a class="anchor" id="a46c74d7c3ebac303a827a759155b5879"></a>
<div class="memitem">
<div class="memproto">
<table class="mlabels">
  <tr>
  <td class="mlabels-left">
      <table class="memname">
        <tr>
          <td class="memname">friend class <a class="el" href="classost_1_1_string_tokenizer_1_1iterator.html">StringTokenizer::iterator</a></td>
        </tr>
      </table>
  </td>
  <td class="mlabels-right">
<span class="mlabels"><span class="mlabel">friend</span></span>  </td>
  </tr>
</table>
</div><div class="memdoc">

</div>
</div>
<h2 class="groupheader">Member Data Documentation</h2>
<a class="anchor" id="a4018e923303101ebd6d01cdbca10ce38"></a>
<div class="memitem">
<div class="memproto">
<table class="mlabels">
  <tr>
  <td class="mlabels-left">
      <table class="memname">
        <tr>
          <td class="memname">const char* const ost::StringTokenizer::SPACE</td>
        </tr>
      </table>
  </td>
  <td class="mlabels-right">
<span class="mlabels"><span class="mlabel">static</span></span>  </td>
  </tr>
</table>
</div><div class="memdoc">

<p>a delimiter string containing all usual whitespace delimiters. </p>
<p>These are space, tab, newline, carriage return, formfeed and vertical tab. (see isspace() manpage). </p>

</div>
</div>
<hr/>The documentation for this class was generated from the following file:<ul>
<li><a class="el" href="tokenizer_8h_source.html">tokenizer.h</a></li>
</ul>
</div><!-- contents -->
<!-- start footer part -->
<hr class="footer"/><address class="footer"><small>
Generated on Thu Oct 17 2013 23:24:58 for GNU CommonC++ by &#160;<a href="http://www.doxygen.org/index.html">
<img class="footer" src="doxygen.png" alt="doxygen"/>
</a> 1.8.5
</small></address>
</body>
</html>