Mir
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
default_configuration.h
Go to the documentation of this file.
1 /*
2  * Copyright © 2013-2014 Canonical Ltd.
3  *
4  * This program is free software: you can redistribute it and/or modify it
5  * under the terms of the GNU Lesser General Public License version 3,
6  * as published by the Free Software Foundation.
7  *
8  * This program is distributed in the hope that it will be useful,
9  * but WITHOUT ANY WARRANTY; without even the implied warranty of
10  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
11  * GNU Lesser General Public License for more details.
12  *
13  * You should have received a copy of the GNU Lesser General Public License
14  * along with this program. If not, see <http://www.gnu.org/licenses/>.
15  *
16  * Authored by: Alan Griffiths <alan@octopull.co.uk>
17  */
18 
19 #ifndef MIR_OPTIONS_DEFAULT_CONFIGURATION_H_
20 #define MIR_OPTIONS_DEFAULT_CONFIGURATION_H_
21 
23 
24 
25 namespace mir
26 {
27 namespace options
28 {
30 {
31 public:
32  DefaultConfiguration(int argc, char const* argv[]);
33  virtual ~DefaultConfiguration() = default;
34 
35  // add_options() allows users to add their own options. This MUST be called
36  // before the first invocation of the_options() - typically during initialization.
37  boost::program_options::options_description_easy_init add_options();
38 
39 private:
40  void add_platform_options();
41  // accessed via the base interface, when access to add_options() has been "lost"
42  std::shared_ptr<options::Option> the_options() const override;
43 
44  virtual void parse_arguments(
45  boost::program_options::options_description desc,
46  ProgramOption& options,
47  int argc,
48  char const* argv[]) const;
49 
50  virtual void parse_environment(
51  boost::program_options::options_description& desc,
52  ProgramOption& options) const;
53 
54  virtual void parse_config_file(
55  boost::program_options::options_description& desc,
56  ProgramOption& options) const;
57 
58  int const argc;
59  char const** const argv;
60  std::shared_ptr<boost::program_options::options_description> const program_options;
61  std::shared_ptr<Option> mutable options;
62 };
63 }
64 }
65 
66 #endif /* MIR_OPTIONS_DEFAULT_CONFIGURATION_H_ */
Definition: program_option.h:32
Definition: configuration.h:58
virtual ~DefaultConfiguration()=default
Definition: default_configuration.h:29
DefaultConfiguration(int argc, char const *argv[])
Definition: default_configuration.cpp:64
boost::program_options::options_description_easy_init add_options()
Definition: default_configuration.cpp:151

Copyright © 2012,2013 Canonical Ltd.
Generated on Fri Apr 11 21:14:53 UTC 2014