initial version

This commit is contained in:
2024-06-30 17:47:05 +02:00
commit 15144ca608
54 changed files with 2512 additions and 0 deletions

36
src/CLIParser.h Normal file
View File

@@ -0,0 +1,36 @@
/*
* Copyright (c) 2019 -2021 MINRES Technolgies GmbH
*
* SPDX-License-Identifier: Apache-2.0
*/
#ifndef PLATFORM_SRC_CLIPARSER_H_
#define PLATFORM_SRC_CLIPARSER_H_
#include <boost/program_options.hpp>
#include <scc/report.h>
#include <memory>
class CLIParser {
public:
CLIParser(int argc, char *argv[]);
virtual ~CLIParser();
bool is_valid() { return valid; }
const boost::program_options::variables_map &vm() { return vm_; }
bool is_set(const char *option) { return vm_.count(option) != 0; }
template <typename T> const T &get(const char *option) { return vm_[option].as<T>(); }
private:
void build();
bool valid;
boost::program_options::variables_map vm_;
boost::program_options::options_description desc;
std::array<std::unique_ptr<scc::stream_redirection>, 2> redir;
};
#endif /* PLATFORM_SRC_CLIPARSER_H_ */