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