⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 object.cpp

📁 Shorthand是一个强大的脚本语言
💻 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 + -