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
|
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=US-ASCII">
<title>Class options_description</title>
<link rel="stylesheet" href="../../boostbook.css" type="text/css">
<meta name="generator" content="DocBook XSL Stylesheets V1.75.2">
<link rel="home" href="../../index.html" title="The Boost C++ Libraries BoostBook Documentation Subset">
<link rel="up" href="../../program_options/reference.html#header.boost.program_options.options_description_hpp" title="Header <boost/program_options/options_description.hpp>">
<link rel="prev" href="options_description_eas_id937700.html" title="Class options_description_easy_init">
<link rel="next" href="duplicate_option_error.html" title="Class duplicate_option_error">
</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="options_description_eas_id937700.html"><img src="../../../../doc/html/images/prev.png" alt="Prev"></a><a accesskey="u" href="../../program_options/reference.html#header.boost.program_options.options_description_hpp"><img src="../../../../doc/html/images/up.png" alt="Up"></a><a accesskey="h" href="../../index.html"><img src="../../../../doc/html/images/home.png" alt="Home"></a><a accesskey="n" href="duplicate_option_error.html"><img src="../../../../doc/html/images/next.png" alt="Next"></a>
</div>
<div class="refentry" title="Class options_description">
<a name="boost.program_options.options_description"></a><div class="titlepage"></div>
<div class="refnamediv">
<h2><span class="refentrytitle">Class options_description</span></h2>
<p>boost::program_options::options_description</p>
</div>
<h2 xmlns:rev="http://www.cs.rpi.edu/~gregod/boost/tools/doc/revision" class="refsynopsisdiv-title">Synopsis</h2>
<div xmlns:rev="http://www.cs.rpi.edu/~gregod/boost/tools/doc/revision" class="refsynopsisdiv"><pre class="synopsis"><span class="emphasis"><em>// In header: <<a class="link" href="../../program_options/reference.html#header.boost.program_options.options_description_hpp" title="Header <boost/program_options/options_description.hpp>">boost/program_options/options_description.hpp</a>>
</em></span>
<span class="bold"><strong>class</strong></span> <a class="link" href="options_description.html" title="Class options_description">options_description</a> {
<span class="bold"><strong>public</strong></span>:
<span class="emphasis"><em>// <a class="link" href="options_description.html#boost.program_options.options_descriptionconstruct-copy-destruct">construct/copy/destruct</a></em></span>
<a class="link" href="options_description.html#id946888-bb">options_description</a>(<span class="bold"><strong>unsigned</strong></span> = m_default_line_length,
<span class="bold"><strong>unsigned</strong></span> = m_default_line_length/2);
<a class="link" href="options_description.html#id946906-bb">options_description</a>(<span class="bold"><strong>const</strong></span> std::string &, <span class="bold"><strong>unsigned</strong></span> = m_default_line_length,
<span class="bold"><strong>unsigned</strong></span> = m_default_line_length/2);
<span class="emphasis"><em>// <a class="link" href="options_description.html#id939562-bb">public member functions</a></em></span>
<span class="type"><span class="bold"><strong>void</strong></span></span> <a class="link" href="options_description.html#id939565-bb">add</a>(shared_ptr< <a class="link" href="option_description.html" title="Class option_description">option_description</a> >) ;
<span class="type"><a class="link" href="options_description.html" title="Class options_description">options_description</a> &</span> <a class="link" href="options_description.html#id939586-bb">add</a>(<span class="bold"><strong>const</strong></span> <a class="link" href="options_description.html" title="Class options_description">options_description</a> &) ;
<span class="type"><a class="link" href="options_description_eas_id937700.html" title="Class options_description_easy_init">options_description_easy_init</a></span> <a class="link" href="options_description.html#id939610-bb">add_options</a>() ;
<span class="type"><span class="bold"><strong>const</strong></span> <a class="link" href="option_description.html" title="Class option_description">option_description</a> &</span>
<a class="link" href="options_description.html#id981993-bb">find</a>(<span class="bold"><strong>const</strong></span> std::string &, <span class="bold"><strong>bool</strong></span>, <span class="bold"><strong>bool</strong></span> = false, <span class="bold"><strong>bool</strong></span> = false) <span class="bold"><strong>const</strong></span>;
<span class="type"><span class="bold"><strong>const</strong></span> <a class="link" href="option_description.html" title="Class option_description">option_description</a> *</span>
<a class="link" href="options_description.html#id946826-bb">find_nothrow</a>(<span class="bold"><strong>const</strong></span> std::string &, <span class="bold"><strong>bool</strong></span>, <span class="bold"><strong>bool</strong></span> = false, <span class="bold"><strong>bool</strong></span> = false) <span class="bold"><strong>const</strong></span>;
<span class="type"><span class="bold"><strong>const</strong></span> std::vector< shared_ptr< <a class="link" href="option_description.html" title="Class option_description">option_description</a> > > &</span> <a class="link" href="options_description.html#id946861-bb">options</a>() <span class="bold"><strong>const</strong></span>;
<span class="type"><span class="bold"><strong>void</strong></span></span> <a class="link" href="options_description.html#id946871-bb">print</a>(std::ostream &) <span class="bold"><strong>const</strong></span>;
<span class="emphasis"><em>// <a class="link" href="options_description.html#id903008-bb">friend functions</a></em></span>
<span class="type"><span class="bold"><strong>friend</strong></span> BOOST_PROGRAM_OPTIONS_DECL std::ostream &</span>
<a class="link" href="options_description.html#id903010-bb"><span class="bold"><strong>operator</strong></span><<</a>(std::ostream &, <span class="bold"><strong>const</strong></span> <a class="link" href="options_description.html" title="Class options_description">options_description</a> &) ;
<span class="bold"><strong>static</strong></span> <span class="type"><span class="bold"><strong>const</strong></span> <span class="bold"><strong>unsigned</strong></span></span> m_default_line_length;
};</pre></div>
<div class="refsect1" title="Description">
<a name="id1428427"></a><h2>Description</h2>
<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>
<p>See here for option adding interface discussion. </p>
<p>option_description </p>
<p>
</p>
<div class="refsect2" title="options_description public construct/copy/destruct">
<a name="id1428442"></a><h3>
<a name="boost.program_options.options_descriptionconstruct-copy-destruct"></a><code class="computeroutput">options_description</code>
public
construct/copy/destruct</h3>
<div class="orderedlist"><ol class="orderedlist" type="1">
<li class="listitem">
<pre class="literallayout"><a name="id946888-bb"></a>options_description(<span class="bold"><strong>unsigned</strong></span> line_length = m_default_line_length,
<span class="bold"><strong>unsigned</strong></span> min_description_length = m_default_line_length/2);</pre>
<p>Creates the instance. </p>
</li>
<li class="listitem">
<pre class="literallayout"><a name="id946906-bb"></a>options_description(<span class="bold"><strong>const</strong></span> std::string & caption,
<span class="bold"><strong>unsigned</strong></span> line_length = m_default_line_length,
<span class="bold"><strong>unsigned</strong></span> min_description_length = m_default_line_length/2);</pre>
<p>Creates the instance. The 'caption' parameter gives the name of this 'options_description' instance. Primarily useful for output. The 'description_length' specifies the number of columns that should be reserved for the description text; if the option text encroaches into this, then the description will start on the next line. </p>
</li>
</ol></div>
</div>
<div class="refsect2" title="options_description public member functions">
<a name="id1428534"></a><h3>
<a name="id939562-bb"></a><code class="computeroutput">options_description</code> public member functions</h3>
<div class="orderedlist"><ol class="orderedlist" type="1">
<li class="listitem">
<pre class="literallayout"><span class="type"><span class="bold"><strong>void</strong></span></span> <a name="id939565-bb"></a>add(shared_ptr< <a class="link" href="option_description.html" title="Class option_description">option_description</a> > desc) ;</pre>
<p>Adds new variable description. Throws duplicate_variable_error if either short or long name matches that of already present one. </p>
</li>
<li class="listitem">
<pre class="literallayout"><span class="type"><a class="link" href="options_description.html" title="Class options_description">options_description</a> &</span> <a name="id939586-bb"></a>add(<span class="bold"><strong>const</strong></span> <a class="link" href="options_description.html" title="Class options_description">options_description</a> & desc) ;</pre>
<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>
</li>
<li class="listitem">
<pre class="literallayout"><span class="type"><a class="link" href="options_description_eas_id937700.html" title="Class options_description_easy_init">options_description_easy_init</a></span> <a name="id939610-bb"></a>add_options() ;</pre>
<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>
</li>
<li class="listitem"><pre class="literallayout"><span class="type"><span class="bold"><strong>const</strong></span> <a class="link" href="option_description.html" title="Class option_description">option_description</a> &</span>
<a name="id981993-bb"></a>find(<span class="bold"><strong>const</strong></span> std::string & name, <span class="bold"><strong>bool</strong></span> approx, <span class="bold"><strong>bool</strong></span> long_ignore_case = false,
<span class="bold"><strong>bool</strong></span> short_ignore_case = false) <span class="bold"><strong>const</strong></span>;</pre></li>
<li class="listitem"><pre class="literallayout"><span class="type"><span class="bold"><strong>const</strong></span> <a class="link" href="option_description.html" title="Class option_description">option_description</a> *</span>
<a name="id946826-bb"></a>find_nothrow(<span class="bold"><strong>const</strong></span> std::string & name, <span class="bold"><strong>bool</strong></span> approx,
<span class="bold"><strong>bool</strong></span> long_ignore_case = false, <span class="bold"><strong>bool</strong></span> short_ignore_case = false) <span class="bold"><strong>const</strong></span>;</pre></li>
<li class="listitem"><pre class="literallayout"><span class="type"><span class="bold"><strong>const</strong></span> std::vector< shared_ptr< <a class="link" href="option_description.html" title="Class option_description">option_description</a> > > &</span> <a name="id946861-bb"></a>options() <span class="bold"><strong>const</strong></span>;</pre></li>
<li class="listitem">
<pre class="literallayout"><span class="type"><span class="bold"><strong>void</strong></span></span> <a name="id946871-bb"></a>print(std::ostream & os) <span class="bold"><strong>const</strong></span>;</pre>
<p>Output 'desc' to the specified stream, calling 'f' to output each option_description element. </p>
</li>
</ol></div>
</div>
<div class="refsect2" title="options_description friend functions">
<a name="id1428841"></a><h3>
<a name="id903008-bb"></a><code class="computeroutput">options_description</code> friend functions</h3>
<div class="orderedlist"><ol class="orderedlist" type="1"><li class="listitem">
<pre class="literallayout"><span class="type"><span class="bold"><strong>friend</strong></span> BOOST_PROGRAM_OPTIONS_DECL std::ostream &</span>
<a name="id903010-bb"></a><span class="bold"><strong>operator</strong></span><<(std::ostream & os, <span class="bold"><strong>const</strong></span> <a class="link" href="options_description.html" title="Class options_description">options_description</a> & desc) ;</pre>
<p>Produces a human readable output of 'desc', listing options, their descriptions and allowed parameters. Other options_description instances previously passed to add will be output separately. </p>
</li></ol></div>
</div>
</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 © 2002-2004 Vladimir Prus<p>Distributed under the Boost Software License, Version 1.0.
(See accompanying file <code class="filename">LICENSE_1_0.txt</code> 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="options_description_eas_id937700.html"><img src="../../../../doc/html/images/prev.png" alt="Prev"></a><a accesskey="u" href="../../program_options/reference.html#header.boost.program_options.options_description_hpp"><img src="../../../../doc/html/images/up.png" alt="Up"></a><a accesskey="h" href="../../index.html"><img src="../../../../doc/html/images/home.png" alt="Home"></a><a accesskey="n" href="duplicate_option_error.html"><img src="../../../../doc/html/images/next.png" alt="Next"></a>
</div>
</body>
</html>
|