Lumiera  0.pre.03
»edit your freedom«
option.hpp
Go to the documentation of this file.
1 /*
2  OPTION.hpp - handle cmdline for starting the Lumiera application
3 
4  Copyright (C) Lumiera.org
5  2008, Hermann Vosseler <Ichthyostega@web.de>
6 
7  This program is free software; you can redistribute it and/or
8  modify it under the terms of the GNU General Public License as
9  published by the Free Software Foundation; either version 2 of
10  the License, or (at your option) any later version.
11 
12  This program is distributed in the hope that it will be useful,
13  but WITHOUT ANY WARRANTY; without even the implied warranty of
14  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15  GNU General Public License for more details.
16 
17  You should have received a copy of the GNU General Public License
18  along with this program; if not, write to the Free Software
19  Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
20 
21 */
22 
23 
46 #ifndef LUMIERA_OPTION_H
47 #define LUMIERA_OPTION_H
48 
49 #include "lib/nocopy.hpp"
50 #include "lib/cmdline.hpp"
51 #include "lib/format-cout.hpp"
52 
53 #include <string>
54 #include <boost/program_options.hpp>
55 #include <boost/utility.hpp>
56 
57 
58 
59 namespace lumiera {
60 
61  using std::string;
62  using std::ostream;
63  using lib::VectS;
64 
65 
66 
77  class Option
79  {
80  public:
81  Option (lib::Cmdline& cmdline);
82 
83  const string getSessName();
84  const VectS getScripts();
85  const VectS getConfigDefs();
86  int getPort();
87 
88  bool isOpenSession ();
89  bool isConfigDefs();
90  bool isHeadless();
91  bool isHelp();
92 
93 
94  private:
95  boost::program_options::options_description syntax;
96  boost::program_options::variables_map parameters;
97 
98  friend ostream& operator<< (ostream&, const Option&);
99  };
100 
101 
104  ostream& operator<< (ostream& os, const Option& to);
105 
106 
107 } // namespace lumiera
108 #endif
const VectS getConfigDefs()
Definition: option.cpp:134
Automatically use custom string conversion in C++ stream output.
bool isOpenSession()
should an existing session file be loaded?
Definition: option.cpp:109
Option(lib::Cmdline &cmdline)
set up an options parser to use the application commandline.
Definition: option.cpp:57
Any copy and copy construction prohibited.
Definition: nocopy.hpp:46
Frontend for handling the Lumiera application commandline arguments.
Definition: option.hpp:77
bool isHeadless()
Definition: option.cpp:141
Class to encapsulate the typical C-style commandline definition.
Mix-Ins to allow or prohibit various degrees of copying and cloning.
friend ostream & operator<<(ostream &, const Option &)
for outputting the help messages.
Definition: option.cpp:160
bool isHelp()
syntax help requested?
Definition: option.cpp:106
bool isConfigDefs()
additional Config defs to fed to config system?
Definition: option.cpp:112
const string getSessName()
Definition: option.cpp:117
Lumiera public interface.
Definition: advice.cpp:113
Abstraction of the usual int argc, int** argv-Commandline, to be able to treat it as a vector of stri...
Definition: cmdline.hpp:57
const VectS getScripts()
Definition: option.cpp:126