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  string_view name, string_view description,
13  string_view initialValue);
14 
15  string_view getTypeString() const override;
16  void tabCompletion(std::vector<std::string>& tokens) const override;
17 
18  string_view getString() const { return getValue().getString(); }
19  void setString(string_view str) { setValue(TclObject(str)); }
20 };
21 
22 } // namespace openmsx
23 
24 #endif
string_view getTypeString() const override
Returns a string describing the setting type (integer, string, ..) Could be used in a GUI to pick an ...
string_view getString() const
string_view getString() const
Definition: TclObject.cc:102
void setString(string_view str)
const TclObject & getValue() const final override
Gets the current value of this setting as a TclObject.
Definition: Setting.hh:134
Thanks to enen for testing this on a real cartridge:
Definition: Autofire.cc:5
FilenameSetting(CommandController &commandController, string_view name, string_view description, string_view initialValue)
void setValue(const TclObject &newValue) final override
Change the value of this setting to the given value.
Definition: Setting.cc:88
This class implements a (close approximation) of the std::string_view class.
Definition: string_view.hh:16
void tabCompletion(std::vector< std::string > &tokens) const override
Complete a partly typed value.