mirror of
https://github.com/Minres/RISCV-VP.git
synced 2026-01-13 09:46:57 +00:00
initial version
This commit is contained in:
36
src/CLIParser.h
Normal file
36
src/CLIParser.h
Normal 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_ */
|
||||
Reference in New Issue
Block a user