当前位置: 首页>>代码示例>>C++>>正文


C++ MutableHandleValue::setInt32方法代码示例

本文整理汇总了C++中js::MutableHandleValue::setInt32方法的典型用法代码示例。如果您正苦于以下问题:C++ MutableHandleValue::setInt32方法的具体用法?C++ MutableHandleValue::setInt32怎么用?C++ MutableHandleValue::setInt32使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在js::MutableHandleValue的用法示例。


在下文中一共展示了MutableHandleValue::setInt32方法的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。

示例1: JSGetter_channels

bool JSAudioContext::JSGetter_channels(JSContext *cx, JS::MutableHandleValue vp)
{
    AudioParameters *params = m_Audio->m_OutputParameters;
    vp.setInt32(params->m_Channels);

    return true;
}
开发者ID:nidium,项目名称:Nidium,代码行数:7,代码来源:JSAudioContext.cpp

示例2: JSGetter_sampleRate

bool JSAudioContext::JSGetter_sampleRate(JSContext *cx,
                                         JS::MutableHandleValue vp)
{
    AudioParameters *params = m_Audio->m_OutputParameters;
    vp.setInt32(params->m_SampleRate);

    return true;
}
开发者ID:nidium,项目名称:Nidium,代码行数:8,代码来源:JSAudioContext.cpp

示例3: def_timestep_image_map_get_width

CEXPORT bool def_timestep_image_map_get_width(JSContext *cx, JS::HandleObject obj, JS::HandleId id, JS::MutableHandleValue vp) {
	JS_BeginRequest(cx);
	timestep_image_map *thiz = (timestep_image_map*)JS_GetPrivate(obj.get());
	if (thiz) {
		
		vp.setInt32(thiz->width);
		
	}
	JS_EndRequest(cx);
	return true;
}
开发者ID:Tufals,项目名称:native-ios,代码行数:11,代码来源:js_timestep_image_map_template.gen.cpp

示例4: toValue

void IdWrapper::toValue(JS::MutableHandleValue value) const {
    if (isInt()) {
        value.setInt32(toInt32());
        return;
    }

    if (isString()) {
        auto str = JSID_TO_STRING(_value);
        value.setString(str);
        return;
    }

    uasserted(ErrorCodes::BadValue, "Failed to toValue() non-string and non-integer jsid");
}
开发者ID:ShaneHarvey,项目名称:mongo,代码行数:14,代码来源:idwrapper.cpp

示例5: if

static void
convertValue(JSContext *             jct,
             JS::MutableHandleValue  theData,
             const yarp::os::Value & inputValue)
{
    ODL_ENTER(); //####
    ODL_P2("jct = ", jct, "inputValue = ", &inputValue); //####
    if (inputValue.isBool())
    {
        theData.setBoolean(inputValue.asBool());
    }
    else if (inputValue.isInt())
    {
        theData.setInt32(inputValue.asInt());
    }
    else if (inputValue.isString())
    {
        YarpString value = inputValue.asString();
        JSString * aString = JS_NewStringCopyZ(jct, value.c_str());

        if (aString)
        {
            theData.setString(aString);
        }
    }
    else if (inputValue.isDouble())
    {
        theData.setDouble(inputValue.asDouble());
    }
    else if (inputValue.isDict())
    {
        yarp::os::Property * value = inputValue.asDict();

        if (value)
        {
            yarp::os::Bottle asList(value->toString());

            convertDictionary(jct, theData, asList);
        }
    }
    else if (inputValue.isList())
    {
        yarp::os::Bottle * value = inputValue.asList();

        if (value)
        {
            yarp::os::Property asDict;

            if (ListIsReallyDictionary(*value, asDict))
            {
                convertDictionary(jct, theData, *value);
            }
            else
            {
                convertList(jct, theData, *value);
            }
        }
    }
    else
    {
        // We don't know what to do with this...
        theData.setNull();
    }
    ODL_EXIT(); //####
} // convertValue
开发者ID:MovementAndMeaning,项目名称:Core_MPlusM,代码行数:65,代码来源:m+mJavaScriptFilterService.cpp

示例6: JSGetter_bufferSize

bool JSAudioContext::JSGetter_bufferSize(JSContext *cx,
                                         JS::MutableHandleValue vp)
{
    vp.setInt32(m_Audio->m_OutputParameters->m_FramesPerBuffer);
    return true;
}
开发者ID:nidium,项目名称:Nidium,代码行数:6,代码来源:JSAudioContext.cpp


注:本文中的js::MutableHandleValue::setInt32方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。