1<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd"> 2<html> 3<head> 4<meta http-equiv="Content-Type" content="text/html; charset=UTF-8"> 5<title>Class variables_map</title> 6<link rel="stylesheet" href="../../../../doc/src/boostbook.css" type="text/css"> 7<meta name="generator" content="DocBook XSL Stylesheets V1.79.1"> 8<link rel="home" href="../../index.html" title="The Boost C++ Libraries BoostBook Documentation Subset"> 9<link rel="up" href="../../program_options/reference.html#header.boost.program_options.variables_map_hpp" title="Header <boost/program_options/variables_map.hpp>"> 10<link rel="prev" href="variable_value.html" title="Class variable_value"> 11<link rel="next" href="store_1_3_31_9_11_1_1_5.html" title="Function store"> 12</head> 13<body bgcolor="white" text="black" link="#0000FF" vlink="#840084" alink="#0000FF"> 14<table cellpadding="2" width="100%"><tr> 15<td valign="top"><img alt="Boost C++ Libraries" width="277" height="86" src="../../../../boost.png"></td> 16<td align="center"><a href="../../../../index.html">Home</a></td> 17<td align="center"><a href="../../../../libs/libraries.htm">Libraries</a></td> 18<td align="center"><a href="http://www.boost.org/users/people.html">People</a></td> 19<td align="center"><a href="http://www.boost.org/users/faq.html">FAQ</a></td> 20<td align="center"><a href="../../../../more/index.htm">More</a></td> 21</tr></table> 22<hr> 23<div class="spirit-nav"> 24<a accesskey="p" href="variable_value.html"><img src="../../../../doc/src/images/prev.png" alt="Prev"></a><a accesskey="u" href="../../program_options/reference.html#header.boost.program_options.variables_map_hpp"><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="store_1_3_31_9_11_1_1_5.html"><img src="../../../../doc/src/images/next.png" alt="Next"></a> 25</div> 26<div class="refentry"> 27<a name="boost.program_options.variables_map"></a><div class="titlepage"></div> 28<div class="refnamediv"> 29<h2><span class="refentrytitle">Class variables_map</span></h2> 30<p>boost::program_options::variables_map</p> 31</div> 32<h2 xmlns:rev="http://www.cs.rpi.edu/~gregod/boost/tools/doc/revision" class="refsynopsisdiv-title">Synopsis</h2> 33<div xmlns:rev="http://www.cs.rpi.edu/~gregod/boost/tools/doc/revision" class="refsynopsisdiv"><pre class="synopsis"><span class="comment">// In header: <<a class="link" href="../../program_options/reference.html#header.boost.program_options.variables_map_hpp" title="Header <boost/program_options/variables_map.hpp>">boost/program_options/variables_map.hpp</a>> 34 35</span> 36<span class="keyword">class</span> <a class="link" href="variables_map.html" title="Class variables_map">variables_map</a> <span class="special">:</span> <span class="keyword">public</span> boost::program_options::abstract_variables_map, 37 <span class="keyword">public</span> std::map< std::string, variable_value > 38<span class="special">{</span> 39<span class="keyword">public</span><span class="special">:</span> 40 <span class="comment">// <a class="link" href="variables_map.html#boost.program_options.variables_mapconstruct-copy-destruct">construct/copy/destruct</a></span> 41 <a class="link" href="variables_map.html#id-1_3_31_9_11_1_1_4_5-bb"><span class="identifier">variables_map</span></a><span class="special">(</span><span class="special">)</span><span class="special">;</span> 42 <a class="link" href="variables_map.html#id-1_3_31_9_11_1_1_4_6-bb"><span class="identifier">variables_map</span></a><span class="special">(</span><span class="keyword">const</span> <a class="link" href="abstract_variables_map.html" title="Class abstract_variables_map">abstract_variables_map</a> <span class="special">*</span><span class="special">)</span><span class="special">;</span> 43 44 <span class="comment">// <a class="link" href="variables_map.html#id-1_3_31_9_11_1_1_4_4-bb">public member functions</a></span> 45 <span class="keyword">const</span> <a class="link" href="variable_value.html" title="Class variable_value">variable_value</a> <span class="special">&</span> <a class="link" href="variables_map.html#id-1_3_31_9_11_1_1_4_4_1-bb"><span class="keyword">operator</span><span class="special">[</span><span class="special">]</span></a><span class="special">(</span><span class="keyword">const</span> <span class="identifier">std</span><span class="special">::</span><span class="identifier">string</span> <span class="special">&</span><span class="special">)</span> <span class="keyword">const</span><span class="special">;</span> 46 <span class="keyword">void</span> <a class="link" href="variables_map.html#id-1_3_31_9_11_1_1_4_4_2-bb"><span class="identifier">clear</span></a><span class="special">(</span><span class="special">)</span><span class="special">;</span> 47 <span class="keyword">void</span> <a class="link" href="variables_map.html#id-1_3_31_9_11_1_1_4_4_3-bb"><span class="identifier">notify</span></a><span class="special">(</span><span class="special">)</span><span class="special">;</span> 48 49 <span class="comment">// <a class="link" href="variables_map.html#id-1_3_31_9_11_1_1_4_7-bb">private member functions</a></span> 50 <span class="keyword">virtual</span> <span class="keyword">const</span> <a class="link" href="variable_value.html" title="Class variable_value">variable_value</a> <span class="special">&</span> <a class="link" href="variables_map.html#id-1_3_31_9_11_1_1_4_7_1-bb"><span class="identifier">get</span></a><span class="special">(</span><span class="keyword">const</span> <span class="identifier">std</span><span class="special">::</span><span class="identifier">string</span> <span class="special">&</span><span class="special">)</span> <span class="keyword">const</span><span class="special">;</span> 51 52 <span class="comment">// <a class="link" href="variables_map.html#id-1_3_31_9_11_1_1_4_8-bb">friend functions</a></span> 53 <span class="keyword">friend</span> <span class="identifier">BOOST_PROGRAM_OPTIONS_DECL</span> <span class="keyword">void</span> 54 <a class="link" href="variables_map.html#id-1_3_31_9_11_1_1_4_8_1-bb"><span class="identifier">store</span></a><span class="special">(</span><span class="keyword">const</span> <a class="link" href="basic_parsed_options.html" title="Class template basic_parsed_options">basic_parsed_options</a><span class="special"><</span> <span class="keyword">char</span> <span class="special">></span> <span class="special">&</span><span class="special">,</span> <a class="link" href="variables_map.html" title="Class variables_map">variables_map</a> <span class="special">&</span><span class="special">,</span> <span class="keyword">bool</span><span class="special">)</span><span class="special">;</span> 55<span class="special">}</span><span class="special">;</span></pre></div> 56<div class="refsect1"> 57<a name="id-1.3.31.9.12.6.4"></a><h2>Description</h2> 58<p>Concrete variables map which store variables in real map.</p> 59<p>This class is derived from std::map<std::string, variable_value>, so you can use all map operators to examine its content. </p> 60<div class="refsect2"> 61<a name="id-1.3.31.9.12.6.4.4"></a><h3> 62<a name="boost.program_options.variables_mapconstruct-copy-destruct"></a><code class="computeroutput">variables_map</code> 63 public 64 construct/copy/destruct</h3> 65<div class="orderedlist"><ol class="orderedlist" type="1"> 66<li class="listitem"><pre class="literallayout"><a name="id-1_3_31_9_11_1_1_4_5-bb"></a><span class="identifier">variables_map</span><span class="special">(</span><span class="special">)</span><span class="special">;</span></pre></li> 67<li class="listitem"><pre class="literallayout"><a name="id-1_3_31_9_11_1_1_4_6-bb"></a><span class="identifier">variables_map</span><span class="special">(</span><span class="keyword">const</span> <a class="link" href="abstract_variables_map.html" title="Class abstract_variables_map">abstract_variables_map</a> <span class="special">*</span> next<span class="special">)</span><span class="special">;</span></pre></li> 68</ol></div> 69</div> 70<div class="refsect2"> 71<a name="id-1.3.31.9.12.6.4.5"></a><h3> 72<a name="id-1_3_31_9_11_1_1_4_4-bb"></a><code class="computeroutput">variables_map</code> public member functions</h3> 73<div class="orderedlist"><ol class="orderedlist" type="1"> 74<li class="listitem"><pre class="literallayout"><span class="keyword">const</span> <a class="link" href="variable_value.html" title="Class variable_value">variable_value</a> <span class="special">&</span> <a name="id-1_3_31_9_11_1_1_4_4_1-bb"></a><span class="keyword">operator</span><span class="special">[</span><span class="special">]</span><span class="special">(</span><span class="keyword">const</span> <span class="identifier">std</span><span class="special">::</span><span class="identifier">string</span> <span class="special">&</span> name<span class="special">)</span> <span class="keyword">const</span><span class="special">;</span></pre></li> 75<li class="listitem"><pre class="literallayout"><span class="keyword">void</span> <a name="id-1_3_31_9_11_1_1_4_4_2-bb"></a><span class="identifier">clear</span><span class="special">(</span><span class="special">)</span><span class="special">;</span></pre></li> 76<li class="listitem"><pre class="literallayout"><span class="keyword">void</span> <a name="id-1_3_31_9_11_1_1_4_4_3-bb"></a><span class="identifier">notify</span><span class="special">(</span><span class="special">)</span><span class="special">;</span></pre></li> 77</ol></div> 78</div> 79<div class="refsect2"> 80<a name="id-1.3.31.9.12.6.4.6"></a><h3> 81<a name="id-1_3_31_9_11_1_1_4_7-bb"></a><code class="computeroutput">variables_map</code> private member functions</h3> 82<div class="orderedlist"><ol class="orderedlist" type="1"><li class="listitem"> 83<pre class="literallayout"><span class="keyword">virtual</span> <span class="keyword">const</span> <a class="link" href="variable_value.html" title="Class variable_value">variable_value</a> <span class="special">&</span> <a name="id-1_3_31_9_11_1_1_4_7_1-bb"></a><span class="identifier">get</span><span class="special">(</span><span class="keyword">const</span> <span class="identifier">std</span><span class="special">::</span><span class="identifier">string</span> <span class="special">&</span> name<span class="special">)</span> <span class="keyword">const</span><span class="special">;</span></pre> 84<p>Implementation of abstract_variables_map::get which does 'find' in *this. </p> 85</li></ol></div> 86</div> 87<div class="refsect2"> 88<a name="id-1.3.31.9.12.6.4.7"></a><h3> 89<a name="id-1_3_31_9_11_1_1_4_8-bb"></a><code class="computeroutput">variables_map</code> friend functions</h3> 90<div class="orderedlist"><ol class="orderedlist" type="1"><li class="listitem"> 91<pre class="literallayout"><span class="keyword">friend</span> <span class="identifier">BOOST_PROGRAM_OPTIONS_DECL</span> <span class="keyword">void</span> 92<a name="id-1_3_31_9_11_1_1_4_8_1-bb"></a><span class="identifier">store</span><span class="special">(</span><span class="keyword">const</span> <a class="link" href="basic_parsed_options.html" title="Class template basic_parsed_options">basic_parsed_options</a><span class="special"><</span> <span class="keyword">char</span> <span class="special">></span> <span class="special">&</span> options<span class="special">,</span> <a class="link" href="variables_map.html" title="Class variables_map">variables_map</a> <span class="special">&</span> xm<span class="special">,</span> 93 <span class="keyword">bool</span> utf8<span class="special">)</span><span class="special">;</span></pre> 94<p>Stores in 'm' all options that are defined in 'options'. If 'm' already has a non-defaulted value of an option, that value is not changed, even if 'options' specify some value. </p> 95</li></ol></div> 96</div> 97</div> 98</div> 99<table xmlns:rev="http://www.cs.rpi.edu/~gregod/boost/tools/doc/revision" width="100%"><tr> 100<td align="left"></td> 101<td align="right"><div class="copyright-footer">Copyright © 2002-2004 Vladimir Prus<p>Distributed under the Boost Software License, Version 1.0. 102 (See accompanying file <code class="filename">LICENSE_1_0.txt</code> or copy at 103 <a href="http://www.boost.org/LICENSE_1_0.txt" target="_top">http://www.boost.org/LICENSE_1_0.txt</a>) 104 </p> 105</div></td> 106</tr></table> 107<hr> 108<div class="spirit-nav"> 109<a accesskey="p" href="variable_value.html"><img src="../../../../doc/src/images/prev.png" alt="Prev"></a><a accesskey="u" href="../../program_options/reference.html#header.boost.program_options.variables_map_hpp"><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="store_1_3_31_9_11_1_1_5.html"><img src="../../../../doc/src/images/next.png" alt="Next"></a> 110</div> 111</body> 112</html> 113