File: classmysqlpp_1_1CommandLineBase.html

package info (click to toggle)
mysql%2B%2B 3.1.0-2
  • links: PTS
  • area: main
  • in suites: wheezy
  • size: 11,640 kB
  • sloc: cpp: 35,569; sh: 3,113; makefile: 946; perl: 786
file content (205 lines) | stat: -rw-r--r-- 14,303 bytes parent folder | download
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
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
	<title>MySQL++ Reference Manual</title>
	<meta http-equiv="Content-type" content="text/html;charset=iso-8859-1">
	<link href="doxygen.css" rel="stylesheet" type="text/css">
	<link href="refman.css" rel="stylesheet" type="text/css">
</head>
<body>
<!-- Generated by Doxygen 1.4.7 -->
<div class="tabs">
  <ul>
    <li><a href="index.html"><span>Main&nbsp;Page</span></a></li>
    <li><a href="namespaces.html"><span>Namespaces</span></a></li>
    <li id="current"><a href="annotated.html"><span>Classes</span></a></li>
    <li><a href="files.html"><span>Files</span></a></li>
  </ul></div>
<div class="tabs">
  <ul>
    <li><a href="annotated.html"><span>Class&nbsp;List</span></a></li>
    <li><a href="hierarchy.html"><span>Class&nbsp;Hierarchy</span></a></li>
    <li><a href="functions.html"><span>Class&nbsp;Members</span></a></li>
  </ul></div>
<div class="nav">
<b>mysqlpp</b>::<a class="el" href="classmysqlpp_1_1CommandLineBase.html">CommandLineBase</a></div>
<h1>mysqlpp::CommandLineBase Class Reference</h1><!-- doxytag: class="mysqlpp::CommandLineBase" -->Parses command line arguments and holds the results.  
<a href="#_details">More...</a>
<p>
<code>#include &lt;<a class="el" href="cmdline_8h-source.html">cmdline.h</a>&gt;</code>
<p>
Inheritance diagram for mysqlpp::CommandLineBase:<p><center><img src="classmysqlpp_1_1CommandLineBase__inherit__graph.png" border="0" usemap="#mysqlpp_1_1CommandLineBase__inherit__map" alt="Inheritance graph"></center>
<map name="mysqlpp_1_1CommandLineBase__inherit__map">
<area href="classmysqlpp_1_1examples_1_1CommandLine.html" shape="rect" coords="5,81,259,105" alt="">
<area href="classmysqlpp_1_1ssqlsxlat_1_1CommandLine.html" shape="rect" coords="283,81,531,105" alt="">
</map>
<center><font size="2">[<a href="graph_legend.html">legend</a>]</font></center><a href="classmysqlpp_1_1CommandLineBase-members.html">List of all members.</a><table border="0" cellpadding="0" cellspacing="0">
<tr><td></td></tr>
<tr><td colspan="2"><br><h2>Public Types</h2></td></tr>
<tr><td class="memItemLeft" nowrap align="right" valign="top">typedef std::vector&lt; std::string &gt;&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="classmysqlpp_1_1CommandLineBase.html#e8de28354623bd1541425f512d46b23a">ArgumentList</a></td></tr>

<tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">Type for a list of arguments.  <a href="#e8de28354623bd1541425f512d46b23a"></a><br></td></tr>
<tr><td class="memItemLeft" nowrap align="right" valign="top"><a class="anchor" name="15d9a9ce39ed7da69ece62472905d4c5"></a><!-- doxytag: member="mysqlpp::CommandLineBase::ArgumentListIt" ref="15d9a9ce39ed7da69ece62472905d4c5" args="" -->
typedef ArgumentList::const_iterator&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="classmysqlpp_1_1CommandLineBase.html#15d9a9ce39ed7da69ece62472905d4c5">ArgumentListIt</a></td></tr>

<tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">Iterator into ArgumentList. <br></td></tr>
<tr><td colspan="2"><br><h2>Public Member Functions</h2></td></tr>
<tr><td class="memItemLeft" nowrap align="right" valign="top">const <a class="el" href="classmysqlpp_1_1CommandLineBase.html#e8de28354623bd1541425f512d46b23a">ArgumentList</a> &amp;&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="classmysqlpp_1_1CommandLineBase.html#ec314b5214f2eda4482e6597bff686db">extra_args</a> () const </td></tr>

<tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">Get reference to list of command line arguments past the last flag and its possible argument.  <a href="#ec314b5214f2eda4482e6597bff686db"></a><br></td></tr>
<tr><td class="memItemLeft" nowrap align="right" valign="top"><a class="anchor" name="46519033dcc6913eb3666a099e420707"></a><!-- doxytag: member="mysqlpp::CommandLineBase::operator void *" ref="46519033dcc6913eb3666a099e420707" args="() const " -->
&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="classmysqlpp_1_1CommandLineBase.html#46519033dcc6913eb3666a099e420707">operator void *</a> () const </td></tr>

<tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">Return truthy value if command line was parsed successfully. <br></td></tr>
<tr><td colspan="2"><br><h2>Protected Member Functions</h2></td></tr>
<tr><td class="memItemLeft" nowrap align="right" valign="top">&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="classmysqlpp_1_1CommandLineBase.html#36aff0ceccfb08be9b04717dc48ac706">CommandLineBase</a> (int argc, char *const argv[], const char *opts)</td></tr>

<tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">Hidden ctor to prevent instantiation.  <a href="#36aff0ceccfb08be9b04717dc48ac706"></a><br></td></tr>
<tr><td class="memItemLeft" nowrap align="right" valign="top"><a class="anchor" name="70bf4aaf7c80497bd36a51d2a31c87cd"></a><!-- doxytag: member="mysqlpp::CommandLineBase::~CommandLineBase" ref="70bf4aaf7c80497bd36a51d2a31c87cd" args="()" -->
virtual&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="classmysqlpp_1_1CommandLineBase.html#70bf4aaf7c80497bd36a51d2a31c87cd">~CommandLineBase</a> ()</td></tr>

<tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">Hidden dtor to prevent instantiation. <br></td></tr>
<tr><td class="memItemLeft" nowrap align="right" valign="top"><a class="anchor" name="2351077d0a931ee3ba9738464aaba0c6"></a><!-- doxytag: member="mysqlpp::CommandLineBase::finish_parse" ref="2351077d0a931ee3ba9738464aaba0c6" args="()" -->
void&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="classmysqlpp_1_1CommandLineBase.html#2351077d0a931ee3ba9738464aaba0c6">finish_parse</a> ()</td></tr>

<tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">If object is still marked as "successful", save non-option arguments to extra_args_ list. Subclass ctor should call this after the <a class="el" href="classmysqlpp_1_1CommandLineBase.html#201bef30e949e6046a8fdc0b76ba4706">parse_next()</a> loop gets EOF. <br></td></tr>
<tr><td class="memItemLeft" nowrap align="right" valign="top"><a class="anchor" name="4a1ab823448b70e726a8d87ad9abecc6"></a><!-- doxytag: member="mysqlpp::CommandLineBase::option_argument" ref="4a1ab823448b70e726a8d87ad9abecc6" args="() const " -->
const char *&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="classmysqlpp_1_1CommandLineBase.html#4a1ab823448b70e726a8d87ad9abecc6">option_argument</a> () const </td></tr>

<tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">Accessor for getopt()'s optarg global. <br></td></tr>
<tr><td class="memItemLeft" nowrap align="right" valign="top"><a class="anchor" name="7448a73de1dd102b85684c47fbfa2b29"></a><!-- doxytag: member="mysqlpp::CommandLineBase::option_index" ref="7448a73de1dd102b85684c47fbfa2b29" args="() const " -->
int&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="classmysqlpp_1_1CommandLineBase.html#7448a73de1dd102b85684c47fbfa2b29">option_index</a> () const </td></tr>

<tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">Accessor for getopt()'s optind global. <br></td></tr>
<tr><td class="memItemLeft" nowrap align="right" valign="top">void&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="classmysqlpp_1_1CommandLineBase.html#59476f73810f50528f0c6cc681ab998c">parse_error</a> (const char *message=0)</td></tr>

<tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">Called by a subclass when encountering a command line parsing error.  <a href="#59476f73810f50528f0c6cc681ab998c"></a><br></td></tr>
<tr><td class="memItemLeft" nowrap align="right" valign="top"><a class="anchor" name="201bef30e949e6046a8fdc0b76ba4706"></a><!-- doxytag: member="mysqlpp::CommandLineBase::parse_next" ref="201bef30e949e6046a8fdc0b76ba4706" args="() const " -->
int&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="classmysqlpp_1_1CommandLineBase.html#201bef30e949e6046a8fdc0b76ba4706">parse_next</a> () const </td></tr>

<tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">Wrapper for getopt(). <br></td></tr>
<tr><td class="memItemLeft" nowrap align="right" valign="top"><a class="anchor" name="5d620f5e364c55c813254aad693b08ec"></a><!-- doxytag: member="mysqlpp::CommandLineBase::print_usage" ref="5d620f5e364c55c813254aad693b08ec" args="() const =0" -->
virtual void&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="classmysqlpp_1_1CommandLineBase.html#5d620f5e364c55c813254aad693b08ec">print_usage</a> () const =0</td></tr>

<tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">Show a message explaining the program's proper usage. <br></td></tr>
<tr><td class="memItemLeft" nowrap align="right" valign="top"><a class="anchor" name="97f101de4fb19bb27378bc8522ecf0ca"></a><!-- doxytag: member="mysqlpp::CommandLineBase::program_name" ref="97f101de4fb19bb27378bc8522ecf0ca" args="() const " -->
const char *&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="classmysqlpp_1_1CommandLineBase.html#97f101de4fb19bb27378bc8522ecf0ca">program_name</a> () const </td></tr>

<tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">Get the file name of the program's executable. <br></td></tr>
<tr><td class="memItemLeft" nowrap align="right" valign="top"><a class="anchor" name="fc505818b7524537dbd7be0aedd0240c"></a><!-- doxytag: member="mysqlpp::CommandLineBase::successful" ref="fc505818b7524537dbd7be0aedd0240c" args="() const " -->
bool&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="classmysqlpp_1_1CommandLineBase.html#fc505818b7524537dbd7be0aedd0240c">successful</a> () const </td></tr>

<tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">Returns true if nothing has gone wrong since calling the ctor. <br></td></tr>
</table>
<hr><a name="_details"></a><h2>Detailed Description</h2>
Parses command line arguments and holds the results. 
<p>
This class just contains common functionality and data structures; instantiable subclasses follow. 
<p>
<hr><h2>Member Typedef Documentation</h2>
<a class="anchor" name="e8de28354623bd1541425f512d46b23a"></a><!-- doxytag: member="mysqlpp::CommandLineBase::ArgumentList" ref="e8de28354623bd1541425f512d46b23a" args="" -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">typedef std::vector&lt;std::string&gt; <a class="el" href="classmysqlpp_1_1CommandLineBase.html#e8de28354623bd1541425f512d46b23a">mysqlpp::CommandLineBase::ArgumentList</a>          </td>
        </tr>
      </table>
</div>
<div class="memdoc">

<p>
Type for a list of arguments. 
<p>
Public types 
</div>
</div><p>
<hr><h2>Constructor &amp; Destructor Documentation</h2>
<a class="anchor" name="36aff0ceccfb08be9b04717dc48ac706"></a><!-- doxytag: member="mysqlpp::CommandLineBase::CommandLineBase" ref="36aff0ceccfb08be9b04717dc48ac706" args="(int argc, char *const argv[], const char *opts)" -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">mysqlpp::CommandLineBase::CommandLineBase           </td>
          <td>(</td>
          <td class="paramtype">int&nbsp;</td>
          <td class="paramname"> <em>argc</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">char *const &nbsp;</td>
          <td class="paramname"> <em>argv</em>[], </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">const char *&nbsp;</td>
          <td class="paramname"> <em>opts</em></td><td>&nbsp;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td><td width="100%"><code> [inline, protected]</code></td>
        </tr>
      </table>
</div>
<div class="memdoc">

<p>
Hidden ctor to prevent instantiation. 
<p>
Subclass interface 
</div>
</div><p>
<hr><h2>Member Function Documentation</h2>
<a class="anchor" name="ec314b5214f2eda4482e6597bff686db"></a><!-- doxytag: member="mysqlpp::CommandLineBase::extra_args" ref="ec314b5214f2eda4482e6597bff686db" args="() const " -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">const <a class="el" href="classmysqlpp_1_1CommandLineBase.html#e8de28354623bd1541425f512d46b23a">ArgumentList</a>&amp; mysqlpp::CommandLineBase::extra_args           </td>
          <td>(</td>
          <td class="paramname">          </td>
          <td>&nbsp;)&nbsp;</td>
          <td width="100%"> const<code> [inline]</code></td>
        </tr>
      </table>
</div>
<div class="memdoc">

<p>
Get reference to list of command line arguments past the last flag and its possible argument. 
<p>
Public interface 
</div>
</div><p>
<a class="anchor" name="59476f73810f50528f0c6cc681ab998c"></a><!-- doxytag: member="mysqlpp::CommandLineBase::parse_error" ref="59476f73810f50528f0c6cc681ab998c" args="(const char *message=0)" -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">void mysqlpp::CommandLineBase::parse_error           </td>
          <td>(</td>
          <td class="paramtype">const char *&nbsp;</td>
          <td class="paramname"> <em>message</em> = <code>0</code>          </td>
          <td>&nbsp;)&nbsp;</td>
          <td width="100%"><code> [protected]</code></td>
        </tr>
      </table>
</div>
<div class="memdoc">

<p>
Called by a subclass when encountering a command line parsing error. 
<p>
Prints the passed message, calls subclass's <a class="el" href="classmysqlpp_1_1CommandLineBase.html#5d620f5e364c55c813254aad693b08ec">print_usage()</a>, and marks the object as no longer successful. 
</div>
</div><p>
<hr>The documentation for this class was generated from the following files:<ul>
<li><a class="el" href="cmdline_8h-source.html">cmdline.h</a><li>cmdline.cpp</ul>
<hr size="1"><address style="align: right;"><small>Generated on Thu Jun 3 11:59:12 2010 for MySQL++ by&nbsp;
<a href="http://www.doxygen.org/index.html">
<img src="doxygen.png" alt="doxygen" align="middle" border="0"></a> 1.4.7 </small></address>
</body>
</html>