26 #ifndef COMMAND_LINE_ARG_PARSER_H
27 #define COMMAND_LINE_ARG_PARSER_H
30 class CCommandLineArgParser;
33 #include <argos3/core/utility/datatypes/datatypes.h>
34 #include <argos3/core/utility/string_utilities.h>
35 #include <argos3/core/utility/logging/argos_log.h>
112 const std::string& str_long_option,
113 const std::string& str_description,
115 m_vecArguments.push_back(
133 const std::string& str_long_option,
134 const std::string& str_description,
136 m_vecArguments.push_back(
163 void ParseLongOption (
SInt32 n_argc,
char** ppch_argv);
164 void ParseShortOption (
SInt32 n_argc,
char** ppch_argv);
165 void ParseShortOptions(
SInt32 n_argc,
char** ppch_argv);
169 class CAbstractArgument {
173 virtual ~CAbstractArgument() {}
174 virtual void Parse(
const std::string& str_value) = 0;
179 std::string LongOption;
180 std::string Description;
185 template <
typename T>
class CArgument :
public CAbstractArgument {
189 CArgument(
char ch_short_option,
190 const std::string& str_long_option,
191 const std::string& str_description,
194 m_tBuffer(t_buffer) {
195 ShortOption = ch_short_option;
196 LongOption = str_long_option;
197 Description = str_description;
201 virtual void Parse(
const std::string& str_value) {
202 m_tBuffer = FromString<T>(str_value);
210 std::vector<CAbstractArgument*> m_vecArguments;
211 SInt32 m_nCurrentArgument;