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(CLIOption&&) = delete;
14 CLIOption& operator=(const CLIOption&) = delete;
16
17 virtual void parseOption(const std::string& option,
18 std::span<std::string>& cmdLine) = 0;
19 virtual void parseDone() {}
20 [[nodiscard]] virtual std::string_view optionHelp() const = 0;
21
22protected:
23 CLIOption() = default;
24 ~CLIOption() = default;
25 [[nodiscard]] static std::string getArgument(
26 const std::string& option, std::span<std::string>& cmdLine);
27 [[nodiscard]] static std::string peekArgument(const std::span<std::string>& cmdLine);
28};
29
31{
32public:
33 CLIFileType(const CLIFileType&) = delete;
37
38 virtual void parseFileType(const std::string& filename,
39 std::span<std::string>& cmdLine) = 0;
40 [[nodiscard]] virtual std::string_view fileTypeCategoryName() const = 0;
41 [[nodiscard]] virtual std::string_view fileTypeHelp() const = 0;
42
43protected:
44 CLIFileType() = default;
45 ~CLIFileType() = default;
46};
47
48} // namespace openmsx
49
50#endif
CLIFileType & operator=(const CLIFileType &)=delete
CLIFileType(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 & operator=(CLIFileType &&)=delete
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(CLIOption &&)=delete
~CLIOption()=default
CLIOption & operator=(CLIOption &&)=delete
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:19
This file implemented 3 utility functions:
Definition Autofire.cc:11