lumiera_/src/common/option.hpp

86 lines
2.3 KiB
C++
Raw Normal View History

2008-11-30 21:00:20 +01:00
/*
OPTION.hpp - handle cmdline for starting the Lumiera application
2010-12-17 23:28:49 +01:00
2008-11-30 21:00:20 +01:00
Copyright (C) Lumiera.org
2008, Hermann Vosseler <Ichthyostega@web.de>
2010-12-17 23:28:49 +01:00
2008-11-30 21:00:20 +01:00
This program is free software; you can redistribute it and/or
modify it under the terms of the GNU General Public License as
2010-12-17 23:28:49 +01:00
published by the Free Software Foundation; either version 2 of
the License, or (at your option) any later version.
2008-11-30 21:00:20 +01:00
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
2010-12-17 23:28:49 +01:00
2008-11-30 21:00:20 +01:00
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
2010-12-17 23:28:49 +01:00
2008-11-30 21:00:20 +01:00
*/
#ifndef LUMIERA_OPTION_H
#define LUMIERA_OPTION_H
#include "lib/cmdline.hpp"
#include "lib/format-cout.hpp"
2008-11-30 21:00:20 +01:00
#include <string>
#include <boost/program_options.hpp>
#include <boost/utility.hpp>
namespace lumiera {
using std::string;
using std::ostream;
using lib::VectS;
2008-11-30 21:00:20 +01:00
/**
* Frontend for handling the Lumiera application
* commandline arguments. A preconfigured wrapper
2008-11-30 21:00:20 +01:00
* around boost::program_options, with the ability
* to tolerate unknown options. The commandline
* to be parsed is taken wrapped into a Cmdline
* instance; after parsing this commandline
* vector will contain only the remaining
* unrecognised parts.
*/
class Option
: boost::noncopyable
2008-11-30 21:00:20 +01:00
{
public:
Option (lib::Cmdline& cmdline);
const string getSessName();
const VectS getScripts();
const VectS getConfigDefs();
int getPort();
bool isOpenSession ();
bool isConfigDefs();
bool isHeadless();
bool isHelp();
2008-11-30 21:00:20 +01:00
private:
boost::program_options::options_description syntax;
boost::program_options::variables_map parameters;
2008-12-01 05:35:19 +01:00
friend ostream& operator<< (ostream&, const Option&);
2008-11-30 21:00:20 +01:00
};
/** for outputting the help messages. Forward accumulated
* help messages from all contained option definitions */
2008-12-01 05:35:19 +01:00
ostream& operator<< (ostream& os, const Option& to);
2008-11-30 21:00:20 +01:00
} // namespace lumiera
#endif