Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

source: downloads/boost_1_33_1/doc/html/options_description.html @ 25

Last change on this file since 25 was 12, checked in by landauf, 17 years ago

added boost

File size: 9.8 KB
RevLine 
[12]1<html>
2<head>
3<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
4<title>Class options_description</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#id2473651" title="Header &lt;boost/program_options/options_description.hpp&gt;">
9<link rel="prev" href="id2411202.html" title="Class options_description_easy_init">
10<link rel="next" href="duplicate_option_error.html" title="Class duplicate_option_error">
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="id2411202.html"><img src="images/prev.png" alt="Prev"></a><a accesskey="u" href="program_options/reference.html#id2473651"><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="duplicate_option_error.html"><img src="images/next.png" alt="Next"></a>
24</div>
25<div class="refentry" lang="en">
26<a name="options_description"></a><div class="titlepage"></div>
27<div class="refnamediv">
28<h2><span class="refentrytitle">Class options_description</span></h2>
29<p>boost::program_options::options_description &#8212; </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> options_description {
34<span class="bold"><strong>public</strong></span>:
35  <span class="emphasis"><em>// <a href="options_description.html#options_descriptionconstruct-copy-destruct">construct/copy/destruct</a></em></span>
36  <a href="options_description.html#id2464057-bb">options_description</a>(<span class="bold"><strong>unsigned</strong></span> = m_default_line_length);
37  <a href="options_description.html#id2377898-bb">options_description</a>(<span class="bold"><strong>const</strong></span> std::string &amp;, <span class="bold"><strong>unsigned</strong></span> = m_default_line_length);
38
39  <span class="emphasis"><em>// <a href="options_description.html#id2350872-bb">public member functions</a></em></span>
40  <span class="type"><span class="bold"><strong>void</strong></span></span> <a href="options_description.html#id2350876-bb">add</a>(shared_ptr&lt; <a href="option_description.html" title="Class option_description">option_description</a> &gt;) ;
41  <span class="type"><a href="options_description.html" title="Class options_description">options_description</a> &amp;</span> <a href="options_description.html#id2376744-bb">add</a>(<span class="bold"><strong>const</strong></span> <a href="options_description.html" title="Class options_description">options_description</a> &amp;) ;
42  <span class="type"><a href="id2411202.html" title="Class options_description_easy_init">options_description_easy_init</a></span> <a href="options_description.html#id2407263-bb">add_options</a>() ;
43  <span class="type"><span class="bold"><strong>const</strong></span> <a href="option_description.html" title="Class option_description">option_description</a> &amp;</span> <a href="options_description.html#id2407292-bb">find</a>(<span class="bold"><strong>const</strong></span> std::string &amp;, <span class="bold"><strong>bool</strong></span>) <span class="bold"><strong>const</strong></span>;
44  <span class="type"><span class="bold"><strong>const</strong></span> <a href="option_description.html" title="Class option_description">option_description</a> *</span> <a href="options_description.html#id2342317-bb">find_nothrow</a>(<span class="bold"><strong>const</strong></span> std::string &amp;, <span class="bold"><strong>bool</strong></span>) <span class="bold"><strong>const</strong></span>;
45  <span class="type"><span class="bold"><strong>const</strong></span> std::vector&lt; shared_ptr&lt; <a href="option_description.html" title="Class option_description">option_description</a> &gt; &gt; &amp;</span> <a href="options_description.html#id2369815-bb">options</a>() <span class="bold"><strong>const</strong></span>;
46  <span class="type"><span class="bold"><strong>void</strong></span></span> <a href="options_description.html#id2369831-bb">print</a>(std::ostream &amp;) <span class="bold"><strong>const</strong></span>;
47
48  <span class="bold"><strong>static</strong></span> const unsigned m_default_line_length;
49};</pre></div>
50<div class="refsect1" lang="en">
51<a name="id2722170"></a><h2>Description</h2>
52<p>A set of option descriptions. This provides convenient interface for adding new option (the add_options) method, and facilities to search for options by name.</p>
53<p>See here  for option adding interface discussion. </p>
54<p>option_description </p>
55<div class="refsect2" lang="en">
56<a name="id2722184"></a><h3>
57<a name="options_descriptionconstruct-copy-destruct"></a><code class="computeroutput">options_description</code> construct/copy/destruct</h3>
58<div class="orderedlist"><ol type="1">
59<li>
60<pre class="literallayout"><a name="id2464057-bb"></a>options_description(<span class="bold"><strong>unsigned</strong></span> line_length = m_default_line_length);</pre>
61<p>Creates the instance. </p>
62</li>
63<li>
64<pre class="literallayout"><a name="id2377898-bb"></a>options_description(<span class="bold"><strong>const</strong></span> std::string &amp; caption,
65                    <span class="bold"><strong>unsigned</strong></span> line_length = m_default_line_length);</pre>
66<p>Creates the instance. The 'caption' parameter gives the name of this 'options_description' instance. Primarily useful for output. </p>
67</li>
68</ol></div>
69</div>
70<div class="refsect2" lang="en">
71<a name="id2722260"></a><h3>
72<a name="id2350872-bb"></a><code class="computeroutput">options_description</code> public member functions</h3>
73<div class="orderedlist"><ol type="1">
74<li>
75<pre class="literallayout"><span class="type"><span class="bold"><strong>void</strong></span></span> <a name="id2350876-bb"></a>add(shared_ptr&lt; <a href="option_description.html" title="Class option_description">option_description</a> &gt; desc) ;</pre>
76<p>Adds new variable description. Throws duplicate_variable_error if either short or long name matches that of already present one. </p>
77</li>
78<li>
79<pre class="literallayout"><span class="type"><a href="options_description.html" title="Class options_description">options_description</a> &amp;</span> <a name="id2376744-bb"></a>add(<span class="bold"><strong>const</strong></span> <a href="options_description.html" title="Class options_description">options_description</a> &amp; desc) ;</pre>
80<p>Adds a group of option description. This has the same effect as adding all option_descriptions in 'desc' individually, except that output operator will show a separate group. Returns *this. </p>
81</li>
82<li>
83<pre class="literallayout"><span class="type"><a href="id2411202.html" title="Class options_description_easy_init">options_description_easy_init</a></span> <a name="id2407263-bb"></a>add_options() ;</pre>
84<p>Returns an object of implementation-defined type suitable for adding options to options_description. The returned object will have overloaded operator() with parameter type matching 'option_description' constructors. Calling the operator will create new option_description instance and add it. </p>
85</li>
86<li><pre class="literallayout"><span class="type"><span class="bold"><strong>const</strong></span> <a href="option_description.html" title="Class option_description">option_description</a> &amp;</span> <a name="id2407292-bb"></a>find(<span class="bold"><strong>const</strong></span> std::string &amp; name, <span class="bold"><strong>bool</strong></span> approx) <span class="bold"><strong>const</strong></span>;</pre></li>
87<li><pre class="literallayout"><span class="type"><span class="bold"><strong>const</strong></span> <a href="option_description.html" title="Class option_description">option_description</a> *</span> 
88<a name="id2342317-bb"></a>find_nothrow(<span class="bold"><strong>const</strong></span> std::string &amp; name, <span class="bold"><strong>bool</strong></span> approx) <span class="bold"><strong>const</strong></span>;</pre></li>
89<li><pre class="literallayout"><span class="type"><span class="bold"><strong>const</strong></span> std::vector&lt; shared_ptr&lt; <a href="option_description.html" title="Class option_description">option_description</a> &gt; &gt; &amp;</span> <a name="id2369815-bb"></a>options() <span class="bold"><strong>const</strong></span>;</pre></li>
90<li>
91<pre class="literallayout"><span class="type"><span class="bold"><strong>void</strong></span></span> <a name="id2369831-bb"></a>print(std::ostream &amp; os) <span class="bold"><strong>const</strong></span>;</pre>
92<p>Output 'desc' to the specified stream, calling 'f' to output each option_description element. </p>
93</li>
94</ol></div>
95</div>
96</div>
97</div>
98<table width="100%"><tr>
99<td align="left"></td>
100<td align="right"><small>Copyright © 2002-2004 Vladimir Prus</small></td>
101</tr></table>
102<hr>
103<div class="spirit-nav">
104<a accesskey="p" href="id2411202.html"><img src="images/prev.png" alt="Prev"></a><a accesskey="u" href="program_options/reference.html#id2473651"><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="duplicate_option_error.html"><img src="images/next.png" alt="Next"></a>
105</div>
106</body>
107</html>
Note: See TracBrowser for help on using the repository browser.