schroot-base-options.h
Go to the documentation of this file.00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019 #ifndef SCHROOT_BASE_OPTIONS_H
00020 #define SCHROOT_BASE_OPTIONS_H
00021
00022 #include <sbuild/sbuild-session.h>
00023 #include <sbuild/sbuild-types.h>
00024
00025 #include <schroot-base/schroot-base-option-action.h>
00026
00027 #include <string>
00028
00029 #ifdef HAVE_TR1_MEMORY
00030 #include <tr1/memory>
00031 #elif HAVE_BOOST_SHARED_PTR_HPP
00032 #include <boost/shared_ptr.hpp>
00033 namespace std { namespace tr1 { using boost::shared_ptr; } }
00034 #else
00035 #error A shared_ptr implementation is not available
00036 #endif
00037
00038 #include <boost/program_options.hpp>
00039
00040 namespace schroot_base
00041 {
00042
00049 class options
00050 {
00051 public:
00053 typedef std::tr1::shared_ptr<options> ptr;
00054 typedef option_action::action_type action_type;
00055
00057 options ();
00058
00060 virtual ~options ();
00061
00068 void
00069 parse (int argc,
00070 char *argv[]);
00071
00073 static const action_type ACTION_HELP;
00075 static const action_type ACTION_VERSION;
00076
00078 option_action action;
00079
00081 bool quiet;
00083 bool verbose;
00084
00091 boost::program_options::options_description const&
00092 get_visible_options() const;
00093
00094 protected:
00098 virtual void
00099 add_options ();
00100
00104 virtual void
00105 add_option_groups ();
00106
00110 virtual void
00111 check_options ();
00112
00116 virtual void
00117 check_actions ();
00118
00120 boost::program_options::options_description actions;
00122 boost::program_options::options_description general;
00124 boost::program_options::options_description hidden;
00126 boost::program_options::positional_options_description positional;
00128 boost::program_options::options_description visible;
00130 boost::program_options::options_description global;
00132 boost::program_options::variables_map vm;
00133
00134 private:
00136 std::string debug_level;
00137 };
00138
00139 }
00140
00141 #endif
00142
00143
00144
00145
00146
00147
00148