argos_command_line_arg_parser.h
Go to the documentation of this file.
1 
7 #ifndef ARGOS_COMMAND_LINE_ARG_PARSER_H
8 #define ARGOS_COMMAND_LINE_ARG_PARSER_H
9 
10 namespace argos {
11  class CARGoSCommandLineArgParser;
12 }
13 
14 #include <argos3/core/utility/configuration/command_line_arg_parser.h>
15 #include <fstream>
16 
17 namespace argos {
18 
26 
27  public:
28 
32  enum EAction {
38  };
39 
40  public:
41 
46 
51 
59  virtual void PrintUsage(CARGoSLog& c_log);
60 
64  virtual void PrintVersion();
65 
79  virtual void Parse(SInt32 n_argc,
80  char** ppch_argv);
81 
87  inline EAction GetAction() {
88  return m_eAction;
89  }
90 
97  inline const std::string& GetExperimentConfigFile() {
98  return m_strExperimentConfigFile;
99  }
100 
107  inline const std::string& GetQuery() {
108  return m_strQuery;
109  }
110 
118  inline bool IsLogColored() {
119  return ! m_bNonColoredLog;
120  }
121 
128  inline bool IsHelpWanted() {
129  return m_bHelpWanted;
130  }
131 
132  private:
133 
134  EAction m_eAction;
135  std::string m_strExperimentConfigFile;
136  std::string m_strQuery;
137  std::string m_strLogFileName;
138  std::ofstream m_cLogFile;
139  std::streambuf* m_pcInitLogStream;
140  std::string m_strLogErrFileName;
141  std::ofstream m_cLogErrFile;
142  std::streambuf* m_pcInitLogErrStream;
143  bool m_bNonColoredLog;
144  bool m_bHelpWanted;
145  bool m_bVersionWanted;
146 
147  };
148 
149 }
150 
151 #endif
signed int SInt32
32-bit signed integer.
Definition: datatypes.h:93
The namespace containing all the ARGoS related code.
Definition: ci_actuator.h:12
The command line argument parser used by the main ARGoS executable.
virtual void Parse(SInt32 n_argc, char **ppch_argv)
Parses the command line.
EAction GetAction()
Returns the action parsed by Parse().
bool IsLogColored()
Returns true if color is enabled for LOG and LOGERR.
bool IsHelpWanted()
Returns true if color if a help message must be displayed.
EAction
The possible actions that can be done.
virtual ~CARGoSCommandLineArgParser()
Class destructor.
const std::string & GetExperimentConfigFile()
Returns the experiment configuration file as parsed by Parse().
virtual void PrintVersion()
Prints the current ARGoS version and release.
virtual void PrintUsage(CARGoSLog &c_log)
Prints usage information to the wanted log.
const std::string & GetQuery()
Returns the query on the plugins as parsed by Parse().
Easy-to-use command line argument parser.