Public Member Functions | Protected Attributes | List of all members
gnsstk::CommandOptionHelpSimple Class Reference

Detailed Description

This is a specific implementation of CommandOptionHelp for printing simple help text specified in the constructor.

Note
The help text must be preformatted, prettyPrint is not used by this class as there's no way of knowing what the preferred format is.

Definition at line 801 of file CommandOption.hpp.

#include <CommandOption.hpp>

Inheritance diagram for gnsstk::CommandOptionHelpSimple:
Inheritance graph
[legend]

Public Member Functions

 CommandOptionHelpSimple (const char shOpt, const std::string &loOpt, const std::string &desc, const std::string &help)
 
virtual void printHelp (std::ostream &out, bool pretty=true)
 
virtual ~CommandOptionHelpSimple ()
 Destructor. More...
 
- Public Member Functions inherited from gnsstk::CommandOptionHelp
 CommandOptionHelp (const CommandOption::CommandOptionFlag of, const char shOpt, const std::string &loOpt, const std::string &desc)
 
virtual ~CommandOptionHelp ()
 Destructor. More...
 
- Public Member Functions inherited from gnsstk::CommandOption
virtual std::string checkArguments ()
 
 CommandOption (const CommandOptionFlag of, const CommandOptionType ot, const char shOpt, const std::string &loOpt, const std::string &desc, const bool req=false, CommandOptionVec &optVectorList=defaultCommandOptionList)
 
std::ostream & dumpValue (std::ostream &out) const
 Displays this->value to the stream out. More...
 
virtual std::string getArgString () const
 Returns a string with the argument format. More...
 
virtual unsigned long getCount () const
 
std::string getDescription () const
 Returns a formatted string with the description of this option. More...
 
std::string getFullOptionString () const
 
virtual std::string getOptionString () const
 
unsigned long getOrder (unsigned long idx=-1) const
 
const std::vector< std::string > & getValue () const
 
void setDescription (const std::string &desc)
 
CommandOptionsetMaxCount (const unsigned long l)
 
struct option toGetoptLongOption () const
 Returns a struct option for use with getopt_long. More...
 
std::string toGetoptShortOption () const
 Returns a string for use with getopt. More...
 
virtual ~CommandOption ()
 Destructor. More...
 

Protected Attributes

std::string helpText
 
- Protected Attributes inherited from gnsstk::CommandOption
unsigned long count
 
std::string description
 The description for the help text. More...
 
std::string longOpt
 The string for the long option (for example, "--foo"). More...
 
unsigned long maxCount
 
CommandOptionFlag optFlag
 Flag for determining whether this option has an argument or not. More...
 
CommandOptionType optType
 
std::vector< unsigned long > order
 The order in which this option was encountered on the command line. More...
 
CommandOptionParserparser
 
bool required
 Whether or not this is a required command line option. More...
 
char shortOpt
 The character for the short option (for example, '-f'). More...
 
std::vector< std::string > value
 Any arguments passed with this option get put in here. More...
 

Additional Inherited Members

- Public Types inherited from gnsstk::CommandOption
enum  CommandOptionFlag { noArgument = 0, hasArgument = 1 }
 
enum  CommandOptionType { trailingType, stdType, metaType }
 
- Protected Member Functions inherited from gnsstk::CommandOption
 CommandOption ()
 Default Constructor. More...
 

Constructor & Destructor Documentation

◆ CommandOptionHelpSimple()

gnsstk::CommandOptionHelpSimple::CommandOptionHelpSimple ( const char  shOpt,
const std::string &  loOpt,
const std::string &  desc,
const std::string &  help 
)
inline

Constructor.

Parameters
[in]shOptThe one character command line option. Set to 0 if unused.
[in]loOptThe long command option. Set to std::string() if unused.
[in]descA string describing what this option does.
[in]helpThe help text to be printed when this option is used.

Definition at line 813 of file CommandOption.hpp.

◆ ~CommandOptionHelpSimple()

virtual gnsstk::CommandOptionHelpSimple::~CommandOptionHelpSimple ( )
inlinevirtual

Destructor.

Definition at line 822 of file CommandOption.hpp.

Member Function Documentation

◆ printHelp()

virtual void gnsstk::CommandOptionHelpSimple::printHelp ( std::ostream &  out,
bool  pretty = true 
)
inlinevirtual

Print command-line simple information.

Parameters
[in]outThe stream to which the help text will be printed.
[in]prettyIgnored.

Implements gnsstk::CommandOptionHelp.

Definition at line 826 of file CommandOption.hpp.

Member Data Documentation

◆ helpText

std::string gnsstk::CommandOptionHelpSimple::helpText
protected

Definition at line 831 of file CommandOption.hpp.


The documentation for this class was generated from the following file:


gnsstk
Author(s):
autogenerated on Wed Oct 25 2023 02:40:44