Go to the documentation of this file. 25 #ifndef __CLOCKUTILS_ARGPARSER_ARGUMENTPARSER_H__ 26 #define __CLOCKUTILS_ARGPARSER_ARGUMENTPARSER_H__ 40 #define PARSE_ARGUMENTS(buffer, length)\ 41 clockUtils::argParser::Parser::parseArguments(buffer, length) 48 #define PARSE_COMMANDLINE()\ 49 clockUtils::argParser::Parser::parseArguments(++argv, --argc) 54 #define GETLASTPARSERERROR()\ 55 clockUtils::argParser::Parser::getLastParserError() 63 #define REGISTER_VARIABLE_INTERNAL(type, longname, shortname, value, description, required, multiple)\ 65 std::string helpText = std::string("\t--") + std::string(#longname);\ 66 if (std::string(#shortname) != "\"\"") {\ 67 helpText += std::string(", -") + std::string(#shortname);\ 69 size_t length = helpText.length();\ 70 for (; length < 16; length++) {\ 73 helpText += std::string("[Default: ") + std::string(#value) + std::string("]");\ 74 helpText += std::string(std::max(0, int(15 - std::string(#value).length())), ' ');\ 75 helpText += std::string(description);\ 77 helpText += " (required)";\ 80 helpText += " (multiple)";\ 82 clockUtils::argParser::Parser::addHelpTextLine(std::make_pair(#longname, helpText));\ 84 clockUtils::argParser::Variable<type> longname(#longname, #shortname, description, value, required, multiple) 92 #define REGISTER_VARIABLE(type, longname, shortname, value, description) REGISTER_VARIABLE_INTERNAL(type, longname, shortname, value, description, false, false) 101 #define REGISTER_VARIABLE_REQUIRED(type, longname, shortname, value, description) REGISTER_VARIABLE_INTERNAL(type, longname, shortname, value, description, true, false) 110 #define REGISTER_VARIABLE_MULTIPLE(type, longname, shortname, value, description) REGISTER_VARIABLE_INTERNAL(type, longname, shortname, value, description, false, true) 120 #define REGISTER_VARIABLE_MULTIPLE_REQUIRED(type, longname, shortname, value, description) REGISTER_VARIABLE_INTERNAL(type, longname, shortname, value, description, true, true) 125 #define REGISTER_VARIABLE_ARGUMENTS(name)\ 126 clockUtils::argParser::ArgumentList name; 132 clockUtils::argParser::Parser::wasHelpSet() 137 #define GETHELPTEXT()\ 138 clockUtils::argParser::Parser::getHelpText()