openMSX
|
#include <TclObject.hh>
Classes | |
struct | MakeDictTag |
struct | MakeListTag |
Public Member Functions | |
TclObject () | |
TclObject (Tcl_Obj *o) | |
template<typename T > | |
TclObject (T t) | |
TclObject (const TclObject &o) | |
TclObject (TclObject &&o) noexcept | |
template<typename... Args> | |
TclObject (MakeListTag, Args &&... args) | |
template<typename... Args> | |
TclObject (MakeDictTag, Args &&... args) | |
~TclObject () | |
TclObject & | operator= (const TclObject &other) |
TclObject & | operator= (TclObject &other) |
TclObject & | operator= (TclObject &&other) noexcept |
template<typename T > | |
TclObject & | operator= (T &&t) |
Tcl_Obj * | getTclObject () |
Tcl_Obj * | getTclObjectNonConst () const |
template<typename T > | |
void | addListElement (const T &t) |
template<typename ITER > | |
void | addListElements (ITER first, ITER last) |
template<typename Range > | |
void | addListElements (Range &&range) |
template<typename... Args> | |
void | addListElement (Args &&... args) |
template<typename Key , typename Value > | |
void | addDictKeyValue (const Key &key, const Value &value) |
template<typename... Args> | |
void | addDictKeyValues (Args &&... args) |
zstring_view | getString () const |
int | getInt (Interpreter &interp) const |
bool | getBoolean (Interpreter &interp) const |
float | getFloat (Interpreter &interp) const |
double | getDouble (Interpreter &interp) const |
std::span< const uint8_t > | getBinary () const |
unsigned | getListLength (Interpreter &interp) const |
TclObject | getListIndex (Interpreter &interp, unsigned index) const |
TclObject | getListIndexUnchecked (unsigned index) const |
void | removeListIndex (Interpreter &interp, unsigned index) |
void | setDictValue (Interpreter &interp, const TclObject &key, const TclObject &value) |
TclObject | getDictValue (Interpreter &interp, const TclObject &key) const |
template<typename Key > | |
TclObject | getDictValue (Interpreter &interp, const Key &key) const |
std::optional< TclObject > | getOptionalDictValue (const TclObject &key) const |
std::optional< int > | getOptionalInt () const |
std::optional< bool > | getOptionalBool () const |
std::optional< double > | getOptionalDouble () const |
std::optional< float > | getOptionalFloat () const |
unsigned | size () const |
bool | empty () const |
iterator | begin () const |
iterator | end () const |
bool | evalBool (Interpreter &interp) const |
TclObject | eval (Interpreter &interp) const |
TclObject | executeCommand (Interpreter &interp, bool compile=false) |
Interpret this TclObject as a command and execute it. | |
Friends | |
bool | operator== (const TclObject &x, const TclObject &y) |
bool | operator== (const TclObject &x, std::string_view y) |
Definition at line 28 of file TclObject.hh.
|
inline |
Definition at line 76 of file TclObject.hh.
Referenced by eval(), executeCommand(), getDictValue(), getDictValue(), getListIndex(), getListIndexUnchecked(), and getOptionalDictValue().
|
inlineexplicit |
Definition at line 77 of file TclObject.hh.
|
inlineexplicit |
Definition at line 78 of file TclObject.hh.
References t.
|
inline |
Definition at line 79 of file TclObject.hh.
|
inlinenoexcept |
Definition at line 80 of file TclObject.hh.
|
inline |
Definition at line 84 of file TclObject.hh.
|
inline |
Definition at line 90 of file TclObject.hh.
References addDictKeyValues().
|
inline |
Definition at line 95 of file TclObject.hh.
|
inline |
Definition at line 147 of file TclObject.hh.
References addDictKeyValues().
Referenced by openmsx::MachineExtensionInfo::execute(), openmsx::ConfigInfo::execute(), openmsx::MSXDevice::getDeviceInfo(), openmsx::MSXRom::getExtraDeviceInfo(), openmsx::RealDrive::getMediaInfo(), openmsx::IDECDROM::getMediaInfo(), and openmsx::SCSILS120::getMediaInfo().
|
inline |
Definition at line 150 of file TclObject.hh.
References addDictKeyValues().
Referenced by addDictKeyValue(), addDictKeyValues(), openmsx::RomInfoTopic::execute(), openmsx::SoftwareInfoTopic::execute(), openmsx::VDP::getExtraDeviceInfo(), openmsx::MSXRom::getInfo(), openmsx::Rom::getInfo(), openmsx::CassettePlayer::getMediaInfo(), openmsx::RealDrive::getMediaInfo(), openmsx::HD::getMediaInfo(), openmsx::LaserdiscPlayer::getMediaInfo(), and TclObject().
|
inline |
Definition at line 141 of file TclObject.hh.
|
inline |
Definition at line 133 of file TclObject.hh.
References addListElement(), and t.
Referenced by openmsx::FloatSetting::additionalInfo(), openmsx::IntegerSetting::additionalInfo(), openmsx::VideoSourceSetting::additionalInfo(), openmsx::EnumSettingBase::additionalInfoBase(), addListElement(), openmsx::MSXtar::dirRaw(), openmsx::DiskCommand::execute(), openmsx::CassettePlayerCommand::execute(), openmsx::HDCommand::execute(), openmsx::CDXCommand::execute(), openmsx::LSXCommand::execute(), openmsx::MSXDevice::getNameList(), openmsx::MSXMultiIODevice::getNameList(), openmsx::MSXMultiMemDevice::getNameList(), openmsx::OSDWidget::getProperty(), openmsx::OSDImageBasedWidget::getProperty(), openmsx::BaseSetting::info(), TEST_CASE(), and TEST_CASE().
|
inline |
Definition at line 134 of file TclObject.hh.
Referenced by openmsx::VideoSourceSetting::additionalInfo(), openmsx::EnumSettingBase::additionalInfoBase(), addListElements(), openmsx::RomInfoTopic::execute(), openmsx::MachineExtensionInfo::execute(), openmsx::MachineMediaInfo::execute(), openmsx::DeviceInfo::execute(), openmsx::ConfigInfo::execute(), openmsx::ListExtCmd::execute(), openmsx::ListMachinesCommand::execute(), openmsx::RealDrive::getMediaInfo(), and TEST_CASE().
|
inline |
Definition at line 138 of file TclObject.hh.
References addListElements().
|
inline |
Definition at line 181 of file TclObject.hh.
Referenced by TEST_CASE().
|
inline |
Definition at line 180 of file TclObject.hh.
References size().
Referenced by openmsx::ImGuiMedia::showMenu(), and TEST_CASE().
|
inline |
TclObject openmsx::TclObject::eval | ( | Interpreter & | interp | ) | const |
Definition at line 238 of file TclObject.cc.
References TclObject().
bool openmsx::TclObject::evalBool | ( | Interpreter & | interp | ) | const |
Definition at line 228 of file TclObject.cc.
TclObject openmsx::TclObject::executeCommand | ( | Interpreter & | interp, |
bool | compile = false |
||
) |
Interpret this TclObject as a command and execute it.
interp | The Tcl interpreter |
compile | Should the command be compiled to bytecode? The bytecode is stored inside the TclObject can speed up future invocations of the same command. Only set this flag when the command will be executed more than once. |
Definition at line 248 of file TclObject.cc.
References TclObject().
Referenced by openmsx::BreakPointBase::checkAndExecute(), openmsx::AfterCmd::execute(), openmsx::ImGuiManager::execute(), openmsx::ImGuiManager::executeDelayed(), openmsx::CassettePlayerCLI::parseFileType(), openmsx::LaserdiscPlayerCLI::parseFileType(), openmsx::ReplayCLI::parseFileType(), openmsx::SaveStateCLI::parseFileType(), openmsx::CDImageCLI::parseOption(), and TEST_CASE().
std::span< const uint8_t > openmsx::TclObject::getBinary | ( | ) | const |
Definition at line 148 of file TclObject.cc.
Referenced by TEST_CASE().
bool openmsx::TclObject::getBoolean | ( | Interpreter & | interp | ) | const |
Definition at line 88 of file TclObject.cc.
Referenced by openmsx::BooleanSetting::BooleanSetting(), openmsx::BooleanSetting::getBoolean(), openmsx::detail::GetArg< bool >::operator()(), openmsx::OSDWidget::setProperty(), TEST_CASE(), and TEST_CASE().
|
inline |
Definition at line 168 of file TclObject.hh.
References getDictValue(), and TclObject().
TclObject openmsx::TclObject::getDictValue | ( | Interpreter & | interp, |
const TclObject & | key | ||
) | const |
Definition at line 209 of file TclObject.cc.
References TclObject().
Referenced by getDictValue(), TEST_CASE(), and TEST_CASE().
double openmsx::TclObject::getDouble | ( | Interpreter & | interp | ) | const |
Definition at line 122 of file TclObject.cc.
Referenced by openmsx::FloatSetting::FloatSetting(), openmsx::FloatSetting::getDouble(), getFloat(), openmsx::detail::GetArg< double >::operator()(), TEST_CASE(), and TEST_CASE().
float openmsx::TclObject::getFloat | ( | Interpreter & | interp | ) | const |
Definition at line 107 of file TclObject.cc.
References getDouble().
Referenced by openmsx::FloatSetting::getFloat(), openmsx::OSDWidget::setProperty(), openmsx::OSDImageBasedWidget::setProperty(), openmsx::OSDRectangle::setProperty(), and openmsx::OSDText::setProperty().
int openmsx::TclObject::getInt | ( | Interpreter & | interp | ) | const |
Definition at line 69 of file TclObject.cc.
Referenced by openmsx::IntegerSetting::getInt(), openmsx::IntegerSetting::IntegerSetting(), openmsx::detail::GetArg< int >::operator()(), openmsx::OSDRectangle::setProperty(), openmsx::OSDText::setProperty(), TEST_CASE(), and TEST_CASE().
TclObject openmsx::TclObject::getListIndex | ( | Interpreter & | interp, |
unsigned | index | ||
) | const |
Definition at line 173 of file TclObject.cc.
References TclObject().
Referenced by openmsx::InputEventFactory::createInputEvent(), openmsx::FilePool::getDirectories(), TEST_CASE(), TEST_CASE(), and TEST_CASE().
TclObject openmsx::TclObject::getListIndexUnchecked | ( | unsigned | index | ) | const |
Definition at line 182 of file TclObject.cc.
References TclObject().
Referenced by openmsx::ImGuiMedia::addRecent(), and openmsx::ImGuiWatchExpr::loadLine().
unsigned openmsx::TclObject::getListLength | ( | Interpreter & | interp | ) | const |
Definition at line 155 of file TclObject.cc.
Referenced by openmsx::InputEventFactory::createInputEvent(), openmsx::DiskCommand::execute(), openmsx::FilePool::getDirectories(), TEST_CASE(), TEST_CASE(), and TEST_CASE().
std::optional< bool > openmsx::TclObject::getOptionalBool | ( | ) | const |
Definition at line 98 of file TclObject.cc.
Definition at line 219 of file TclObject.cc.
References TclObject().
std::optional< double > openmsx::TclObject::getOptionalDouble | ( | ) | const |
Definition at line 132 of file TclObject.cc.
Referenced by getOptionalFloat().
std::optional< float > openmsx::TclObject::getOptionalFloat | ( | ) | const |
Definition at line 114 of file TclObject.cc.
References getOptionalDouble().
std::optional< int > openmsx::TclObject::getOptionalInt | ( | ) | const |
Definition at line 79 of file TclObject.cc.
zstring_view openmsx::TclObject::getString | ( | ) | const |
Definition at line 141 of file TclObject.cc.
Referenced by openmsx::ImGuiMedia::addRecent(), openmsx::ComboBox(), openmsx::InputEventFactory::createInputEvent(), openmsx::EnumSetting< T >::EnumSetting(), openmsx::DiskCommand::execute(), openmsx::BaseSetting::getBaseName(), openmsx::FilePool::getDirectories(), openmsx::BaseSetting::getFullName(), openmsx::OSDWidget::getName(), openmsx::MSXMultiIODevice::getName(), openmsx::MSXMultiMemDevice::getName(), openmsx::EnumSetting< T >::getString(), openmsx::FilenameSetting::getString(), openmsx::StringSetting::getString(), openmsx::InputText(), openmsx::KeyCodeSetting::KeyCodeSetting(), openmsx::ImGuiWatchExpr::loadLine(), openmsx::Setting::notifyPropertyChange(), openmsx::XXTclHasher::operator()(), openmsx::detail::GetArg< std::string >::operator()(), openmsx::detail::GetArg< std::string_view >::operator()(), openmsx::ImGuiConsole::paint(), openmsx::CommandLineParser::parse(), openmsx::Interpreter::registerSetting(), openmsx::OSDRectangle::setProperty(), openmsx::OSDText::setProperty(), openmsx::ImGuiMedia::showMenu(), TEST_CASE(), TEST_CASE(), TEST_CASE(), TEST_CASE(), TEST_CASE(), TEST_CASE(), TEST_CASE(), and openmsx::VideoSourceSetting::VideoSourceSetting().
|
inline |
Definition at line 129 of file TclObject.hh.
|
inline |
Definition at line 130 of file TclObject.hh.
Referenced by openmsx::Interpreter::setVariable(), and openmsx::Interpreter::setVariable().
Definition at line 98 of file TclObject.hh.
|
inline |
Definition at line 117 of file TclObject.hh.
References t.
Definition at line 112 of file TclObject.hh.
Definition at line 105 of file TclObject.hh.
void openmsx::TclObject::removeListIndex | ( | Interpreter & | interp, |
unsigned | index | ||
) |
Definition at line 191 of file TclObject.cc.
void openmsx::TclObject::setDictValue | ( | Interpreter & | interp, |
const TclObject & | key, | ||
const TclObject & | value | ||
) |
Definition at line 200 of file TclObject.cc.
|
inline |
Definition at line 179 of file TclObject.hh.
Referenced by openmsx::ImGuiMedia::addRecent(), empty(), end(), openmsx::instructionLength(), openmsx::ImGuiWatchExpr::loadLine(), and TEST_CASE().
Definition at line 197 of file TclObject.hh.
|
friend |
Definition at line 200 of file TclObject.hh.