openMSX
FilenameSetting.hh
Go to the documentation of this file.
1 #ifndef FILENAMESETTING_HH
2 #define FILENAMESETTING_HH
3 
4 #include "Setting.hh"
5 
6 namespace openmsx {
7 
8 class FilenameSetting final : public Setting
9 {
10 public:
11  FilenameSetting(CommandController& commandController,
12  std::string_view name, std::string_view description,
13  std::string_view initialValue);
14 
15  std::string_view getTypeString() const override;
16  void tabCompletion(std::vector<std::string>& tokens) const override;
17 
18  std::string_view getString() const noexcept { return getValue().getString(); }
19  void setString(std::string_view str) { setValue(TclObject(str)); }
20 };
21 
22 } // namespace openmsx
23 
24 #endif
openmsx::FilenameSetting::tabCompletion
void tabCompletion(std::vector< std::string > &tokens) const override
Complete a partly typed value.
Definition: FilenameSetting.cc:22
openmsx::CommandController
Definition: CommandController.hh:18
Setting.hh
openmsx::Setting::getValue
const TclObject & getValue() const final override
Gets the current value of this setting as a TclObject.
Definition: Setting.hh:135
openmsx::FilenameSetting
Definition: FilenameSetting.hh:9
openmsx::Setting::setValue
void setValue(const TclObject &newValue) final override
Change the value of this setting to the given value.
Definition: Setting.cc:89
openmsx::FilenameSetting::getTypeString
std::string_view getTypeString() const override
Returns a string describing the setting type (integer, string, ..) Could be used in a GUI to pick an ...
Definition: FilenameSetting.cc:17
openmsx::FilenameSetting::setString
void setString(std::string_view str)
Definition: FilenameSetting.hh:19
openmsx::Setting
Definition: Setting.hh:120
openmsx::FilenameSetting::getString
std::string_view getString() const noexcept
Definition: FilenameSetting.hh:18
openmsx::TclObject::getString
std::string_view getString() const
Definition: TclObject.cc:102
openmsx::TclObject
Definition: TclObject.hh:22
openmsx
This file implemented 3 utility functions:
Definition: Autofire.cc:5
openmsx::FilenameSetting::FilenameSetting
FilenameSetting(CommandController &commandController, std::string_view name, std::string_view description, std::string_view initialValue)
Definition: FilenameSetting.cc:7