aboutsummaryrefslogtreecommitdiff
path: root/src/argument_parser.hpp
blob: fee5960228849b90ec049ddd94b2dec3d419dda6 (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
28
29
30
31
#pragma once

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

#include <yacppdic/auto_wirable.hpp>

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

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

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

private:
	IRandomNumberGeneratorFactory _random_number_generator_factory;
};