30 lines
770 B
C++
30 lines
770 B
C++
//
|
|
// Created by versustune on 22.02.20.
|
|
//
|
|
|
|
#ifndef ELIYA_ARGUMENTS_H
|
|
#define ELIYA_ARGUMENTS_H
|
|
|
|
|
|
#include <unordered_map>
|
|
#include <vector>
|
|
|
|
class Arguments {
|
|
private:
|
|
std::unordered_map<std::string, std::string> parsedArgs;
|
|
int count = 0;
|
|
std::vector<std::string> args;
|
|
public:
|
|
Arguments(int argc, std::vector<std::string> args);
|
|
~Arguments();
|
|
//pureRead args with this format: --key=args or --debug if "--" not defined it's says failed and skip it.. so make sure it's provided
|
|
void parseArgs();
|
|
std::string getArg(const std::string &key);
|
|
std::string getArgOrDefault(const std::string &key, std::string fallback);
|
|
const std::unordered_map<std::string, std::string> &getParsedArgs();
|
|
protected:
|
|
};
|
|
|
|
|
|
#endif //ELIYA_ARGUMENTS_H
|