#include <Argx.hpp>
Public Member Functions | |
Argx () | |
Argx (const std::string &id, int argc, char *argv[]) | |
Create Argx with the specific id , argc and argv | |
~Argx () | |
void | add (ARGXOptions option) const |
Add param options. | |
bool | compareArgs (std::vector< ARGXOptions > options, std::vector< std::string > argv) |
Compare if options contains the required id , if the ID does not exist, return false. | |
std::string | createDocs (ARGXStyle style, const std::string &title, const std::string &mainInfo) |
Create documentation for the parameters with the specific style, title and main information. | |
int | findParam (const std::string &id) |
Find parameter index. | |
int | getArgc () const |
Get the main options from the main() function as argc. | |
std::string | getID () const |
Get Argx ID. | |
std::vector< std::string > | getMainArgs () const |
Get main arguments from main() function argv | |
std::vector< ARGXOptions > | getOptions () const |
Get main set options as ARGXOptions. | |
ARGXParam | getParam (const std::string &id) |
Get the param from id | |
bool | getSubParam (const argx::ARGXParam ¶m, const std::string &id) |
Get the sub-param from id | |
bool | paramExists (const std::string &id) |
Get if param exists in the param options. | |
Private Attributes | |
std::string | id |
Static Private Attributes | |
static unsigned int | mainArgc |
static std::vector< std::string > * | mainArgs = nullptr |
static std::vector< ARGXOptions > | options |
argx::Argx::Argx | ( | const std::string & | id, |
int | argc, | ||
char * | argv[] ) |
argx::Argx::~Argx | ( | ) |
void argx::Argx::add | ( | ARGXOptions | option | ) | const |
bool argx::Argx::compareArgs | ( | std::vector< ARGXOptions > | options, |
std::vector< std::string > | argv ) |
Compare if options
contains the required id
, if the ID does not exist, return false.
options | Return ARGXOptions vector |
id | ID to find |
Definition at line 293 of file Argx.cpp.
References options.
std::string argx::Argx::createDocs | ( | ARGXStyle | style, |
const std::string & | title, | ||
const std::string & | mainInfo ) |
Create documentation for the parameters with the specific style, title and main information.
style | Set the style using ARGXStyle |
title | Title for docs |
Main | information |
Definition at line 225 of file Argx.cpp.
References options, argx::Professional, and argx::Simple.
int argx::Argx::findParam | ( | const std::string & | id | ) |
Find parameter index.
Definition at line 48 of file Argx.cpp.
References mainArgs, and options.
Referenced by getSubParam(), and paramExists().
int argx::Argx::getArgc | ( | ) | const |
std::string argx::Argx::getID | ( | ) | const |
std::vector< std::string > argx::Argx::getMainArgs | ( | ) | const |
std::vector< ARGXOptions > argx::Argx::getOptions | ( | ) | const |
Get main set options as ARGXOptions.
Definition at line 323 of file Argx.cpp.
References options.
ARGXParam argx::Argx::getParam | ( | const std::string & | id | ) |
Get the param from id
id | The ID to get |
Definition at line 103 of file Argx.cpp.
References argx::ARGXParam::exists, mainArgc, mainArgs, options, and argx::ARGXParam::subExists.
bool argx::Argx::getSubParam | ( | const argx::ARGXParam & | param, |
const std::string & | id ) |
Get the sub-param from id
param | Original param |
id | The ID to get |
Definition at line 222 of file Argx.cpp.
References findParam(), paramExists(), and argx::ARGXParam::subExists.
bool argx::Argx::paramExists | ( | const std::string & | id | ) |
Get if param exists in the param options.
id | ID to get |
Definition at line 94 of file Argx.cpp.
References findParam().
Referenced by getSubParam().
|
private |
|
staticprivate |
Definition at line 25 of file Argx.hpp.
Referenced by Argx(), getArgc(), and getParam().
|
staticprivate |
Definition at line 23 of file Argx.hpp.
Referenced by Argx(), ~Argx(), findParam(), getMainArgs(), and getParam().
|
staticprivate |
Definition at line 22 of file Argx.hpp.
Referenced by add(), compareArgs(), createDocs(), findParam(), getOptions(), and getParam().