34 int print(std::ostream &stream)
const {
58 s +=
"no description";
125 for(
int i = 0; i < argc; i++) {
127 if((std::string(argv[i]) ==
"-h")
128 || (std::string(argv[i]) ==
"--help")) {
132 for(
int j = 0; j < (int)
arguments_.size(); j++) {
135 if((std::string(argv[i]) ==
"-" +
arguments_[j].key_)
143 arguments_[j].stringValueList_->push_back(argv[i + 1]);
146 std::stringstream s(argv[i + 1]);
150 std::stringstream s(argv[i + 1]);
156 std::stringstream s(argv[i + 1]);
160 std::stringstream s(argv[i + 1]);
168 if(std::string(argv[i]) ==
"-" +
arguments_[j].key_) {
176 for(
int i = 0; i < (int)
arguments_.size(); i++) {
198 for(
int i = 0; i < (int)
arguments_.size(); i++) {
223 for(
int j = 0; j < (int)
arguments_[i].stringValueList_->size();
233 s += std::to_string(*(
arguments_[i].intValue_));
239 for(
int j = 0; j < (int)
arguments_[i].intValueList_->size(); j++) {
240 s += std::to_string((*(
arguments_[i].intValueList_))[j]);
248 s += std::to_string(*(
arguments_[i].doubleValue_));
254 for(
int j = 0; j < (int)
arguments_[i].doubleValueList_->size();
256 s += std::to_string((*(
arguments_[i].doubleValueList_))[j]);
278 for(
int i = 0; i < (int)
arguments_.size(); i++) {
286 for(
int i = 0; i < (int)
arguments_.size(); i++) {
298 const std::string &description =
"") {
315 const std::string &description =
"",
316 const bool &optional =
false) {
332 std::vector<double> *value,
333 const std::string &description =
"",
334 const bool &optional =
false) {
351 const std::string &description =
"",
352 const bool &optional =
false) {
368 std::vector<int> *value,
369 const std::string &description =
"",
370 const bool &optional =
false) {
387 const std::string &description =
"",
388 const bool &optional =
false) {
404 std::vector<std::string> *value,
405 const std::string &description =
"",
406 const bool &optional =
false) {
int print(std::ostream &stream) const
std::vector< int > * intValueList_
std::string * stringValue_
std::vector< double > * doubleValueList_
std::vector< std::string > * stringValueList_
Basic command line parsing.
int printArgs(std::ostream &o=std::cout) const
int setArgument(const std::string &key, std::string *value, const std::string &description="", const bool &optional=false)
int parse(int argc, char **argv)
std::vector< CommandLineArgument > arguments_
int printUsage(const std::string &binPath) const
int setArgument(const std::string &key, std::vector< double > *value, const std::string &description="", const bool &optional=false)
int setArgument(const std::string &key, std::vector< int > *value, const std::string &description="", const bool &optional=false)
int setArgument(const std::string &key, std::vector< std::string > *value, const std::string &description="", const bool &optional=false)
~CommandLineParser() override=default
int setArgument(const std::string &key, double *value, const std::string &description="", const bool &optional=false)
int setOption(const std::string &key, bool *value, const std::string &description="")
int setArgument(const std::string &key, int *value, const std::string &description="", const bool &optional=false)
Minimalist debugging class.
void setDebugMsgPrefix(const std::string &prefix)
virtual int setDebugLevel(const int &debugLevel)
COMMON_EXPORTS int globalThreadNumber_
COMMON_EXPORTS int globalDebugLevel_
printMsg(debug::output::BOLD+" | | | | | . \\ | | (__| | / __/| |_| / __/|__ _|"+debug::output::ENDCOLOR, debug::Priority::PERFORMANCE, debug::LineMode::NEW, stream)