blob: ffe8e52d3516e64f34a9c9840c6f941ffe6df83f [file] [log] [blame]
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=US-ASCII">
<title>String Generators</title>
<link rel="stylesheet" href="../../../../../../../../doc/src/boostbook.css" type="text/css">
<meta name="generator" content="DocBook XSL Stylesheets V1.75.0">
<link rel="home" href="../../../../index.html" title="Spirit 2.4.1">
<link rel="up" href="../primitive_generators.html" title="Karma Generators">
<link rel="prev" href="char.html" title="Character Generators">
<link rel="next" href="real_number.html" title="Real Number Generators">
</head>
<body bgcolor="white" text="black" link="#0000FF" vlink="#840084" alink="#0000FF">
<table cellpadding="2" width="100%"><tr>
<td valign="top"><img alt="Boost C++ Libraries" width="277" height="86" src="../../../../../../../../boost.png"></td>
<td align="center"><a href="../../../../../../../../index.html">Home</a></td>
<td align="center"><a href="../../../../../../../../libs/libraries.htm">Libraries</a></td>
<td align="center"><a href="http://www.boost.org/users/people.html">People</a></td>
<td align="center"><a href="http://www.boost.org/users/faq.html">FAQ</a></td>
<td align="center"><a href="../../../../../../../../more/index.htm">More</a></td>
</tr></table>
<hr>
<div class="spirit-nav">
<a accesskey="p" href="char.html"><img src="../../../../../../../../doc/src/images/prev.png" alt="Prev"></a><a accesskey="u" href="../primitive_generators.html"><img src="../../../../../../../../doc/src/images/up.png" alt="Up"></a><a accesskey="h" href="../../../../index.html"><img src="../../../../../../../../doc/src/images/home.png" alt="Home"></a><a accesskey="n" href="real_number.html"><img src="../../../../../../../../doc/src/images/next.png" alt="Next"></a>
</div>
<div class="section">
<div class="titlepage"><div><div><h5 class="title">
<a name="spirit.karma.quick_reference.primitive_generators.string"></a><a class="link" href="string.html" title="String Generators">String
Generators</a>
</h5></div></div></div>
<p>
See here for more information about <a class="link" href="../../reference/string.html" title="String">String
Generators</a>.
</p>
<div class="informaltable"><table class="table">
<colgroup>
<col>
<col>
<col>
</colgroup>
<thead><tr>
<th>
<p>
Expression
</p>
</th>
<th>
<p>
Attribute
</p>
</th>
<th>
<p>
Description
</p>
</th>
</tr></thead>
<tbody>
<tr>
<td>
<p>
<a class="link" href="../../reference/string.html" title="String"><code class="computeroutput"><span class="identifier">str</span></code></a>
</p>
</td>
<td>
<p>
<code class="computeroutput"><span class="identifier">Unused</span></code>
</p>
</td>
<td>
<p>
Generate <code class="computeroutput"><span class="identifier">str</span></code>
</p>
</td>
</tr>
<tr>
<td>
<p>
<a class="link" href="../../reference/string.html" title="String"><code class="computeroutput"><span class="identifier">lit</span><span class="special">(</span><span class="identifier">str</span><span class="special">)</span></code></a>
</p>
</td>
<td>
<p>
<code class="computeroutput"><span class="identifier">Unused</span></code>
</p>
</td>
<td>
<p>
Generate <code class="computeroutput"><span class="identifier">str</span></code>
</p>
</td>
</tr>
<tr>
<td>
<p>
<a class="link" href="../../reference/string.html" title="String"><code class="computeroutput"><span class="identifier">string</span></code></a>
</p>
</td>
<td>
<p>
<code class="computeroutput"><span class="identifier">Str</span></code>
</p>
</td>
<td>
<p>
Generate string supplied as the attribute
</p>
</td>
</tr>
<tr>
<td>
<p>
<a class="link" href="../../reference/string.html" title="String"><code class="computeroutput"><span class="identifier">string</span><span class="special">(</span><span class="identifier">str</span><span class="special">)</span></code></a>
</p>
</td>
<td>
<p>
<code class="computeroutput"><span class="identifier">Str</span></code>
</p>
</td>
<td>
<p>
Generate <code class="computeroutput"><span class="identifier">str</span></code>,
if an attribute is supplied it must match
</p>
</td>
</tr>
<tr>
<td>
<p>
<a class="link" href="../../reference/string/symbols.html" title="Symbols (symbols)"><code class="computeroutput"><span class="identifier">symbols</span></code></a><code class="computeroutput"><span class="special">&lt;</span><span class="identifier">Attr</span><span class="special">,</span> <span class="identifier">T</span><span class="special">&gt;</span></code>
</p>
</td>
<td>
<p>
<code class="computeroutput"><span class="identifier">Attr</span></code>
</p>
</td>
<td>
<p>
Declare a symbol table, <code class="computeroutput"><span class="identifier">sym</span></code>.
<code class="computeroutput"><span class="identifier">Attr</span></code> is the
The type of the original attribute to be used as the key into
the symbol generator. <code class="computeroutput"><span class="identifier">T</span></code>
is the data type associated with each key.
</p>
</td>
</tr>
<tr>
<td>
<p>
</p>
<pre xmlns:rev="http://www.cs.rpi.edu/~gregod/boost/tools/doc/revision" class="table-programlisting"><span class="identifier">sym</span><span class="special">.</span><span class="identifier">add</span>
<span class="special">(</span><span class="identifier">attr1</span><span class="special">,</span> <span class="identifier">val1</span><span class="special">)</span>
<span class="special">(</span><span class="identifier">attr2</span><span class="special">,</span> <span class="identifier">val2</span><span class="special">)</span>
<span class="comment">/*...more...*/</span>
<span class="special">;</span>
</pre>
<p>
</p>
</td>
<td>
<p>
N/A
</p>
</td>
<td>
<p>
Add symbols into a symbol table, <code class="computeroutput"><span class="identifier">sym</span></code>.
val1 and val2 are optional data of type <code class="computeroutput"><span class="identifier">T</span></code>,
the data type associated with each key.
</p>
</td>
</tr>
<tr>
<td>
<p>
<code class="computeroutput"><span class="identifier">sym</span></code>
</p>
</td>
<td>
<p>
<code class="computeroutput"><span class="identifier">T</span></code>
</p>
</td>
<td>
<p>
Emits entries in the symbol table, <code class="computeroutput"><span class="identifier">sym</span></code>.
If attribute is found in the symbol table, the corresponding
value is emitted. If <code class="computeroutput"><span class="identifier">sym</span></code>
does not store values, the original attribute is emitted.
</p>
</td>
</tr>
</tbody>
</table></div>
</div>
<table xmlns:rev="http://www.cs.rpi.edu/~gregod/boost/tools/doc/revision" width="100%"><tr>
<td align="left"></td>
<td align="right"><div class="copyright-footer">Copyright &#169; 2001-2010 Joel de Guzman, Hartmut Kaiser<p>
Distributed under the Boost Software License, Version 1.0. (See accompanying
file LICENSE_1_0.txt or copy at <a href="http://www.boost.org/LICENSE_1_0.txt" target="_top">http://www.boost.org/LICENSE_1_0.txt</a>)
</p>
</div></td>
</tr></table>
<hr>
<div class="spirit-nav">
<a accesskey="p" href="char.html"><img src="../../../../../../../../doc/src/images/prev.png" alt="Prev"></a><a accesskey="u" href="../primitive_generators.html"><img src="../../../../../../../../doc/src/images/up.png" alt="Up"></a><a accesskey="h" href="../../../../index.html"><img src="../../../../../../../../doc/src/images/home.png" alt="Home"></a><a accesskey="n" href="real_number.html"><img src="../../../../../../../../doc/src/images/next.png" alt="Next"></a>
</div>
</body>
</html>