File: Poco.Util.Application.html

package info (click to toggle)
poco-doc 1.3.6-1
  • links: PTS
  • area: main
  • in suites: buster, jessie, jessie-kfreebsd, squeeze, stretch, wheezy
  • size: 10,076 kB
  • ctags: 9,611
  • sloc: makefile: 31
file content (350 lines) | stat: -rw-r--r-- 29,926 bytes parent folder | download | duplicates (2)
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
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<title>Class Poco::Util::Application</title>
<meta http-equiv="content-type" content="text/html; charset=utf-8"/>
<meta name="author" content="Applied Informatics Software Engineering GmbH and Contributors"/>
<meta name="publisher" content="Applied Informatics Software Engineering GmbH and Contributors"/>
<meta name="copyright" content="Copyright (c) 2009, Applied Informatics Software Engineering GmbH and Contributors"/>
<meta name="language" content="en"/>
<meta name="date" content="2009-11-24"/>
<meta name="generator" content="PocoDoc"/>
<link rel="stylesheet" href="css/styles.css" type="text/css"/>
</head>
<body bgcolor="#ffffff" leftmargin="0" topmargin="0">
<div class="header">
<h1 class="namespace"><a href="Poco.Util.html" class="namespace">Poco::Util</a></h1>
<h1 class="symbol">class Application</h1>
</div>
<div class="body">
<p>
<b>Library:</b> Util<br />
<b>Package:</b> Application<br />
<b>Header:</b> Poco/Util/Application.h</p>
<h2>Description</h2>
<div class="description">
<p>The <a href="Poco.Util.Application.html" title="class Poco::Util::Application">Application</a> class implements the main subsystem in a process. The application class is responsible for initializing all its subsystems. </p>
<p>Subclasses can and should override the following virtual methods: </p>
<ul>
<li><a href="Poco.Util.Application.html#16453" title="Poco::Util::Application::initialize()">initialize</a>() (the one-argument, protected variant) </li>
<li><a href="Poco.Util.Application.html#16455" title="Poco::Util::Application::uninitialize()">uninitialize</a>() </li>
<li><a href="Poco.Util.Application.html#16456" title="Poco::Util::Application::reinitialize()">reinitialize</a>() </li>
<li><a href="Poco.Util.Application.html#16458" title="Poco::Util::Application::defineOptions()">defineOptions</a>() </li>
<li><a href="Poco.Util.Application.html#16460" title="Poco::Util::Application::handleOption()">handleOption</a>() </li>
<li><a href="Poco.Util.Application.html#16465" title="Poco::Util::Application::main()">main</a>() </li>
</ul>
<p>The application's main logic should be implemented in the <a href="Poco.Util.Application.html#16465" title="Poco::Util::Application::main()">main</a>() method. </p>
<p>There may be at most one instance of the <a href="Poco.Util.Application.html" title="class Poco::Util::Application">Application</a> class in a process. </p>
<p>The <a href="Poco.Util.Application.html" title="class Poco::Util::Application">Application</a> class maintains a <a href="Poco.Util.LayeredConfiguration.html" title="class Poco::Util::LayeredConfiguration">LayeredConfiguration</a> (available via the <a href="Poco.Util.Application.html#16445" title="Poco::Util::Application::config()">config</a>() member function) consisting of: </p>
<ul>
<li>a <a href="Poco.Util.MapConfiguration.html" title="class Poco::Util::MapConfiguration">MapConfiguration</a> (priority -100) storing application-specific properties, as well as properties from bound command line arguments. </li>
<li>a <a href="Poco.Util.SystemConfiguration.html" title="class Poco::Util::SystemConfiguration">SystemConfiguration</a> (priority 100) </li>
<li>the configurations loaded with <a href="Poco.Util.Application.html#16437" title="Poco::Util::Application::loadConfiguration()">loadConfiguration</a>(). </li>
</ul>
<p>The <a href="Poco.Util.Application.html" title="class Poco::Util::Application">Application</a> class sets a few default properties in  its configuration. These are: </p>
<ul>
<li>application.path: the absolute path to application executable </li>
<li>application.name: the file name of the application executable </li>
<li>application.baseName: the file name (excluding extension) of the application executable </li>
<li>application.dir: the path to the directory where the application executable resides </li>
<li>application.configDir: the path to the directory where the last configuration file loaded with <a href="Poco.Util.Application.html#16437" title="Poco::Util::Application::loadConfiguration()">loadConfiguration</a>() was found. </li>
</ul>
<p>If <a href="Poco.Util.Application.html#16437" title="Poco::Util::Application::loadConfiguration()">loadConfiguration</a>() has never been called, application.configDir will be equal to application.dir. </p>
<p>The POCO_APP_MAIN macro can be used to implement <a href="Poco.Util.Application.html#16465" title="Poco::Util::Application::main()">main</a>(argc, argv). If POCO has been built with POCO_WIN32_UTF8, POCO_APP_MAIN supports <a href="Poco.Unicode.html" title="class Poco::Unicode">Unicode</a> command line arguments. </p>
</div>
<h2>Inheritance</h2>
<p><b>Direct Base Classes: </b><a href="Poco.Util.Subsystem.html" title="class Poco::Util::Subsystem">Subsystem</a></p>
<p><b>All Base Classes: </b><a href="Poco.RefCountedObject.html" title="class Poco::RefCountedObject">Poco::RefCountedObject</a>, <a href="Poco.Util.Subsystem.html" title="class Poco::Util::Subsystem">Subsystem</a></p>
<p><b>Known Derived Classes: </b><a href="Poco.Util.ServerApplication.html" title="class Poco::Util::ServerApplication">ServerApplication</a></p>
<h2>Member Summary</h2>
<p><b>Member Functions: </b><a href="Poco.Util.Application.html#16424" title="Poco::Util::Application::addSubsystem()">addSubsystem</a>, <a href="Poco.Util.Application.html#16444" title="Poco::Util::Application::commandName()">commandName</a>, <a href="Poco.Util.Application.html#16445" title="Poco::Util::Application::config()">config</a>, <a href="Poco.Util.Application.html#16458" title="Poco::Util::Application::defineOptions()">defineOptions</a>, <a href="Poco.Util.Application.html#16467" title="Poco::Util::Application::findFile()">findFile</a>, <a href="Poco.Util.Application.html#16442" title="Poco::Util::Application::getSubsystem()">getSubsystem</a>, <a href="Poco.Util.Application.html#16460" title="Poco::Util::Application::handleOption()">handleOption</a>, <a href="Poco.Util.Application.html#16426" title="Poco::Util::Application::init()">init</a>, <a href="Poco.Util.Application.html#16453" title="Poco::Util::Application::initialize()">initialize</a>, <a href="Poco.Util.Application.html#16434" title="Poco::Util::Application::initialized()">initialized</a>, <a href="Poco.Util.Application.html#16448" title="Poco::Util::Application::instance()">instance</a>, <a href="Poco.Util.Application.html#16437" title="Poco::Util::Application::loadConfiguration()">loadConfiguration</a>, <a href="Poco.Util.Application.html#16446" title="Poco::Util::Application::logger()">logger</a>, <a href="Poco.Util.Application.html#16465" title="Poco::Util::Application::main()">main</a>, <a href="Poco.Util.Application.html#16452" title="Poco::Util::Application::name()">name</a>, <a href="Poco.Util.Application.html#16447" title="Poco::Util::Application::options()">options</a>, <a href="Poco.Util.Application.html#16456" title="Poco::Util::Application::reinitialize()">reinitialize</a>, <a href="Poco.Util.Application.html#16443" title="Poco::Util::Application::run()">run</a>, <a href="Poco.Util.Application.html#16463" title="Poco::Util::Application::setLogger()">setLogger</a>, <a href="Poco.Util.Application.html#16435" title="Poco::Util::Application::setUnixOptions()">setUnixOptions</a>, <a href="Poco.Util.Application.html#16449" title="Poco::Util::Application::startTime()">startTime</a>, <a href="Poco.Util.Application.html#16451" title="Poco::Util::Application::stopOptionsProcessing()">stopOptionsProcessing</a>, <a href="Poco.Util.Application.html#16455" title="Poco::Util::Application::uninitialize()">uninitialize</a>, <a href="Poco.Util.Application.html#16450" title="Poco::Util::Application::uptime()">uptime</a></p>
<p><b>Inherited Functions: </b><a href="Poco.Util.Subsystem.html#17228" title="Poco::Util::Subsystem::defineOptions()">defineOptions</a>, <a href="Poco.RefCountedObject.html#9659" title="Poco::RefCountedObject::duplicate()">duplicate</a>, <a href="Poco.Util.Subsystem.html#17223" title="Poco::Util::Subsystem::initialize()">initialize</a>, <a href="Poco.Util.Subsystem.html#17222" title="Poco::Util::Subsystem::name()">name</a>, <a href="Poco.RefCountedObject.html#9661" title="Poco::RefCountedObject::referenceCount()">referenceCount</a>, <a href="Poco.Util.Subsystem.html#17226" title="Poco::Util::Subsystem::reinitialize()">reinitialize</a>, <a href="Poco.RefCountedObject.html#9660" title="Poco::RefCountedObject::release()">release</a>, <a href="Poco.Util.Subsystem.html#17225" title="Poco::Util::Subsystem::uninitialize()">uninitialize</a></p>
<h2>Enumerations</h2>
<h3><a name="16416">ConfigPriority</a></h3>
<div class="description">
<p></p>
</div>
<p class="decl"><a name="16417">PRIO_APPLICATION</a> = - 100</p>
<div class="description">
<p></p>
</div>
<p class="decl"><a name="16418">PRIO_DEFAULT</a> = 0</p>
<div class="description">
<p></p>
</div>
<p class="decl"><a name="16419">PRIO_SYSTEM</a> = 100</p>
<div class="description">
<p></p>
</div>
<h3><a name="16399">ExitCode</a></h3>
<div class="description">
<p>Commonly used exit status codes. Based on the definitions in the 4.3BSD &lt;sysexits.h&gt; header file. </p>
</div>
<p class="decl"><a name="16400">EXIT_OK</a> = 0</p>
<div class="description">
<p>successful termination </p>
</div>
<p class="decl"><a name="16401">EXIT_USAGE</a> = 64</p>
<div class="description">
<p>command line usage error </p>
</div>
<p class="decl"><a name="16402">EXIT_DATAERR</a> = 65</p>
<div class="description">
<p>data format error </p>
</div>
<p class="decl"><a name="16403">EXIT_NOINPUT</a> = 66</p>
<div class="description">
<p>cannot open input </p>
</div>
<p class="decl"><a name="16404">EXIT_NOUSER</a> = 67</p>
<div class="description">
<p>addressee unknown </p>
</div>
<p class="decl"><a name="16405">EXIT_NOHOST</a> = 68</p>
<div class="description">
<p>host name unknown </p>
</div>
<p class="decl"><a name="16406">EXIT_UNAVAILABLE</a> = 69</p>
<div class="description">
<p>service unavailable </p>
</div>
<p class="decl"><a name="16407">EXIT_SOFTWARE</a> = 70</p>
<div class="description">
<p>internal software error </p>
</div>
<p class="decl"><a name="16408">EXIT_OSERR</a> = 71</p>
<div class="description">
<p>system error (e.g., can't fork) </p>
</div>
<p class="decl"><a name="16409">EXIT_OSFILE</a> = 72</p>
<div class="description">
<p>critical OS file missing </p>
</div>
<p class="decl"><a name="16410">EXIT_CANTCREAT</a> = 73</p>
<div class="description">
<p>can't create (user) output file </p>
</div>
<p class="decl"><a name="16411">EXIT_IOERR</a> = 74</p>
<div class="description">
<p>input/output error </p>
</div>
<p class="decl"><a name="16412">EXIT_TEMPFAIL</a> = 75</p>
<div class="description">
<p>temp failure; user is invited to retry </p>
</div>
<p class="decl"><a name="16413">EXIT_PROTOCOL</a> = 76</p>
<div class="description">
<p>remote error in protocol </p>
</div>
<p class="decl"><a name="16414">EXIT_NOPERM</a> = 77</p>
<div class="description">
<p>permission denied </p>
</div>
<p class="decl"><a name="16415">EXIT_CONFIG</a> = 78</p>
<div class="description">
<p>configuration error </p>
</div>
<h2>Constructors</h2>
<h3><a name="16420">Application</a></h3>
<p class="decl"><a href="Poco.Util.Application.html" title="class Poco::Util::Application">Application</a>();</p>
<div class="description">
<p>Creates the <a href="Poco.Util.Application.html" title="class Poco::Util::Application">Application</a>. </p>
</div>
<h3><a name="16421">Application</a></h3>
<p class="decl"><a href="Poco.Util.Application.html" title="class Poco::Util::Application">Application</a>(<br />&nbsp;&nbsp;&nbsp;&nbsp;int argc,<br />&nbsp;&nbsp;&nbsp;&nbsp;char * argv[]<br />);</p>
<div class="description">
<p>Creates the <a href="Poco.Util.Application.html" title="class Poco::Util::Application">Application</a> and calls <a href="Poco.Util.Application.html#16426" title="Poco::Util::Application::init()">init</a>(argc, argv). </p>
</div>
<h2>Destructor</h2>
<h3><a name="16470">~Application</a> <img src="images/protected.gif" alt="protected" title="protected" style="vertical-align:baseline;" border="0" />  <img src="images/virtual.gif" alt="virtual" title="virtual" style="vertical-align:baseline;" border="0" /> </h3>
<p class="decl">~<a href="Poco.Util.Application.html" title="class Poco::Util::Application">Application</a>();</p>
<div class="description">
<p>Destroys the <a href="Poco.Util.Application.html" title="class Poco::Util::Application">Application</a> and deletes all registered subsystems. </p>
</div>
<h2>Member Functions</h2>
<h3><a name="16424">addSubsystem</a></h3>
<p class="decl">void addSubsystem(<br />&nbsp;&nbsp;&nbsp;&nbsp;<a href="Poco.Util.Subsystem.html" title="class Poco::Util::Subsystem">Subsystem</a> * pSubsystem<br />);</p>
<div class="description">
<p>Adds a new subsystem to the application. The application immediately takes ownership of it, so that a call in the form </p>
<pre>Application::instance().addSubsystem(new MySubsystem);
</pre>
<p>is okay. </p>
</div>
<h3><a name="16444">commandName</a></h3>
<p class="decl">std::string commandName() const;</p>
<div class="description">
<p>Returns the command name used to invoke the application. </p>
</div>
<h3><a name="16445">config</a> <img src="images/inline.gif" alt="inline" title="inline" style="vertical-align:baseline;" border="0" /> </h3>
<p class="decl"><a href="Poco.Util.LayeredConfiguration.html" title="class Poco::Util::LayeredConfiguration">LayeredConfiguration</a> &amp; config() const;</p>
<div class="description">
<p>Returns the application's configuration. </p>
</div>
<h3><a name="16442">getSubsystem</a> <img src="images/inline.gif" alt="inline" title="inline" style="vertical-align:baseline;" border="0" /> </h3>
<p class="decl">template &lt; class C &gt; C &amp; getSubsystem() const;</p>
<div class="description">
<p>Returns a reference to the subsystem of the class given as template argument. </p>
<p>Throws a <a href="Poco.NotFoundException.html" title="class Poco::NotFoundException">NotFoundException</a> if such a subsystem has not been registered. </p>
</div>
<h3><a name="16426">init</a></h3>
<p class="decl">void init(<br />&nbsp;&nbsp;&nbsp;&nbsp;int argc,<br />&nbsp;&nbsp;&nbsp;&nbsp;char * argv[]<br />);</p>
<div class="description">
<p>Initializes the application and all registered subsystems, using the given command line arguments. </p>
</div>
<h3><a name="16429">init</a></h3>
<p class="decl">void init(<br />&nbsp;&nbsp;&nbsp;&nbsp;int argc,<br />&nbsp;&nbsp;&nbsp;&nbsp;wchar_t * argv[]<br />);</p>
<div class="description">
<p>Initializes the application and all registered subsystems, using the given command line arguments. </p>
<p>This Windows-specific version of init is used for passing <a href="Poco.Unicode.html" title="class Poco::Unicode">Unicode</a> command line arguments from wmain(). </p>
</div>
<h3><a name="16432">init</a></h3>
<p class="decl">void init(<br />&nbsp;&nbsp;&nbsp;&nbsp;const std::vector &lt; std::string &gt; &amp; args<br />);</p>
<div class="description">
<p>Initializes the application and all registered subsystems, using the given command line arguments. </p>
</div>
<h3><a name="16434">initialized</a> <img src="images/inline.gif" alt="inline" title="inline" style="vertical-align:baseline;" border="0" /> </h3>
<p class="decl">bool initialized() const;</p>
<div class="description">
<p>Returns true if and only if the application is in initialized state (that means, has been initialized but not yet uninitialized). </p>
</div>
<h3><a name="16448">instance</a> <img src="images/static.gif" alt="static" title="static" style="vertical-align:baseline;" border="0" />  <img src="images/inline.gif" alt="inline" title="inline" style="vertical-align:baseline;" border="0" /> </h3>
<p class="decl">static <a href="Poco.Util.Application.html" title="class Poco::Util::Application">Application</a> &amp; instance();</p>
<div class="description">
<p>Returns a reference to the <a href="Poco.Util.Application.html" title="class Poco::Util::Application">Application</a> singleton. </p>
<p>Throws a <a href="Poco.NullPointerException.html" title="class Poco::NullPointerException">NullPointerException</a> if no <a href="Poco.Util.Application.html" title="class Poco::Util::Application">Application</a> instance exists. </p>
</div>
<h3><a name="16437">loadConfiguration</a></h3>
<p class="decl">int loadConfiguration(<br />&nbsp;&nbsp;&nbsp;&nbsp;int priority = PRIO_DEFAULT<br />);</p>
<div class="description">
<p>Loads configuration information from a default location. </p>
<p>The configuration(s) will be added to the application's  <a href="Poco.Util.LayeredConfiguration.html" title="class Poco::Util::LayeredConfiguration">LayeredConfiguration</a> with the given priority. </p>
<p>The configuration file(s) must be located in the same directory as the executable or a parent directory of it, and must have the  same base name as the executable, with one of the following extensions: .properties, .ini or .xml. </p>
<p>The .properties file, if it exists, is loaded first, followed by the .ini file and the .xml file. </p>
<p>If the application is built in debug mode (the _DEBUG preprocessor macro is defined) and the base name of the appication executable ends with a 'd', a config file without the 'd' ending its base name is  also found. </p>
<p>Example: Given the application &quot;SampleAppd.exe&quot;, built in debug mode. Then <a href="Poco.Util.Application.html#16437" title="Poco::Util::Application::loadConfiguration()">loadConfiguration</a>() will automatically find a configuration file named &quot;SampleApp.properties&quot; if it exists and if &quot;SampleAppd.properties&quot; cannot be found. </p>
<p>Returns the number of configuration files loaded, which may be zero. </p>
<p>This method must not be called before <a href="Poco.Util.Application.html#16453" title="Poco::Util::Application::initialize()">initialize</a>(argc, argv) has been called. </p>
</div>
<h3><a name="16439">loadConfiguration</a></h3>
<p class="decl">void loadConfiguration(<br />&nbsp;&nbsp;&nbsp;&nbsp;const std::string &amp; path,<br />&nbsp;&nbsp;&nbsp;&nbsp;int priority = PRIO_DEFAULT<br />);</p>
<div class="description">
<p>Loads configuration information from the file specified by the given path. The file type is determined by the file extension. The following extensions are supported: </p>
<ul>
<li>.properties - properties file (<a href="Poco.Util.PropertyFileConfiguration.html" title="class Poco::Util::PropertyFileConfiguration">PropertyFileConfiguration</a>) </li>
<li>.ini        - initialization file (<a href="Poco.Util.IniFileConfiguration.html" title="class Poco::Util::IniFileConfiguration">IniFileConfiguration</a>) </li>
<li>.xml        - <a href="Poco.XML.html" title="namespace Poco::XML">XML</a> file (<a href="Poco.Util.XMLConfiguration.html" title="class Poco::Util::XMLConfiguration">XMLConfiguration</a>) </li>
</ul>
<p>Extensions are not case sensitive. </p>
<p>The configuration will be added to the application's  <a href="Poco.Util.LayeredConfiguration.html" title="class Poco::Util::LayeredConfiguration">LayeredConfiguration</a> with the given priority. </p>
</div>
<h3><a name="16446">logger</a> <img src="images/inline.gif" alt="inline" title="inline" style="vertical-align:baseline;" border="0" /> </h3>
<p class="decl"><a href="Poco.Logger.html" title="class Poco::Logger">Poco::Logger</a> &amp; logger() const;</p>
<div class="description">
<p>Returns the application's logger. </p>
<p>Before the logging subsystem has been initialized, the application's logger is &quot;ApplicationStartup&quot;, which is connected to a <a href="Poco.ConsoleChannel.html" title="class Poco::ConsoleChannel">ConsoleChannel</a>. </p>
<p>After the logging subsystem has been initialized, which  usually happens as the first action in <a href="Poco.Util.Application.html#16453" title="Poco::Util::Application::initialize()">Application::initialize</a>(), the application's logger is the one specified by the &quot;application.logger&quot; configuration property. If that property is not specified, the logger is &quot;<a href="Poco.Util.Application.html" title="class Poco::Util::Application">Application</a>&quot;. </p>
</div>
<h3><a name="16452">name</a> <img src="images/virtual.gif" alt="virtual" title="virtual" style="vertical-align:baseline;" border="0" /> </h3>
<p class="decl">const char * name() const;</p>
<div class="description">
<p></p>
</div>
<div class="description"><p><b>See also:</b> <a href="Poco.Util.Subsystem.html#17222" title="Poco::Util::Subsystem::name()">Poco::Util::Subsystem::name()</a></p></div>
<h3><a name="16447">options</a> <img src="images/inline.gif" alt="inline" title="inline" style="vertical-align:baseline;" border="0" /> </h3>
<p class="decl">const <a href="Poco.Util.OptionSet.html" title="class Poco::Util::OptionSet">OptionSet</a> &amp; options() const;</p>
<div class="description">
<p>Returns the application's option set. </p>
</div>
<h3><a name="16443">run</a> <img src="images/virtual.gif" alt="virtual" title="virtual" style="vertical-align:baseline;" border="0" /> </h3>
<p class="decl">virtual int run();</p>
<div class="description">
<p>Runs the application by performing additional initializations and calling the <a href="Poco.Util.Application.html#16465" title="Poco::Util::Application::main()">main</a>() method. </p>
</div>
<h3><a name="16435">setUnixOptions</a></h3>
<p class="decl">void setUnixOptions(<br />&nbsp;&nbsp;&nbsp;&nbsp;bool flag<br />);</p>
<div class="description">
<p>Specify whether command line option handling is Unix-style (flag == true; default) or Windows/OpenVMS-style (flag == false). </p>
<p>This member function should be called from the constructor of a subclass to be effective. </p>
</div>
<h3><a name="16449">startTime</a> <img src="images/inline.gif" alt="inline" title="inline" style="vertical-align:baseline;" border="0" /> </h3>
<p class="decl">const <a href="Poco.Timestamp.html" title="class Poco::Timestamp">Poco::Timestamp</a> &amp; startTime() const;</p>
<div class="description">
<p>Returns the application start time (UTC). </p>
</div>
<h3><a name="16451">stopOptionsProcessing</a></h3>
<p class="decl">void stopOptionsProcessing();</p>
<div class="description">
<p>If called from an option callback, stops all further options processing. </p>
<p>If called, the following options on the command line will not be processed, and required options will not be checked. </p>
<p>This is useful, for example, if an option for displaying help information has been encountered and no other things besides displaying help shall be done. </p>
</div>
<h3><a name="16450">uptime</a> <img src="images/inline.gif" alt="inline" title="inline" style="vertical-align:baseline;" border="0" /> </h3>
<p class="decl"><a href="Poco.Timespan.html" title="class Poco::Timespan">Poco::Timespan</a> uptime() const;</p>
<div class="description">
<p>Returns the application uptime. </p>
</div>
<h3><a name="16458">defineOptions</a> <img src="images/protected.gif" alt="protected" title="protected" style="vertical-align:baseline;" border="0" />  <img src="images/virtual.gif" alt="virtual" title="virtual" style="vertical-align:baseline;" border="0" /> </h3>
<p class="decl">virtual void defineOptions(<br />&nbsp;&nbsp;&nbsp;&nbsp;<a href="Poco.Util.OptionSet.html" title="class Poco::Util::OptionSet">OptionSet</a> &amp; options<br />);</p>
<div class="description">
<p>Called before command line processing begins. If a subclass wants to support command line arguments, it must override this method. The default implementation does not define any options itself, but calls <a href="Poco.Util.Application.html#16458" title="Poco::Util::Application::defineOptions()">defineOptions</a>() on all registered subsystems. </p>
<p>Overriding implementations should call the base class implementation. </p>
</div>
<div class="description"><p><b>See also:</b> <a href="Poco.Util.Subsystem.html#17228" title="Poco::Util::Subsystem::defineOptions()">Poco::Util::Subsystem::defineOptions()</a></p></div>
<h3><a name="16467">findFile</a> <img src="images/protected.gif" alt="protected" title="protected" style="vertical-align:baseline;" border="0" /> </h3>
<p class="decl">bool findFile(<br />&nbsp;&nbsp;&nbsp;&nbsp;<a href="Poco.Path.html" title="class Poco::Path">Poco::Path</a> &amp; path<br />) const;</p>
<div class="description">
<p>Searches for the file in path in the application directory. </p>
<p>If path is absolute, the method immediately returns true and leaves path unchanged. </p>
<p>If path is relative, searches for the file in the application directory and in all subsequent parent directories. Returns true and stores the absolute path to the file in path if the file could be found. Returns false and leaves path unchanged otherwise. </p>
</div>
<h3><a name="16460">handleOption</a> <img src="images/protected.gif" alt="protected" title="protected" style="vertical-align:baseline;" border="0" />  <img src="images/virtual.gif" alt="virtual" title="virtual" style="vertical-align:baseline;" border="0" /> </h3>
<p class="decl">virtual void handleOption(<br />&nbsp;&nbsp;&nbsp;&nbsp;const std::string &amp; name,<br />&nbsp;&nbsp;&nbsp;&nbsp;const std::string &amp; value<br />);</p>
<div class="description">
<p>Called when the option with the given name is encountered during command line arguments processing. </p>
<p>The default implementation does option validation, bindings and callback handling. </p>
<p>Overriding implementations must call the base class implementation. </p>
</div>
<h3><a name="16469">init</a> <img src="images/protected.gif" alt="protected" title="protected" style="vertical-align:baseline;" border="0" /> </h3>
<p class="decl">void init();</p>
<div class="description">
<p>Common initialization code. </p>
</div>
<h3><a name="16453">initialize</a> <img src="images/protected.gif" alt="protected" title="protected" style="vertical-align:baseline;" border="0" />  <img src="images/virtual.gif" alt="virtual" title="virtual" style="vertical-align:baseline;" border="0" /> </h3>
<p class="decl">void initialize(<br />&nbsp;&nbsp;&nbsp;&nbsp;<a href="Poco.Util.Application.html" title="class Poco::Util::Application">Application</a> &amp; self<br />);</p>
<div class="description">
<p>Initializes the application and all registered subsystems. Subsystems are always initialized in the exact same order in which they have been registered. </p>
<p>Overriding implementations must call the base class implementation. </p>
</div>
<div class="description"><p><b>See also:</b> <a href="Poco.Util.Subsystem.html#17223" title="Poco::Util::Subsystem::initialize()">Poco::Util::Subsystem::initialize()</a></p></div>
<h3><a name="16465">main</a> <img src="images/protected.gif" alt="protected" title="protected" style="vertical-align:baseline;" border="0" />  <img src="images/virtual.gif" alt="virtual" title="virtual" style="vertical-align:baseline;" border="0" /> </h3>
<p class="decl">virtual int main(<br />&nbsp;&nbsp;&nbsp;&nbsp;const std::vector &lt; std::string &gt; &amp; args<br />);</p>
<div class="description">
<p>The application's main logic. </p>
<p>Unprocessed command line arguments are passed in args. Note that all original command line arguments are available via the properties application.argc and application.argv[&lt;n&gt;]. </p>
<p>Returns an exit code which should be one of the values from the <a href="Poco.Util.Application.html#16399" title="enum  Poco::Util::Application::ExitCode">ExitCode</a> enumeration. </p>
</div>
<h3><a name="16456">reinitialize</a> <img src="images/protected.gif" alt="protected" title="protected" style="vertical-align:baseline;" border="0" />  <img src="images/virtual.gif" alt="virtual" title="virtual" style="vertical-align:baseline;" border="0" /> </h3>
<p class="decl">void reinitialize(<br />&nbsp;&nbsp;&nbsp;&nbsp;<a href="Poco.Util.Application.html" title="class Poco::Util::Application">Application</a> &amp; self<br />);</p>
<div class="description">
<p>Re-nitializes the application and all registered subsystems. Subsystems are always reinitialized in the exact same order in which they have been registered. </p>
<p>Overriding implementations must call the base class implementation. </p>
</div>
<div class="description"><p><b>See also:</b> <a href="Poco.Util.Subsystem.html#17226" title="Poco::Util::Subsystem::reinitialize()">Poco::Util::Subsystem::reinitialize()</a></p></div>
<h3><a name="16463">setLogger</a> <img src="images/protected.gif" alt="protected" title="protected" style="vertical-align:baseline;" border="0" /> </h3>
<p class="decl">void setLogger(<br />&nbsp;&nbsp;&nbsp;&nbsp;<a href="Poco.Logger.html" title="class Poco::Logger">Poco::Logger</a> &amp; logger<br />);</p>
<div class="description">
<p>Sets the logger used by the application. </p>
</div>
<h3><a name="16455">uninitialize</a> <img src="images/protected.gif" alt="protected" title="protected" style="vertical-align:baseline;" border="0" />  <img src="images/virtual.gif" alt="virtual" title="virtual" style="vertical-align:baseline;" border="0" /> </h3>
<p class="decl">void uninitialize();</p>
<div class="description">
<p>Uninitializes the application and all registered subsystems. Subsystems are always uninitialized in reverse order in which they have been initialized.  </p>
<p>Overriding implementations must call the base class implementation. </p>
</div>
<div class="description"><p><b>See also:</b> <a href="Poco.Util.Subsystem.html#17225" title="Poco::Util::Subsystem::uninitialize()">Poco::Util::Subsystem::uninitialize()</a></p></div>
<p class="footer">POCO C++ Libraries 1.3.6-all<br />
Copyright &copy; 2009, <a href="http://pocoproject.org/" target="_blank">Applied Informatics Software Engineering GmbH and Contributors</a></p>

</div>
</body>
</html>