summaryrefslogtreecommitdiff
path: root/doc/html/options_8cpp.html
blob: 55dc4ca2eef8e8725ff3a672afd86fccc8c074a4 (plain) (blame)
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
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html><head><meta http-equiv="Content-Type" content="text/html;charset=iso-8859-1">
<title>anytun: options.cpp File Reference</title>
<link href="doxygen.css" rel="stylesheet" type="text/css">
<link href="tabs.css" rel="stylesheet" type="text/css">
</head><body>
<!-- Generated by Doxygen 1.5.1 -->
<div class="tabs">
  <ul>
    <li><a href="main.html"><span>Main&nbsp;Page</span></a></li>
    <li><a href="namespaces.html"><span>Namespaces</span></a></li>
    <li><a href="annotated.html"><span>Classes</span></a></li>
    <li id="current"><a href="files.html"><span>Files</span></a></li>
  </ul></div>
<div class="tabs">
  <ul>
    <li><a href="files.html"><span>File&nbsp;List</span></a></li>
    <li><a href="globals.html"><span>File&nbsp;Members</span></a></li>
  </ul></div>
<h1>options.cpp File Reference</h1><code>#include &lt;iostream&gt;</code><br>
<code>#include &lt;string&gt;</code><br>
<code>#include &lt;sstream&gt;</code><br>
<code>#include &quot;<a class="el" href="datatypes_8h-source.html">datatypes.h</a>&quot;</code><br>
<code>#include &quot;<a class="el" href="options_8h-source.html">options.h</a>&quot;</code><br>
<table border="0" cellpadding="0" cellspacing="0">
<tr><td></td></tr>
<tr><td colspan="2"><br><h2>Defines</h2></td></tr>
<tr><td class="memItemLeft" nowrap align="right" valign="top">#define&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="options_8cpp.html#b2c4e3c2031ae2187d3995f4b4848e10">PARSE_BOOL_PARAM</a>(SHORT, LONG, VALUE)</td></tr>

<tr><td class="memItemLeft" nowrap align="right" valign="top">#define&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="options_8cpp.html#0d965a5094bb6aa3a39c4ff7ea99a13f">PARSE_INVERSE_BOOL_PARAM</a>(SHORT, LONG, VALUE)</td></tr>

<tr><td class="memItemLeft" nowrap align="right" valign="top">#define&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="options_8cpp.html#8c39923ab70d37dd4ac5c17b7b41df93">PARSE_SCALAR_PARAM</a>(SHORT, LONG, VALUE)</td></tr>

<tr><td class="memItemLeft" nowrap align="right" valign="top">#define&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="options_8cpp.html#ff99f765434c4a73e4b4b9f5d71022e2">PARSE_SCALAR_PARAM2</a>(SHORT, LONG, VALUE1, VALUE2)</td></tr>

</table>
<hr><h2>Define Documentation</h2>
<a class="anchor" name="b2c4e3c2031ae2187d3995f4b4848e10"></a><!-- doxytag: member="options.cpp::PARSE_BOOL_PARAM" ref="b2c4e3c2031ae2187d3995f4b4848e10" args="(SHORT, LONG, VALUE)" -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">#define PARSE_BOOL_PARAM          </td>
          <td>(</td>
          <td class="paramtype">SHORT,         <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">LONG,         <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">VALUE&nbsp;</td>
          <td class="paramname">          </td>
          <td>&nbsp;)&nbsp;</td>
          <td width="100%"></td>
        </tr>
      </table>
</div>
<div class="memdoc">

<p>
<b>Value:</b><div class="fragment"><pre class="fragment"><span class="keywordflow">else</span> <span class="keywordflow">if</span>(str == SHORT || str == LONG)                 \
      VALUE = <span class="keyword">true</span>;
</pre></div>
</div>
</div><p>
<a class="anchor" name="0d965a5094bb6aa3a39c4ff7ea99a13f"></a><!-- doxytag: member="options.cpp::PARSE_INVERSE_BOOL_PARAM" ref="0d965a5094bb6aa3a39c4ff7ea99a13f" args="(SHORT, LONG, VALUE)" -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">#define PARSE_INVERSE_BOOL_PARAM          </td>
          <td>(</td>
          <td class="paramtype">SHORT,         <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">LONG,         <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">VALUE&nbsp;</td>
          <td class="paramname">          </td>
          <td>&nbsp;)&nbsp;</td>
          <td width="100%"></td>
        </tr>
      </table>
</div>
<div class="memdoc">

<p>
<b>Value:</b><div class="fragment"><pre class="fragment"><span class="keywordflow">else</span> <span class="keywordflow">if</span>(str == SHORT || str == LONG)                 \
      VALUE = <span class="keyword">false</span>;
</pre></div>
</div>
</div><p>
<a class="anchor" name="8c39923ab70d37dd4ac5c17b7b41df93"></a><!-- doxytag: member="options.cpp::PARSE_SCALAR_PARAM" ref="8c39923ab70d37dd4ac5c17b7b41df93" args="(SHORT, LONG, VALUE)" -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">#define PARSE_SCALAR_PARAM          </td>
          <td>(</td>
          <td class="paramtype">SHORT,         <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">LONG,         <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">VALUE&nbsp;</td>
          <td class="paramname">          </td>
          <td>&nbsp;)&nbsp;</td>
          <td width="100%"></td>
        </tr>
      </table>
</div>
<div class="memdoc">

<p>
<b>Value:</b><div class="fragment"><pre class="fragment"><span class="keywordflow">else</span> <span class="keywordflow">if</span>(str == SHORT || str == LONG)                 \
    {                                                    \
      <span class="keywordflow">if</span>(argc &lt; 1 || argv[i+1][0] == <span class="charliteral">'-'</span>)                \
        <span class="keywordflow">return</span> <span class="keyword">false</span>;                                    \
      std::stringstream tmp;                             \
      tmp &lt;&lt; argv[i+1];                                  \
      tmp &gt;&gt; VALUE;                                      \
      argc--;                                            \
      i++;                                               \
    }
</pre></div>
</div>
</div><p>
<a class="anchor" name="ff99f765434c4a73e4b4b9f5d71022e2"></a><!-- doxytag: member="options.cpp::PARSE_SCALAR_PARAM2" ref="ff99f765434c4a73e4b4b9f5d71022e2" args="(SHORT, LONG, VALUE1, VALUE2)" -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">#define PARSE_SCALAR_PARAM2          </td>
          <td>(</td>
          <td class="paramtype">SHORT,         <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">LONG,         <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">VALUE1,         <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">VALUE2&nbsp;</td>
          <td class="paramname">          </td>
          <td>&nbsp;)&nbsp;</td>
          <td width="100%"></td>
        </tr>
      </table>
</div>
<div class="memdoc">

<p>
<b>Value:</b><div class="fragment"><pre class="fragment"><span class="keywordflow">else</span> <span class="keywordflow">if</span>(str == SHORT || str == LONG)                 \
    {                                                    \
      <span class="keywordflow">if</span>(argc &lt; 2 ||                                     \
         argv[i+1][0] == <span class="charliteral">'-'</span> || argv[i+2][0] == <span class="charliteral">'-'</span>)     \
        <span class="keywordflow">return</span> <span class="keyword">false</span>;                                    \
      std::stringstream tmp;                             \
      tmp &lt;&lt; argv[i+1] &lt;&lt; <span class="stringliteral">" "</span> &lt;&lt; argv[i+2];              \
      tmp &gt;&gt; VALUE1;                                     \
      tmp &gt;&gt; VALUE2;                                     \
      argc-=2;                                           \
      i+=2;                                              \
    }
</pre></div>
</div>
</div><p>
<hr size="1"><address style="align: right;"><small>Generated on Mon Dec 3 11:49:25 2007 for anytun by&nbsp;
<a href="http://www.doxygen.org/index.html">
<img src="doxygen.png" alt="doxygen" align="middle" border="0"></a> 1.5.1 </small></address>
</body>
</html>