aboutsummaryrefslogtreecommitdiff
path: root/src/argument_parser.hpp
blob: c7f33de9ba3a0bdeaf5ddcc854e6000bcdc8a01f (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
#pragma once

#include "DI/auto_wirable.hpp"
#include "interfaces/argument_parser.hpp"
#include "interfaces/randomization.hpp"

#include <getopt.h>
#include <string_view>
#include <vector>

class ArgumentParser
	: public IArgumentParser,
	  public AutoWirable<IArgumentParser, ArgumentParser, IRandomNumberGeneratorFactory>
{
public:
	explicit ArgumentParser(
		IRandomNumberGeneratorFactory random_number_generator_factory) noexcept;

	ParsedArguments parse(
		const std::vector<option> &options, const std::string_view &short_options,
		const int &argc,
		char *const *argv) noexcept override; // NOLINT(cppcoreguidelines-avoid-c-arrays,
											  // modernize-avoid-c-arrays)

private:
	IRandomNumberGeneratorFactory _random_number_generator_factory;
};