Classes | Public Member Functions | Friends | List of all members
openmsx::TclObject Class Reference

#include <TclObject.hh>

Public Member Functions

 TclObject ()
 TclObject (Tcl_Obj *o)
 TclObject (string_view v)
 TclObject (int v)
 TclObject (double v)
 TclObject (const TclObject &o)
 TclObject (TclObject &&o) noexcept
 ~TclObject ()
TclObjectoperator= (const TclObject &other)
TclObjectoperator= (TclObject &&other) noexcept
Tcl_Obj * getTclObject ()
Tcl_Obj * getTclObjectNonConst () const
void setString (string_view value)
void setInt (int value)
void setBoolean (bool value)
void setDouble (double value)
void setBinary (byte *buf, unsigned length)
void addListElement (string_view element)
void addListElement (int value)
void addListElement (double value)
void addListElement (const TclObject &element)
template<typename ITER >
void addListElements (ITER first, ITER last)
template<typename CONT >
void addListElements (const CONT &container)
string_view getString () const
int getInt (Interpreter &interp) const
bool getBoolean (Interpreter &interp) const
double getDouble (Interpreter &interp) const
const bytegetBinary (unsigned &length) const
unsigned getListLength (Interpreter &interp) const
TclObject getListIndex (Interpreter &interp, unsigned index) const
TclObject getDictValue (Interpreter &interp, const TclObject &key) const
unsigned size () const
bool empty () const
auto begin () const
auto end () const
bool evalBool (Interpreter &interp) const
TclObject executeCommand (Interpreter &interp, bool compile=false)
 Interpret this TclObject as a command and execute it. More...


bool operator== (const TclObject &x, const TclObject &y)
bool operator== (const TclObject &x, string_view y)
bool operator== (string_view x, const TclObject &y)
bool operator!= (const TclObject &x, const TclObject &y)
bool operator!= (const TclObject &x, string_view y)
bool operator!= (string_view x, const TclObject &y)

Detailed Description

Definition at line 17 of file TclObject.hh.

Constructor & Destructor Documentation

◆ TclObject() [1/7]

openmsx::TclObject::TclObject ( )

Definition at line 60 of file TclObject.hh.

Referenced by executeCommand(), getDictValue(), and getListIndex().

◆ TclObject() [2/7]

openmsx::TclObject::TclObject ( Tcl_Obj *  o)

Definition at line 61 of file TclObject.hh.

◆ TclObject() [3/7]

openmsx::TclObject::TclObject ( string_view  v)

Definition at line 62 of file TclObject.hh.

References string_view::data(), and string_view::size().

◆ TclObject() [4/7]

openmsx::TclObject::TclObject ( int  v)

Definition at line 63 of file TclObject.hh.

◆ TclObject() [5/7]

openmsx::TclObject::TclObject ( double  v)

Definition at line 64 of file TclObject.hh.

◆ TclObject() [6/7]

openmsx::TclObject::TclObject ( const TclObject o)

Definition at line 65 of file TclObject.hh.

◆ TclObject() [7/7]

openmsx::TclObject::TclObject ( TclObject &&  o)

Definition at line 66 of file TclObject.hh.

◆ ~TclObject()

openmsx::TclObject::~TclObject ( )

Definition at line 67 of file TclObject.hh.

Member Function Documentation

◆ addListElement() [1/4]

void openmsx::TclObject::addListElement ( string_view  element)

Definition at line 69 of file

References string_view::data(), and string_view::size().

Referenced by openmsx::VideoSourceSetting::additionalInfo(), openmsx::FloatSetting::additionalInfo(), openmsx::IntegerSetting::additionalInfo(), openmsx::EnumSettingBase::additionalInfoBase(), addListElement(), addListElements(), openmsx::CPUCore< openmsx::Z80TYPE >::disasmCommand(), openmsx::RomInfoTopic::execute(), openmsx::HDCommand::execute(), openmsx::TclCallback::execute(), openmsx::CDXCommand::execute(), openmsx::DiskCommand::execute(), openmsx::LSXCommand::execute(), openmsx::ListExtCmd::execute(), openmsx::DeviceInfo::execute(), openmsx::ConfigInfo::execute(), openmsx::SoftwareInfoTopic::execute(), openmsx::DiskImageCLI::fileTypeHelp(), openmsx::MSXMixer::findDevice(), openmsx::FocusEvent::FocusEvent(), openmsx::CassettePlayer::generateChannels(), openmsx::PluggingController::getCurrentTime(), openmsx::MSXDevice::getDeviceInfo(), openmsx::MSXRom::getExtraDeviceInfo(), openmsx::AviRecorder::getFrameHeight(), openmsx::MSXMultiIODevice::getNameList(), openmsx::MSXMultiMemDevice::getNameList(), openmsx::MSXDevice::getNameList(), openmsx::OSDText::getProperty(), openmsx::OSDWidget::getProperty(), getTclObjectNonConst(), openmsx::BaseSetting::info(), openmsx::CartridgeSlotManager::isExternalSlot(), openmsx::JoystickAxisMotionEvent::JoystickAxisMotionEvent(), openmsx::JoystickButtonDownEvent::JoystickButtonDownEvent(), openmsx::JoystickButtonUpEvent::JoystickButtonUpEvent(), openmsx::JoystickHatEvent::JoystickHatEvent(), openmsx::KeyEvent::KeyEvent(), openmsx::SettingsManager::loadSettings(), openmsx::MouseButtonDownEvent::MouseButtonDownEvent(), openmsx::MouseButtonUpEvent::MouseButtonUpEvent(), openmsx::MouseMotionEvent::MouseMotionEvent(), openmsx::MouseMotionGroupEvent::MouseMotionGroupEvent(), openmsx::OsdControlPressEvent::OsdControlPressEvent(), openmsx::OsdControlReleaseEvent::OsdControlReleaseEvent(), openmsx::LaserdiscPlayerCLI::parseFileType(), openmsx::ReplayCLI::parseFileType(), openmsx::CassettePlayerCLI::parseFileType(), openmsx::SaveStateCLI::parseFileType(), openmsx::CDImageCLI::parseOption(), openmsx::QuitEvent::QuitEvent(), openmsx::ResizeEvent::ResizeEvent(), openmsx::HotKey::saveBindings(), openmsx::JoyState::serialize(), openmsx::OSDImageBasedWidget::setProperty(), openmsx::GlobalCommandController::tabCompletion(), openmsx::MouseButtonEvent::toStringHelper(), openmsx::JoystickEvent::toStringHelper(), openmsx::JoystickButtonEvent::toStringHelper(), openmsx::OsdControlEvent::toStringHelper(), openmsx::FinishFrameEvent::toStringImpl(), openmsx::CliCommandEvent::toStringImpl(), openmsx::SimpleEvent::toStringImpl(), openmsx::InfoCommand::unregisterTopic(), and openmsx::ReverseManager::~ReverseManager().

◆ addListElement() [2/4]

void openmsx::TclObject::addListElement ( int  value)

Definition at line 74 of file

References addListElement().

◆ addListElement() [3/4]

void openmsx::TclObject::addListElement ( double  value)

Definition at line 79 of file

References addListElement().

◆ addListElement() [4/4]

void openmsx::TclObject::addListElement ( const TclObject element)

Definition at line 84 of file

References addListElement().

◆ addListElements() [1/2]

template<typename ITER >
void openmsx::TclObject::addListElements ( ITER  first,
ITER  last 

◆ addListElements() [2/2]

template<typename CONT >
void openmsx::TclObject::addListElements ( const CONT &  container)

Definition at line 164 of file TclObject.hh.

References addListElements(), begin(), and end().

◆ begin()

auto openmsx::TclObject::begin ( ) const

Definition at line 113 of file TclObject.hh.

Referenced by openmsx::GlobalCommandController::tabCompletion().

◆ empty()

bool openmsx::TclObject::empty ( ) const

Definition at line 112 of file TclObject.hh.

References size().

Referenced by openmsx::CheckedRam::clear().

◆ end()

auto openmsx::TclObject::end ( ) const

Definition at line 114 of file TclObject.hh.

References evalBool(), executeCommand(), and size().

Referenced by openmsx::GlobalCommandController::tabCompletion().

◆ evalBool()

bool openmsx::TclObject::evalBool ( Interpreter interp) const

Definition at line 198 of file

Referenced by openmsx::BreakPointBase::BreakPointBase(), and end().

◆ executeCommand()

TclObject openmsx::TclObject::executeCommand ( Interpreter interp,
bool  compile = false 

Interpret this TclObject as a command and execute it.

interpThe Tcl interpreter
compileShould 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 208 of file

References TclObject().

Referenced by openmsx::BreakPointBase::checkAndExecute(), end(), openmsx::TclCallback::execute(), openmsx::AfterCmd::execute(), openmsx::DiskImageCLI::fileTypeHelp(), openmsx::LaserdiscPlayerCLI::parseFileType(), openmsx::ReplayCLI::parseFileType(), openmsx::SaveStateCLI::parseFileType(), openmsx::CassettePlayerCLI::parseFileType(), openmsx::CDImageCLI::parseOption(), and openmsx::GlobalCommandController::tabCompletion().

◆ getBinary()

const byte * openmsx::TclObject::getBinary ( unsigned &  length) const

Definition at line 146 of file

Referenced by getTclObjectNonConst().

◆ getBoolean()

bool openmsx::TclObject::getBoolean ( Interpreter interp) const

◆ getDictValue()

TclObject openmsx::TclObject::getDictValue ( Interpreter interp,
const TclObject key 
) const

Definition at line 188 of file

References TclObject().

Referenced by getTclObjectNonConst(), and openmsx::Joystick::write().

◆ getDouble()

double openmsx::TclObject::getDouble ( Interpreter interp) const

◆ getInt()

int openmsx::TclObject::getInt ( Interpreter interp) const

◆ getListIndex()

TclObject openmsx::TclObject::getListIndex ( Interpreter interp,
unsigned  index 
) const

◆ getListLength()

unsigned openmsx::TclObject::getListLength ( Interpreter interp) const

◆ getString()

string_view openmsx::TclObject::getString ( ) const

◆ getTclObject()

Tcl_Obj* openmsx::TclObject::getTclObject ( )

Definition at line 83 of file TclObject.hh.

Referenced by openmsx::Interpreter::unregisterCommand().

◆ getTclObjectNonConst()

Tcl_Obj* openmsx::TclObject::getTclObjectNonConst ( ) const

◆ operator=() [1/2]

TclObject& openmsx::TclObject::operator= ( const TclObject other)

Definition at line 70 of file TclObject.hh.

◆ operator=() [2/2]

TclObject& openmsx::TclObject::operator= ( TclObject &&  other)

Definition at line 77 of file TclObject.hh.

◆ setBinary()

void openmsx::TclObject::setBinary ( byte buf,
unsigned  length 

Definition at line 58 of file

Referenced by getTclObjectNonConst().

◆ setBoolean()

void openmsx::TclObject::setBoolean ( bool  value)

◆ setDouble()

void openmsx::TclObject::setDouble ( double  value)

◆ setInt()

void openmsx::TclObject::setInt ( int  value)

◆ setString()

void openmsx::TclObject::setString ( string_view  value)

◆ size()

unsigned openmsx::TclObject::size ( ) const

Definition at line 111 of file TclObject.hh.

Referenced by empty(), end(), and openmsx::GlobalCommandController::tabCompletion().

Friends And Related Function Documentation

◆ operator!= [1/3]

bool operator!= ( const TclObject x,
const TclObject y 

Definition at line 138 of file TclObject.hh.

◆ operator!= [2/3]

bool operator!= ( const TclObject x,
string_view  y 

Definition at line 139 of file TclObject.hh.

◆ operator!= [3/3]

bool operator!= ( string_view  x,
const TclObject y 

Definition at line 140 of file TclObject.hh.

◆ operator== [1/3]

bool operator== ( const TclObject x,
const TclObject y 

Definition at line 128 of file TclObject.hh.

◆ operator== [2/3]

bool operator== ( const TclObject x,
string_view  y 

Definition at line 131 of file TclObject.hh.

◆ operator== [3/3]

bool operator== ( string_view  x,
const TclObject y 

Definition at line 134 of file TclObject.hh.

The documentation for this class was generated from the following files: