| [12] | 1 | <html> |
|---|
| 2 | <head> |
|---|
| 3 | <meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1"> |
|---|
| 4 | <title>Class value_semantic</title> |
|---|
| 5 | <link rel="stylesheet" href="boostbook.css" type="text/css"> |
|---|
| 6 | <meta name="generator" content="DocBook XSL Stylesheets V1.69.1"> |
|---|
| 7 | <link rel="start" href="index.html" title="The Boost C++ Libraries"> |
|---|
| 8 | <link rel="up" href="program_options/reference.html#id2379391" title="Header <boost/program_options/value_semantic.hpp>"> |
|---|
| 9 | <link rel="prev" href="id2525902.html" title="Class positional_options_description"> |
|---|
| 10 | <link rel="next" href="id2284769.html" title="Class template value_semantic_codecvt_helper"> |
|---|
| 11 | </head> |
|---|
| 12 | <body bgcolor="white" text="black" link="#0000FF" vlink="#840084" alink="#0000FF"> |
|---|
| 13 | <table cellpadding="2" width="100%"> |
|---|
| 14 | <td valign="top"><img alt="boost.png (6897 bytes)" width="277" height="86" src="../../boost.png"></td> |
|---|
| 15 | <td align="center"><a href="../../index.htm">Home</a></td> |
|---|
| 16 | <td align="center"><a href="../../libs/libraries.htm">Libraries</a></td> |
|---|
| 17 | <td align="center"><a href="../../people/people.htm">People</a></td> |
|---|
| 18 | <td align="center"><a href="../../more/faq.htm">FAQ</a></td> |
|---|
| 19 | <td align="center"><a href="../../more/index.htm">More</a></td> |
|---|
| 20 | </table> |
|---|
| 21 | <hr> |
|---|
| 22 | <div class="spirit-nav"> |
|---|
| 23 | <a accesskey="p" href="id2525902.html"><img src="images/prev.png" alt="Prev"></a><a accesskey="u" href="program_options/reference.html#id2379391"><img src="images/up.png" alt="Up"></a><a accesskey="h" href="index.html"><img src="images/home.png" alt="Home"></a><a accesskey="n" href="id2284769.html"><img src="images/next.png" alt="Next"></a> |
|---|
| 24 | </div> |
|---|
| 25 | <div class="refentry" lang="en"> |
|---|
| 26 | <a name="value_semantic"></a><div class="titlepage"></div> |
|---|
| 27 | <div class="refnamediv"> |
|---|
| 28 | <h2><span class="refentrytitle">Class value_semantic</span></h2> |
|---|
| 29 | <p>boost::program_options::value_semantic — </p> |
|---|
| 30 | </div> |
|---|
| 31 | <h2 xmlns:rev="http://www.cs.rpi.edu/~gregod/boost/tools/doc/revision" class="refsynopsisdiv-title">Synopsis</h2> |
|---|
| 32 | <div xmlns:rev="http://www.cs.rpi.edu/~gregod/boost/tools/doc/revision" class="refsynopsisdiv"><pre class="synopsis"> |
|---|
| 33 | <span class="bold"><strong>class</strong></span> value_semantic { |
|---|
| 34 | <span class="bold"><strong>public</strong></span>: |
|---|
| 35 | <span class="emphasis"><em>// <a href="value_semantic.html#value_semanticconstruct-copy-destruct">construct/copy/destruct</a></em></span> |
|---|
| 36 | <a href="value_semantic.html#id2284765-bb">~value_semantic</a>(); |
|---|
| 37 | |
|---|
| 38 | <span class="emphasis"><em>// <a href="value_semantic.html#id2379418-bb">public member functions</a></em></span> |
|---|
| 39 | <span class="type"><span class="bold"><strong>virtual</strong></span> std::string</span> <a href="value_semantic.html#id2379423-bb">name</a>() <span class="bold"><strong>const</strong></span>; |
|---|
| 40 | <span class="type"><span class="bold"><strong>virtual</strong></span> <span class="bold"><strong>unsigned</strong></span></span> <a href="value_semantic.html#id2413390-bb">min_tokens</a>() <span class="bold"><strong>const</strong></span>; |
|---|
| 41 | <span class="type"><span class="bold"><strong>virtual</strong></span> <span class="bold"><strong>unsigned</strong></span></span> <a href="value_semantic.html#id2376494-bb">max_tokens</a>() <span class="bold"><strong>const</strong></span>; |
|---|
| 42 | <span class="type"><span class="bold"><strong>virtual</strong></span> <span class="bold"><strong>bool</strong></span></span> <a href="value_semantic.html#id2376514-bb">is_composing</a>() <span class="bold"><strong>const</strong></span>; |
|---|
| 43 | <span class="type"><span class="bold"><strong>virtual</strong></span> <span class="bold"><strong>void</strong></span></span> |
|---|
| 44 | <a href="value_semantic.html#id2378563-bb">parse</a>(boost::any &, <span class="bold"><strong>const</strong></span> std::vector< std::string > &, <span class="bold"><strong>bool</strong></span>) <span class="bold"><strong>const</strong></span>; |
|---|
| 45 | <span class="type"><span class="bold"><strong>virtual</strong></span> <span class="bold"><strong>bool</strong></span></span> <a href="value_semantic.html#id2421502-bb">apply_default</a>(boost::any &) <span class="bold"><strong>const</strong></span>; |
|---|
| 46 | <span class="type"><span class="bold"><strong>virtual</strong></span> <span class="bold"><strong>void</strong></span></span> <a href="value_semantic.html#id2438655-bb">notify</a>(<span class="bold"><strong>const</strong></span> boost::any &) <span class="bold"><strong>const</strong></span>; |
|---|
| 47 | };</pre></div> |
|---|
| 48 | <div class="refsect1" lang="en"> |
|---|
| 49 | <a name="id2725560"></a><h2>Description</h2> |
|---|
| 50 | <p>Class which specifies how the option's value is to be parsed and converted into C++ types. </p> |
|---|
| 51 | <div class="refsect2" lang="en"> |
|---|
| 52 | <a name="id2725568"></a><h3> |
|---|
| 53 | <a name="value_semanticconstruct-copy-destruct"></a><code class="computeroutput">value_semantic</code> construct/copy/destruct</h3> |
|---|
| 54 | <div class="orderedlist"><ol type="1"><li><pre class="literallayout"><a name="id2284765-bb"></a>~value_semantic();</pre></li></ol></div> |
|---|
| 55 | </div> |
|---|
| 56 | <div class="refsect2" lang="en"> |
|---|
| 57 | <a name="id2725601"></a><h3> |
|---|
| 58 | <a name="id2379418-bb"></a><code class="computeroutput">value_semantic</code> public member functions</h3> |
|---|
| 59 | <div class="orderedlist"><ol type="1"> |
|---|
| 60 | <li> |
|---|
| 61 | <pre class="literallayout"><span class="type"><span class="bold"><strong>virtual</strong></span> std::string</span> <a name="id2379423-bb"></a>name() <span class="bold"><strong>const</strong></span>;</pre> |
|---|
| 62 | <p>Returns the name of the option. The name is only meaningful for automatic help message. </p> |
|---|
| 63 | </li> |
|---|
| 64 | <li> |
|---|
| 65 | <pre class="literallayout"><span class="type"><span class="bold"><strong>virtual</strong></span> <span class="bold"><strong>unsigned</strong></span></span> <a name="id2413390-bb"></a>min_tokens() <span class="bold"><strong>const</strong></span>;</pre> |
|---|
| 66 | <p>The minimum number of tokens for this option that should be present on the command line. </p> |
|---|
| 67 | </li> |
|---|
| 68 | <li> |
|---|
| 69 | <pre class="literallayout"><span class="type"><span class="bold"><strong>virtual</strong></span> <span class="bold"><strong>unsigned</strong></span></span> <a name="id2376494-bb"></a>max_tokens() <span class="bold"><strong>const</strong></span>;</pre> |
|---|
| 70 | <p>The maximum number of tokens for this option that should be present on the command line. </p> |
|---|
| 71 | </li> |
|---|
| 72 | <li> |
|---|
| 73 | <pre class="literallayout"><span class="type"><span class="bold"><strong>virtual</strong></span> <span class="bold"><strong>bool</strong></span></span> <a name="id2376514-bb"></a>is_composing() <span class="bold"><strong>const</strong></span>;</pre> |
|---|
| 74 | <p>Returns true if values from different sources should be composed. Otherwise, value from the first source is used and values from other sources are discarded. </p> |
|---|
| 75 | </li> |
|---|
| 76 | <li> |
|---|
| 77 | <pre class="literallayout"><span class="type"><span class="bold"><strong>virtual</strong></span> <span class="bold"><strong>void</strong></span></span> |
|---|
| 78 | <a name="id2378563-bb"></a>parse(boost::any & value_store, <span class="bold"><strong>const</strong></span> std::vector< std::string > & new_tokens, |
|---|
| 79 | <span class="bold"><strong>bool</strong></span> utf8) <span class="bold"><strong>const</strong></span>;</pre> |
|---|
| 80 | <p>Parses a group of tokens that specify a value of option. Stores the result in 'value_store', using whatever representation is desired. May be be called several times if value of the same option is specified more than once. </p> |
|---|
| 81 | </li> |
|---|
| 82 | <li> |
|---|
| 83 | <pre class="literallayout"><span class="type"><span class="bold"><strong>virtual</strong></span> <span class="bold"><strong>bool</strong></span></span> <a name="id2421502-bb"></a>apply_default(boost::any & value_store) <span class="bold"><strong>const</strong></span>;</pre> |
|---|
| 84 | <p>Called to assign default value to 'value_store'. Returns true if default value is assigned, and false if no default value exists. </p> |
|---|
| 85 | </li> |
|---|
| 86 | <li> |
|---|
| 87 | <pre class="literallayout"><span class="type"><span class="bold"><strong>virtual</strong></span> <span class="bold"><strong>void</strong></span></span> <a name="id2438655-bb"></a>notify(<span class="bold"><strong>const</strong></span> boost::any & value_store) <span class="bold"><strong>const</strong></span>;</pre> |
|---|
| 88 | <p>Called when final value of an option is determined. </p> |
|---|
| 89 | </li> |
|---|
| 90 | </ol></div> |
|---|
| 91 | </div> |
|---|
| 92 | </div> |
|---|
| 93 | </div> |
|---|
| 94 | <table width="100%"><tr> |
|---|
| 95 | <td align="left"></td> |
|---|
| 96 | <td align="right"><small>Copyright © 2002-2004 Vladimir Prus</small></td> |
|---|
| 97 | </tr></table> |
|---|
| 98 | <hr> |
|---|
| 99 | <div class="spirit-nav"> |
|---|
| 100 | <a accesskey="p" href="id2525902.html"><img src="images/prev.png" alt="Prev"></a><a accesskey="u" href="program_options/reference.html#id2379391"><img src="images/up.png" alt="Up"></a><a accesskey="h" href="index.html"><img src="images/home.png" alt="Home"></a><a accesskey="n" href="id2284769.html"><img src="images/next.png" alt="Next"></a> |
|---|
| 101 | </div> |
|---|
| 102 | </body> |
|---|
| 103 | </html> |
|---|