Public Member Functions | Private Attributes | List of all members
CommandParser Class Reference

#include <command_parser.h>

Public Member Functions

void addCommand (const std::string &command, const std::string &value, std::vector< std::pair< std::string, std::string >> &m_command_vector)
 
int checkArgumentExist (std::map< std::string, struct Argument > &command_map, std::string &arg_error)
 
int checkMandatoryArguments (std::map< std::string, struct Argument > &command_map, std::string &arg_error)
 
int checkMandatoryPosition (std::map< std::string, struct Argument > &command_map, std::string &arg_error)
 
int checkValue (std::map< std::string, struct Argument > &command_map, std::string &arg_error)
 
 CommandParser ()=default
 
void getMandatoryArgs (const int &argc, const std::map< std::string, struct Argument > &command_map, std::vector< std::pair< std::string, int >> &arg_position)
 
bool hasEqual (const std::string &arg)
 
int helpMenu ()
 
bool isHelpArg (const std::string &arg)
 
bool nextArgIsCommand (const std::string &arg)
 
void parseArguments (int argc, char *argv[], std::map< std::string, struct Argument > command_map)
 
void processEqualArg (const std::string &arg, int &arg_number, const int &euqal_pos, std::vector< std::pair< std::string, std::string >> &m_command_vector)
 
void processFlag (const std::string &arg, int &arg_number, std::vector< std::pair< std::string, std::string >> &m_command_vector)
 
void processLongArg (const std::string &arg, int &arg_number, std::vector< std::pair< std::string, std::string >> &m_command_vector, const std::map< std::string, struct Argument > &command_map)
 
void processNonEqualArg (const std::string &arg, const std::string &value, int &arg_number, std::vector< std::pair< std::string, std::string >> &m_command_vector)
 
void processShorArg (const std::string &arg, int &arg_number, std::vector< std::pair< std::string, std::string >> &m_command_vector, const std::map< std::string, struct Argument > &command_map)
 
 ~CommandParser ()=default
 

Private Attributes

std::vector< std::pair< std::string, std::string > > m_command_vector
 

Detailed Description

Definition at line 37 of file command_parser.h.

Constructor & Destructor Documentation

◆ CommandParser()

CommandParser::CommandParser ( )
default

◆ ~CommandParser()

CommandParser::~CommandParser ( )
default

Member Function Documentation

◆ addCommand()

void CommandParser::addCommand ( const std::string command,
const std::string value,
std::vector< std::pair< std::string, std::string >> &  m_command_vector 
)

Definition at line 27 of file command_parser.cpp.

◆ checkArgumentExist()

int CommandParser::checkArgumentExist ( std::map< std::string, struct Argument > &  command_map,
std::string arg_error 
)

Definition at line 183 of file command_parser.cpp.

◆ checkMandatoryArguments()

int CommandParser::checkMandatoryArguments ( std::map< std::string, struct Argument > &  command_map,
std::string arg_error 
)

Definition at line 245 of file command_parser.cpp.

◆ checkMandatoryPosition()

int CommandParser::checkMandatoryPosition ( std::map< std::string, struct Argument > &  command_map,
std::string arg_error 
)

Definition at line 258 of file command_parser.cpp.

◆ checkValue()

int CommandParser::checkValue ( std::map< std::string, struct Argument > &  command_map,
std::string arg_error 
)

Definition at line 217 of file command_parser.cpp.

◆ getMandatoryArgs()

void CommandParser::getMandatoryArgs ( const int &  argc,
const std::map< std::string, struct Argument > &  command_map,
std::vector< std::pair< std::string, int >> &  arg_position 
)

Definition at line 33 of file command_parser.cpp.

◆ hasEqual()

bool CommandParser::hasEqual ( const std::string arg)

Definition at line 53 of file command_parser.cpp.

◆ helpMenu()

int CommandParser::helpMenu ( )

Definition at line 204 of file command_parser.cpp.

◆ isHelpArg()

bool CommandParser::isHelpArg ( const std::string arg)

Definition at line 48 of file command_parser.cpp.

◆ nextArgIsCommand()

bool CommandParser::nextArgIsCommand ( const std::string arg)

Definition at line 57 of file command_parser.cpp.

◆ parseArguments()

void CommandParser::parseArguments ( int  argc,
char *  argv[],
std::map< std::string, struct Argument command_map 
)

Definition at line 126 of file command_parser.cpp.

◆ processEqualArg()

void CommandParser::processEqualArg ( const std::string arg,
int &  arg_number,
const int &  euqal_pos,
std::vector< std::pair< std::string, std::string >> &  m_command_vector 
)

Definition at line 69 of file command_parser.cpp.

◆ processFlag()

void CommandParser::processFlag ( const std::string arg,
int &  arg_number,
std::vector< std::pair< std::string, std::string >> &  m_command_vector 
)

Definition at line 62 of file command_parser.cpp.

◆ processLongArg()

void CommandParser::processLongArg ( const std::string arg,
int &  arg_number,
std::vector< std::pair< std::string, std::string >> &  m_command_vector,
const std::map< std::string, struct Argument > &  command_map 
)

Definition at line 84 of file command_parser.cpp.

◆ processNonEqualArg()

void CommandParser::processNonEqualArg ( const std::string arg,
const std::string value,
int &  arg_number,
std::vector< std::pair< std::string, std::string >> &  m_command_vector 
)

Definition at line 77 of file command_parser.cpp.

◆ processShorArg()

void CommandParser::processShorArg ( const std::string arg,
int &  arg_number,
std::vector< std::pair< std::string, std::string >> &  m_command_vector,
const std::map< std::string, struct Argument > &  command_map 
)

Definition at line 108 of file command_parser.cpp.

Member Data Documentation

◆ m_command_vector

std::vector<std::pair<std::string, std::string> > CommandParser::m_command_vector
private

Definition at line 85 of file command_parser.h.


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


libaditof
Author(s):
autogenerated on Wed May 21 2025 02:07:05