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