mirror of
https://github.com/sametersoylu/argument-parser.git
synced 2026-05-28 20:08:10 +00:00
feat: Introduce a modular argument convention system for GNU and Windows styles, add .clang-format, and update CMake configuration to C++17.
This commit is contained in:
38
src/headers/parser/fake_parser.hpp
Normal file
38
src/headers/parser/fake_parser.hpp
Normal file
@@ -0,0 +1,38 @@
|
||||
#pragma once
|
||||
|
||||
#ifndef FAKE_PARSER_HPP
|
||||
#define FAKE_PARSER_HPP
|
||||
|
||||
#include <argument_parser.hpp>
|
||||
#include <initializer_list>
|
||||
#include <string>
|
||||
|
||||
namespace argument_parser {
|
||||
class fake_parser : public base_parser {
|
||||
public:
|
||||
fake_parser() = default;
|
||||
|
||||
fake_parser(std::string program_name, std::vector<std::string> const& arguments) {
|
||||
this->program_name = std::move(program_name);
|
||||
parsed_arguments = arguments;
|
||||
}
|
||||
|
||||
fake_parser(std::string const& program_name, std::vector<std::string>&& arguments) {
|
||||
this->program_name = program_name;
|
||||
parsed_arguments = std::move(arguments);
|
||||
}
|
||||
|
||||
fake_parser(std::string const& program_name, std::initializer_list<std::string> const& arguments) :
|
||||
fake_parser(program_name, std::vector<std::string>(arguments)) {}
|
||||
|
||||
void set_program_name(std::string const& program_name) {
|
||||
this->program_name = program_name;
|
||||
}
|
||||
|
||||
void set_parsed_arguments(std::vector<std::string> const& parsed_arguments) {
|
||||
this->parsed_arguments = parsed_arguments;
|
||||
}
|
||||
};
|
||||
}
|
||||
|
||||
#endif
|
||||
Reference in New Issue
Block a user