21 #ifndef G_MAIN_COMMAND_LINE_H
22 #define G_MAIN_COMMAND_LINE_H
36 class CommandLineImp ;
47 static std::string
switchSpec(
bool is_windows ) ;
51 const std::string & version ,
const std::string & capabilities ) ;
60 bool contains(
const std::string & switch_ )
const ;
63 bool contains(
const char * switch_ )
const ;
66 std::string
value(
const std::string & switch_ )
const ;
69 std::string
value(
const char * switch_ )
const ;
72 unsigned int value(
const std::string & switch_ ,
unsigned int default_ )
const ;
75 unsigned int value(
const char * switch_ ,
unsigned int default_ )
const ;
78 G::Strings value(
const std::string & switch_ ,
const std::string & separators )
const ;
81 G::Strings value(
const char * switch_ ,
const char * separators )
const ;
93 void showHelp(
bool error_stream =
false )
const ;
108 void showNoop(
bool error_stream =
false )
const ;
111 void showError(
const std::string & reason ,
bool error_stream =
true )
const ;
114 void showVersion(
bool error_stream =
false )
const ;
117 void showBanner(
bool error_stream =
false ,
const std::string & = std::string() )
const ;
120 void showCopyright(
bool error_stream =
false ,
const std::string & = std::string() )
const ;
123 void showCapabilities(
bool error_stream =
false ,
const std::string & = std::string() )
const ;
Application-level classes.
void showCopyright(bool error_stream=false, const std::string &=std::string()) const
Writes a copyright message.
Configuration cfg() const
Returns a Configuration object.
std::list< std::string > Strings
A std::list of std::strings.
void showCapabilities(bool error_stream=false, const std::string &=std::string()) const
Writes a capability line.
void showError(const std::string &reason, bool error_stream=true) const
Writes a failed message.
A private implementation class used by Main::CommandLine.
CommandLine(Main::Output &output, const G::Arg &arg, const std::string &spec, const std::string &version, const std::string &capabilities)
Constructor.
~CommandLine()
Destructor.
void showBanner(bool error_stream=false, const std::string &=std::string()) const
Writes a startup banner.
An abstract interface for generating output on a command-line or a GUI.
void logSemanticWarnings() const
Emits warnings about conflicting switches.
bool hasSemanticError() const
Returns true if the command line has logical errors (eg. conflicting switches).
void showArgcError(bool error_stream=true) const
Writes a too-many-arguments error message.
std::string value(const std::string &switch_) const
Returns the given switch's string value.
bool contains(const std::string &switch_) const
Returns true if the command line contained the give switch.
A class which deals with the command-line interface to the process, both input and output...
void showVersion(bool error_stream=false) const
Writes the version number.
bool hasUsageErrors() const
Returns true if the command line has usage errors (eg. invalid switch).
void showUsageErrors(bool error_stream=true) const
Writes the usage errors.
A class which holds a represention of the argc/argv command line array, and supports simple command-l...
void showHelp(bool error_stream=false) const
Writes help text.
void showNoop(bool error_stream=false) const
Writes a nothing-to-do message.
An interface for returning application configuration information.
static std::string switchSpec(bool is_windows)
Returns an o/s-specific G::GetOpt switch specification string.
void showSemanticError(bool error_stream=true) const
Writes the logic errors.
G::Arg::size_type argc() const
Returns the number of non-switch arguments on the command line.