delpi
0.0.1
DElta-complete LP solver
Toggle main menu visibility
Loading...
Searching...
No Matches
ArgParser.h
1
7
#pragma once
8
9
#include <iosfwd>
10
#include <string>
11
12
// Argparse library is used to parse the command line arguments.
13
#include <argparse/argparse.hpp>
14
15
#include "delpi/util/Config.h"
16
17
namespace
delpi
{
18
26
class
ArgParser {
27
public
:
29
ArgParser();
35
void
Parse
(
int
argc,
const
char
**argv);
36
38
[[nodiscard]]
static
std::string version();
40
[[nodiscard]]
static
std::string repository_status();
42
[[nodiscard]] std::string prompt()
const
;
43
50
[[nodiscard]]
Config
ToConfig
()
const
;
51
59
template
<
class
T>
60
[[nodiscard]] T
get
(
const
std::string &key)
const
{
61
return
parser_
.get<T>(key);
62
}
63
64
private
:
65
friend
std::ostream &operator<<(std::ostream &os,
const
ArgParser
&parser);
66
68
void
AddOptions
();
69
75
void
ValidateOptions
();
76
77
argparse::ArgumentParser
parser_
;
78
const
std::string
qsoptex_hash_
;
79
const
std::string
soplex_hash_
;
80
int
verbosity_
;
81
};
82
83
}
// namespace delpi
delpi::ArgParser
Used to parse command line arguments and produce a corresponding Config object to be used throughout ...
Definition
ArgParser.h:26
delpi::ArgParser::qsoptex_hash_
const std::string qsoptex_hash_
The hash of the QSoptEx library. Used in the prompt.
Definition
ArgParser.h:78
delpi::ArgParser::Parse
void Parse(int argc, const char **argv)
Parse the command line arguments.
Definition
ArgParser.cpp:77
delpi::ArgParser::verbosity_
int verbosity_
Verbosity level of the program.
Definition
ArgParser.h:80
delpi::ArgParser::ToConfig
Config ToConfig() const
Convert the parser to a Config.
Definition
ArgParser.cpp:148
delpi::ArgParser::get
T get(const std::string &key) const
Get the value of a parameter from the internal parser.
Definition
ArgParser.h:60
delpi::ArgParser::soplex_hash_
const std::string soplex_hash_
The hash of the Soplex library. Used in the prompt.
Definition
ArgParser.h:79
delpi::ArgParser::ValidateOptions
void ValidateOptions()
Validate the options, ensuring the correctness of the parameters and the consistency of the options.
Definition
ArgParser.cpp:177
delpi::ArgParser::parser_
argparse::ArgumentParser parser_
The parser object.
Definition
ArgParser.h:77
delpi::ArgParser::AddOptions
void AddOptions()
Add all the options, positional arguments and flags to the parser.
Definition
ArgParser.cpp:92
delpi::Config
Simple dataclass used to store the configuration of the program.
Definition
Config.h:36
delpi
Global namespace for the delpi library.
delpi
util
ArgParser.h
Generated by
1.17.0