• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    迪恩网络公众号

C++ JSB_PRECONDITION2函数代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了C++中JSB_PRECONDITION2函数的典型用法代码示例。如果您正苦于以下问题:C++ JSB_PRECONDITION2函数的具体用法?C++ JSB_PRECONDITION2怎么用?C++ JSB_PRECONDITION2使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。



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

示例1: js_cocos2dx_custom_BinaryReadUtil_close

bool js_cocos2dx_custom_BinaryReadUtil_close(JSContext *cx, uint32_t argc, jsval *vp)
{
    JS::CallArgs args = JS::CallArgsFromVp(argc, vp);
    JS::RootedObject obj(cx, args.thisv().toObjectOrNull());
    js_proxy_t *proxy = jsb_get_js_proxy(obj);
    BinaryReadUtil* cobj = (BinaryReadUtil *)(proxy ? proxy->ptr : NULL);
    JSB_PRECONDITION2( cobj, cx, false, "js_cocos2dx_custom_BinaryReadUtil_close : Invalid Native Object");
    if (argc == 0) {
        cobj->close();
        args.rval().setUndefined();
        return true;
    }

    JS_ReportError(cx, "js_cocos2dx_custom_BinaryReadUtil_close : wrong number of arguments: %d, was expecting %d", argc, 0);
    return false;
}
开发者ID:longtu207,项目名称:Run,代码行数:16,代码来源:jsb_cocos2dx_custom.cpp


示例2: js_cocos2dx_experimental_video_VideoPlayer_stop

bool js_cocos2dx_experimental_video_VideoPlayer_stop(JSContext *cx, uint32_t argc, jsval *vp)
{
    JS::CallArgs args = JS::CallArgsFromVp(argc, vp);
    JS::RootedObject obj(cx, args.thisv().toObjectOrNull());
    js_proxy_t *proxy = jsb_get_js_proxy(obj);
    cocos2d::experimental::ui::VideoPlayer* cobj = (cocos2d::experimental::ui::VideoPlayer *)(proxy ? proxy->ptr : NULL);
    JSB_PRECONDITION2( cobj, cx, false, "js_cocos2dx_experimental_video_VideoPlayer_stop : Invalid Native Object");
    if (argc == 0) {
        cobj->stop();
        args.rval().setUndefined();
        return true;
    }

    JS_ReportError(cx, "js_cocos2dx_experimental_video_VideoPlayer_stop : wrong number of arguments: %d, was expecting %d", argc, 0);
    return false;
}
开发者ID:NicholasLefave,项目名称:Cocos-JS-Memory-Game,代码行数:16,代码来源:jsb_cocos2dx_experimental_video_auto.cpp


示例3: jsval_to_int32

bool jsval_to_int32( JSContext *cx, jsval vp, int32_t *outval )
{
    bool ok = true;
    double dp;
    ok &= JS::ToNumber(cx, JS::RootedValue(cx, vp), &dp);
    if (!ok) {
        LOGD("jsval_to_int32: the argument is not a number");
        return false;
    }
    ok &= !isnan(dp);
    JSB_PRECONDITION2(ok, cx, false, "Error processing arguments");

    *outval = (int32_t)dp;

    return ok;
}
开发者ID:cocoTM,项目名称:xumc_demos,代码行数:16,代码来源:jsb_pluginx_basic_conversions.cpp


示例4: js_PluginAppnextJS_PluginAppnext_isVideoReady

bool js_PluginAppnextJS_PluginAppnext_isVideoReady(JSContext *cx, uint32_t argc, JS::Value *vp)
{
    JS::CallArgs args = JS::CallArgsFromVp(argc, vp);
    bool ok = true;
    if (argc == 1) {
        std::string arg0;
        ok &= jsval_to_std_string(cx, args.get(0), &arg0);
        JSB_PRECONDITION2(ok, cx, false, "js_PluginAppnextJS_PluginAppnext_isVideoReady : Error processing arguments");
        bool ret = sdkbox::PluginAppnext::isVideoReady(arg0);
        JS::RootedValue jsret(cx);
        jsret = JS::BooleanValue(ret);
        args.rval().set(jsret);
        return true;
    }
    JS_ReportErrorUTF8(cx, "js_PluginAppnextJS_PluginAppnext_isVideoReady : wrong number of arguments");
    return false;
}
开发者ID:sdkbox,项目名称:sdkbox-sample-appnext,代码行数:17,代码来源:PluginAppnextJS.cpp


示例5: js_call_CCDrawLine

JSBool js_call_CCDrawLine(JSContext *cx, uint32_t argc, jsval *vp)
{
	jsval *argv = JS_ARGV(cx, vp);
	JSBool ok = JS_TRUE;
	if (argc == 2) 
	{
		cocos2d::CCPoint arg0;
		cocos2d::CCPoint arg1;
		ok &= jsval_to_ccpoint(cx, argv[0], &arg0);
		ok &= jsval_to_ccpoint(cx, argv[1], &arg1);
		JSB_PRECONDITION2(ok, cx, JS_FALSE, "Error processing arguments");
		ccDrawLine(arg0,arg1);
		JS_SET_RVAL(cx, vp, JSVAL_VOID);
		return JS_TRUE;
	}
	return ok;
}
开发者ID:Puppy03,项目名称:ReleaseWin32,代码行数:17,代码来源:js_bindings_libcp.cpp


示例6: jsb_util_crc16

bool jsb_util_crc16(JSContext *cx, uint32_t argc, jsval *vp)
{
    JS::CallArgs args = JS::CallArgsFromVp(argc, vp);
    //JS::RootedString appArgs(cx);
    if (argc == 1) {
        std::string arg0;

        bool ok = jsval_to_std_string(cx, args.get(0), &arg0);
        JSB_PRECONDITION2(ok, cx, false, "jsb_util_crc16 : Error processing arguments");

        args.rval().setInt32(Utils::CRC16(arg0.c_str()));
        return true;
    }

    JS_ReportError(cx, "jsb_util_crc16 : wrong number of arguments");
    return false;
}
开发者ID:wangxingfred,项目名称:SheetX,代码行数:17,代码来源:jsb_util.cpp


示例7: js_PluginGoogleAnalyticsJS_PluginGoogleAnalytics_setDimension

JSBool js_PluginGoogleAnalyticsJS_PluginGoogleAnalytics_setDimension(JSContext *cx, uint32_t argc, jsval *vp)
{
    jsval *argv = JS_ARGV(cx, vp);
    JSBool ok = JS_TRUE;
    if (argc == 2) {
        int arg0;
        std::string arg1;
        ok &= jsval_to_int32(cx, argv[0], (int32_t *)&arg0);
        ok &= jsval_to_std_string(cx, argv[1], &arg1);
        JSB_PRECONDITION2(ok, cx, JS_FALSE, "Error processing arguments");
        sdkbox::PluginGoogleAnalytics::setDimension(arg0, arg1);
        JS_SET_RVAL(cx, vp, JSVAL_VOID);
        return JS_TRUE;
    }
    JS_ReportError(cx, "wrong number of arguments");
    return JS_FALSE;
}
开发者ID:sdkbox,项目名称:sdkbox-sample-ga,代码行数:17,代码来源:PluginGoogleAnalyticsJS.cpp


示例8: js_controls_Button_getNormalTextureScaleInSize

bool js_controls_Button_getNormalTextureScaleInSize(JSContext *cx, uint32_t argc, jsval *vp)
{
	JSObject *obj = JS_THIS_OBJECT(cx, vp);
	js_proxy_t *proxy = jsb_get_js_proxy(obj);
	es::Button* cobj = (es::Button *)(proxy ? proxy->ptr : NULL);
	JSB_PRECONDITION2( cobj, cx, false, "js_controls_Button_getNormalTextureScaleInSize : Invalid Native Object");
	if (argc == 0) {
		cocos2d::Size ret = cobj->getNormalTextureScaleInSize();
		jsval jsret = JSVAL_NULL;
		jsret = ccsize_to_jsval(cx, ret);
		JS_SET_RVAL(cx, vp, jsret);
		return true;
	}

	JS_ReportError(cx, "js_controls_Button_getNormalTextureScaleInSize : wrong number of arguments: %d, was expecting %d", argc, 0);
	return false;
}
开发者ID:tovchenko,项目名称:espreso,代码行数:17,代码来源:jsb_controls_auto.cpp


示例9: js_PluginAdColonyJS_PluginAdColony_getVideoCreditBalance

bool js_PluginAdColonyJS_PluginAdColony_getVideoCreditBalance(JSContext *cx, uint32_t argc, jsval *vp)
{
    JS::CallArgs args = JS::CallArgsFromVp(argc, vp);
    bool ok = true;
    if (argc == 1) {
        std::string arg0;
        ok &= jsval_to_std_string(cx, args.get(0), &arg0);
        JSB_PRECONDITION2(ok, cx, false, "js_PluginAdColonyJS_PluginAdColony_getVideoCreditBalance : Error processing arguments");
        int ret = sdkbox::PluginAdColony::getVideoCreditBalance(arg0);
        jsval jsret = JSVAL_NULL;
        jsret = int32_to_jsval(cx, ret);
        args.rval().set(jsret);
        return true;
    }
    JS_ReportError(cx, "js_PluginAdColonyJS_PluginAdColony_getVideoCreditBalance : wrong number of arguments");
    return false;
}
开发者ID:yinjimmy,项目名称:sdkbox-samples,代码行数:17,代码来源:PluginAdColonyJS.cpp


示例10: js_PluginAppodealJS_PluginAppodeal_disableNetworkForAdType

bool js_PluginAppodealJS_PluginAppodeal_disableNetworkForAdType(JSContext *cx, uint32_t argc, jsval *vp)
{
    JS::CallArgs args = JS::CallArgsFromVp(argc, vp);
    bool ok = true;
    if (argc == 2) {
        sdkbox::PluginAppodeal::AdType arg0;
        std::string arg1;
        ok &= jsval_to_int32(cx, args.get(0), (int32_t *)&arg0);
        ok &= jsval_to_std_string(cx, args.get(1), &arg1);
        JSB_PRECONDITION2(ok, cx, false, "js_PluginAppodealJS_PluginAppodeal_disableNetworkForAdType : Error processing arguments");
        sdkbox::PluginAppodeal::disableNetworkForAdType(arg0, arg1);
        args.rval().setUndefined();
        return true;
    }
    JS_ReportError(cx, "js_PluginAppodealJS_PluginAppodeal_disableNetworkForAdType : wrong number of arguments");
    return false;
}
开发者ID:sdkbox,项目名称:sdkbox-sample-appodeal,代码行数:17,代码来源:PluginAppodealJS.cpp


示例11: js_PluginLeaderboardJS_PluginLeaderboard_submitScore

JSBool js_PluginLeaderboardJS_PluginLeaderboard_submitScore(JSContext *cx, uint32_t argc, jsval *vp)
{
    jsval *argv = JS_ARGV(cx, vp);
    JSBool ok = JS_TRUE;
    if (argc == 2) {
        std::string arg0;
        int arg1;
        ok &= jsval_to_std_string(cx, argv[0], &arg0);
        ok &= jsval_to_int32(cx, argv[1], (int32_t *)&arg1);
        JSB_PRECONDITION2(ok, cx, JS_FALSE, "Error processing arguments");
        sdkbox::PluginLeaderboard::submitScore(arg0, arg1);
        JS_SET_RVAL(cx, vp, JSVAL_VOID);
        return JS_TRUE;
    }
    JS_ReportError(cx, "wrong number of arguments");
    return JS_FALSE;
}
开发者ID:sdkbox,项目名称:sdkbox-sample-playphone,代码行数:17,代码来源:PluginLeaderboardJS.cpp


示例12: js_cocos2dx_spine_Skeleton_getBlendFunc

JSBool js_cocos2dx_spine_Skeleton_getBlendFunc(JSContext *cx, uint32_t argc, jsval *vp)
{
	JSObject *obj = JS_THIS_OBJECT(cx, vp);
	js_proxy_t *proxy = jsb_get_js_proxy(obj);
	spine::Skeleton* cobj = (spine::Skeleton *)(proxy ? proxy->ptr : NULL);
	JSB_PRECONDITION2( cobj, cx, JS_FALSE, "js_cocos2dx_spine_Skeleton_getBlendFunc : Invalid Native Object");
	if (argc == 0) {
		const cocos2d::BlendFunc& ret = cobj->getBlendFunc();
		jsval jsret = JSVAL_NULL;
		#pragma warning NO CONVERSION FROM NATIVE FOR BlendFunc;
		JS_SET_RVAL(cx, vp, jsret);
		return JS_TRUE;
	}

	JS_ReportError(cx, "js_cocos2dx_spine_Skeleton_getBlendFunc : wrong number of arguments: %d, was expecting %d", argc, 0);
	return JS_FALSE;
}
开发者ID:6520874,项目名称:pipiGame,代码行数:17,代码来源:jsb_cocos2dx_spine_auto.cpp


示例13: js_cocos2dx_spine_Skeleton_getBlendFunc

bool js_cocos2dx_spine_Skeleton_getBlendFunc(JSContext *cx, uint32_t argc, jsval *vp)
{
	JSObject *obj = JS_THIS_OBJECT(cx, vp);
	js_proxy_t *proxy = jsb_get_js_proxy(obj);
	spine::Skeleton* cobj = (spine::Skeleton *)(proxy ? proxy->ptr : NULL);
	JSB_PRECONDITION2( cobj, cx, false, "js_cocos2dx_spine_Skeleton_getBlendFunc : Invalid Native Object");
	if (argc == 0) {
		const cocos2d::BlendFunc& ret = cobj->getBlendFunc();
		jsval jsret = JSVAL_NULL;
		jsret = blendfunc_to_jsval(cx, ret);
		JS_SET_RVAL(cx, vp, jsret);
		return true;
	}

	JS_ReportError(cx, "js_cocos2dx_spine_Skeleton_getBlendFunc : wrong number of arguments: %d, was expecting %d", argc, 0);
	return false;
}
开发者ID:2youyou2,项目名称:cocos2d-js,代码行数:17,代码来源:jsb_cocos2dx_spine_auto.cpp


示例14: js_PluginChartboostJS_PluginChartboost_isAvailable

JSBool js_PluginChartboostJS_PluginChartboost_isAvailable(JSContext *cx, uint32_t argc, jsval *vp)
{
    jsval *argv = JS_ARGV(cx, vp);
    JSBool ok = JS_TRUE;
    if (argc == 1) {
        std::string arg0;
        ok &= jsval_to_std_string(cx, argv[0], &arg0);
        JSB_PRECONDITION2(ok, cx, JS_FALSE, "Error processing arguments");
        bool ret = sdkbox::PluginChartboost::isAvailable(arg0);
        jsval jsret;
        jsret = BOOLEAN_TO_JSVAL(ret);
        JS_SET_RVAL(cx, vp, jsret);
        return JS_TRUE;
    }
    JS_ReportError(cx, "wrong number of arguments");
    return JS_FALSE;
}
开发者ID:wanghuan1115,项目名称:sdkbox-chartboost-sample,代码行数:17,代码来源:PluginChartboostJS.cpp


示例15: js_PluginAdColonyJS_PluginAdColony_setUserMetadata

bool js_PluginAdColonyJS_PluginAdColony_setUserMetadata(JSContext *cx, uint32_t argc, jsval *vp)
{
    JS::CallArgs args = JS::CallArgsFromVp(argc, vp);
    bool ok = true;
    if (argc == 2) {
        std::string arg0;
        std::string arg1;
        ok &= jsval_to_std_string(cx, args.get(0), &arg0);
        ok &= jsval_to_std_string(cx, args.get(1), &arg1);
        JSB_PRECONDITION2(ok, cx, false, "js_PluginAdColonyJS_PluginAdColony_setUserMetadata : Error processing arguments");
        sdkbox::PluginAdColony::setUserMetadata(arg0, arg1);
        args.rval().setUndefined();
        return true;
    }
    JS_ReportError(cx, "js_PluginAdColonyJS_PluginAdColony_setUserMetadata : wrong number of arguments");
    return false;
}
开发者ID:yinjimmy,项目名称:sdkbox-samples,代码行数:17,代码来源:PluginAdColonyJS.cpp


示例16: js_PluginAppodealJS_PluginAppodeal_setAutocache

bool js_PluginAppodealJS_PluginAppodeal_setAutocache(JSContext *cx, uint32_t argc, jsval *vp)
{
    JS::CallArgs args = JS::CallArgsFromVp(argc, vp);
    bool ok = true;
    if (argc == 2) {
        bool arg0;
        sdkbox::PluginAppodeal::AdType arg1;
        arg0 = JS::ToBoolean(args.get(0));
        ok &= jsval_to_int32(cx, args.get(1), (int32_t *)&arg1);
        JSB_PRECONDITION2(ok, cx, false, "js_PluginAppodealJS_PluginAppodeal_setAutocache : Error processing arguments");
        sdkbox::PluginAppodeal::setAutocache(arg0, arg1);
        args.rval().setUndefined();
        return true;
    }
    JS_ReportError(cx, "js_PluginAppodealJS_PluginAppodeal_setAutocache : wrong number of arguments");
    return false;
}
开发者ID:sdkbox,项目名称:sdkbox-sample-appodeal,代码行数:17,代码来源:PluginAppodealJS.cpp


示例17: js_autogentestbindings_SimpleNativeClass_getAnotherMoreComplexField

bool js_autogentestbindings_SimpleNativeClass_getAnotherMoreComplexField(JSContext *cx, uint32_t argc, jsval *vp)
{
	JSObject *obj = JS_THIS_OBJECT(cx, vp);
	js_proxy_t *proxy = jsb_get_js_proxy(obj);
	SimpleNativeClass* cobj = (SimpleNativeClass *)(proxy ? proxy->ptr : NULL);
	JSB_PRECONDITION2( cobj, cx, false, "js_autogentestbindings_SimpleNativeClass_getAnotherMoreComplexField : Invalid Native Object");
	if (argc == 0) {
		const char* ret = cobj->getAnotherMoreComplexField();
		jsval jsret = JSVAL_NULL;
		jsret = c_string_to_jsval(cx, ret);
		JS_SET_RVAL(cx, vp, jsret);
		return true;
	}

	JS_ReportError(cx, "js_autogentestbindings_SimpleNativeClass_getAnotherMoreComplexField : wrong number of arguments: %d, was expecting %d", argc, 0);
	return false;
}
开发者ID:MengYangHsu,项目名称:super-animation-samples,代码行数:17,代码来源:autogentestbindings.cpp


示例18: js_PluginAppodealJS_PluginAppodeal_showAd

bool js_PluginAppodealJS_PluginAppodeal_showAd(JSContext *cx, uint32_t argc, jsval *vp)
{
    JS::CallArgs args = JS::CallArgsFromVp(argc, vp);
    bool ok = true;
    if (argc == 1) {
        sdkbox::PluginAppodeal::ShowStyle arg0;
        ok &= jsval_to_int32(cx, args.get(0), (int32_t *)&arg0);
        JSB_PRECONDITION2(ok, cx, false, "js_PluginAppodealJS_PluginAppodeal_showAd : Error processing arguments");
        bool ret = sdkbox::PluginAppodeal::showAd(arg0);
        jsval jsret = JSVAL_NULL;
        jsret = BOOLEAN_TO_JSVAL(ret);
        args.rval().set(jsret);
        return true;
    }
    JS_ReportError(cx, "js_PluginAppodealJS_PluginAppodeal_showAd : wrong number of arguments");
    return false;
}
开发者ID:sdkbox,项目名称:sdkbox-sample-appodeal,代码行数:17,代码来源:PluginAppodealJS.cpp


示例19: js_util_FileStat_getFileSize

bool js_util_FileStat_getFileSize(JSContext *cx, uint32_t argc, jsval *vp)
{
    JS::CallArgs args = JS::CallArgsFromVp(argc, vp);
    //JS::RootedString appArgs(cx);
    if (argc == 0) {
        JS::RootedObject obj(cx, args.thisv().toObjectOrNull());
        js_proxy_t *proxy = jsb_get_js_proxy(obj);
        auto cobj = (Utils::FileStat *)(proxy ? proxy->ptr : NULL);
        JSB_PRECONDITION2( cobj, cx, false, "js_util_FileStat_getFileSize : Invalid Native Object");

        args.rval().setInt32(cobj->GetFileSize());
        return true;
    }

    JS_ReportError(cx, "js_util_FileStat_getFileSize : wrong number of arguments");
    return false;
}
开发者ID:wangxingfred,项目名称:SheetX,代码行数:17,代码来源:jsb_util.cpp


示例20: js_soomla_JSBinding_callNative

bool js_soomla_JSBinding_callNative(JSContext *cx, uint32_t argc, jsval *vp)
{
	jsval *argv = JS_ARGV(cx, vp);
	bool ok = true;
	if (argc == 1) {
		const char* arg0;
		std::string arg0_tmp; ok &= jsval_to_std_string(cx, argv[0], &arg0_tmp); arg0 = arg0_tmp.c_str();
		JSB_PRECONDITION2(ok, cx, false, "js_soomla_JSBinding_callNative : Error processing arguments");
		std::string ret = Soomla::JSBinding::callNative(arg0);
		jsval jsret = JSVAL_NULL;
		jsret = std_string_to_jsval(cx, ret);
		JS_SET_RVAL(cx, vp, jsret);
		return true;
	}
	JS_ReportError(cx, "js_soomla_JSBinding_callNative : wrong number of arguments");
	return false;
}
开发者ID:redmobile,项目名称:auto-generated,代码行数:17,代码来源:jsb_soomla_auto.cpp



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


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
C++ JSClassCreate函数代码示例发布时间:2022-05-30
下一篇:
C++ JPEG_MSG函数代码示例发布时间:2022-05-30
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap