?? object.cpp
字號:
///////////////////////////////////////////////////////////////////////////////
// $Header: /shorthand/src/object.cpp 5 2/08/03 6:40a Arm $
//-----------------------------------------------------------------------------
// Project: ShortHand interpreter
// Author: Andrei Remenchuk <andrei@remenchuk.com>
//-----------------------------------------------------------------------------
// object.cpp: abstract ShortHand object
///////////////////////////////////////////////////////////////////////////////
#include "module.h"
#include "object.h"
#include "value.h"
ShhObject::ShhObject(ShhModule& module, const char* type, const YYLTYPE& location)
: m_module(module), m_type(type), m_ctor_location(location)
{
}
void ShhObject::setProperty(const char* name, ShhValue value)
{
m_properties.put(name, value);
}
ShhValue& ShhObject::getProperty(const char* key)
{
ShhValue* value = m_properties.get(key);
if (value == NULL) {
throw new ShhObjectException(1070, "Object of type '%s' doesn't have property or method named '%s'", m_type.cstr(), key );
}
return *value;
}
ShhObject::~ShhObject()
{
}
?? 快捷鍵說明
復制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號
Ctrl + =
減小字號
Ctrl + -