Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

source: downloads/boost_1_33_1/doc/html/id753810.html @ 12

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

added boost

File size: 6.4 KB
Line 
1<html>
2<head>
3<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
4<title>Class positional_options_description</title>
5<link rel="stylesheet" href="boostbook.css" type="text/css">
6<meta name="generator" content="DocBook XSL Stylesheets V1.68.1">
7<link rel="start" href="index.html" title="The Boost C++ Libraries">
8<link rel="up" href="program_options/reference.html#id753794" title="Header &lt;boost/program_options/positional_options.hpp&gt;">
9<link rel="prev" href="id732463.html" title="Function parse_environment">
10<link rel="next" href="typed_value.html" title="Class template typed_value">
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="id732463.html"><img src="images/prev.png" alt="Prev"></a><a accesskey="u" href="program_options/reference.html#id753794"><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="typed_value.html"><img src="images/next.png" alt="Next"></a>
24</div>
25<div class="refentry" lang="en">
26<a name="id753810"></a><div class="titlepage"></div>
27<div class="refnamediv">
28<h2><span class="refentrytitle">Class positional_options_description</span></h2>
29<p>boost::program_options::positional_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> positional_options_description {
34<span class="bold"><strong>public</strong></span>:
35  <span class="emphasis"><em>// <a href="id753810.html#id753810construct-copy-destruct">construct/copy/destruct</a></em></span>
36  <a href="id753810.html#id1114888-bb">positional_options_description</a>();
37
38  <span class="emphasis"><em>// <a href="id753810.html#id1036104-bb">public member functions</a></em></span>
39  <span class="type"><span class="bold"><strong>void</strong></span></span> <a href="id753810.html#id1036108-bb">add</a>(<span class="bold"><strong>const</strong></span> <span class="bold"><strong>char</strong></span> *, <span class="bold"><strong>int</strong></span>) ;
40  <span class="type"><span class="bold"><strong>unsigned</strong></span></span> <a href="id753810.html#id728289-bb">max_total_count</a>() <span class="bold"><strong>const</strong></span>;
41  <span class="type"><span class="bold"><strong>const</strong></span>  std::string &amp;</span> <a href="id753810.html#id728312-bb">name_for_position</a>(<span class="bold"><strong>unsigned</strong></span>) <span class="bold"><strong>const</strong></span>;
42};</pre></div>
43<div class="refsect1" lang="en">
44<a name="id1256550"></a><h2>Description</h2>
45<p>Describes positional options.</p>
46<p>The class allows to guess option names for positional options, which are specified on the command line and are identified by the position. The class uses the information provided by the user to associate a name with every positional option, or tell that no name is known.</p>
47<p>The primary assumption is that only the relative order of the positional options themselves matters, and that any interleaving ordinary options don't affect interpretation of positional options.</p>
48<p>The user initializes the class by specifying that first N positional options should be given the name X1, following M options should be given the name X2 and so on. </p>
49<div class="refsect2" lang="en">
50<a name="id1256574"></a><h3>
51<a name="id753810construct-copy-destruct"></a><code class="computeroutput">positional_options_description</code> construct/copy/destruct</h3>
52<div class="orderedlist"><ol type="1"><li><pre class="literallayout"><a name="id1114888-bb"></a>positional_options_description();</pre></li></ol></div>
53</div>
54<div class="refsect2" lang="en">
55<a name="id1256606"></a><h3>
56<a name="id1036104-bb"></a><code class="computeroutput">positional_options_description</code> public member functions</h3>
57<div class="orderedlist"><ol type="1">
58<li>
59<pre class="literallayout"><span class="type"><span class="bold"><strong>void</strong></span></span> <a name="id1036108-bb"></a>add(<span class="bold"><strong>const</strong></span> <span class="bold"><strong>char</strong></span> * name, <span class="bold"><strong>int</strong></span> max_count) ;</pre>
60<p>Species that up to 'max_count' next positional options should be given the 'name'. The value of '-1' means 'unlimited'. No calls to 'add' can be made after call with 'max_value' equal to '-1'. </p>
61</li>
62<li>
63<pre class="literallayout"><span class="type"><span class="bold"><strong>unsigned</strong></span></span> <a name="id728289-bb"></a>max_total_count() <span class="bold"><strong>const</strong></span>;</pre>
64<p>Returns the maximum number of positional options that can be present. Can return numeric_limits&lt;unsigned&gt;::max() to indicate unlimited number. </p>
65</li>
66<li>
67<pre class="literallayout"><span class="type"><span class="bold"><strong>const</strong></span>  std::string &amp;</span> <a name="id728312-bb"></a>name_for_position(<span class="bold"><strong>unsigned</strong></span> position) <span class="bold"><strong>const</strong></span>;</pre>
68<p>Returns the name that should be associated with positional options at 'position'. Precondition: position &lt; max_total_count() </p>
69</li>
70</ol></div>
71</div>
72</div>
73</div>
74<table xmlns:rev="http://www.cs.rpi.edu/~gregod/boost/tools/doc/revision" width="100%"><tr>
75<td align="left"></td>
76<td align="right"><small>Copyright © 2002-2004 Vladimir Prus</small></td>
77</tr></table>
78<hr>
79<div class="spirit-nav">
80<a accesskey="p" href="id732463.html"><img src="images/prev.png" alt="Prev"></a><a accesskey="u" href="program_options/reference.html#id753794"><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="typed_value.html"><img src="images/next.png" alt="Next"></a>
81</div>
82</body>
83</html>
Note: See TracBrowser for help on using the repository browser.