openMSX
CLIOption.hh
Go to the documentation of this file.
1#ifndef CLIOPTION_HH
2#define CLIOPTION_HH
3
4#include <span>
5#include <string_view>
6
7namespace openmsx {
8
10{
11public:
12 CLIOption(const CLIOption&) = delete;
13 CLIOption& operator=(const CLIOption&) = delete;
14
15 virtual void parseOption(const std::string& option,
16 std::span<std::string>& cmdLine) = 0;
17 virtual void parseDone() {}
18 [[nodiscard]] virtual std::string_view optionHelp() const = 0;
19
20protected:
21 CLIOption() = default;
22 ~CLIOption() = default;
23 [[nodiscard]] static std::string getArgument(
24 const std::string& option, std::span<std::string>& cmdLine);
25 [[nodiscard]] static std::string peekArgument(const std::span<std::string>& cmdLine);
26};
27
29{
30public:
31 CLIFileType(const CLIFileType&) = delete;
33
34 virtual void parseFileType(const std::string& filename,
35 std::span<std::string>& cmdLine) = 0;
36 [[nodiscard]] virtual std::string_view fileTypeCategoryName() const = 0;
37 [[nodiscard]] virtual std::string_view fileTypeHelp() const = 0;
38
39protected:
40 CLIFileType() = default;
41 ~CLIFileType() = default;
42};
43
44} // namespace openmsx
45
46#endif
CLIFileType & operator=(const CLIFileType &)=delete
virtual std::string_view fileTypeCategoryName() const =0
virtual void parseFileType(const std::string &filename, std::span< std::string > &cmdLine)=0
virtual std::string_view fileTypeHelp() const =0
CLIFileType(const CLIFileType &)=delete
CLIOption(const CLIOption &)=delete
static std::string getArgument(const std::string &option, std::span< std::string > &cmdLine)
Definition CLIOption.cc:9
CLIOption & operator=(const CLIOption &)=delete
static std::string peekArgument(const std::span< std::string > &cmdLine)
Definition CLIOption.cc:19
~CLIOption()=default
virtual std::string_view optionHelp() const =0
virtual void parseOption(const std::string &option, std::span< std::string > &cmdLine)=0
virtual void parseDone()
Definition CLIOption.hh:17
This file implemented 3 utility functions:
Definition Autofire.cc:9