mirror of https://github.com/axmolengine/axmol.git
[ci skip][AUTO]: updating luabinding & jsbinding automatically
This commit is contained in:
parent
6d5d6b3ecc
commit
9b003c9cfc
|
@ -6039,10 +6039,10 @@ str
|
|||
|
||||
/**
|
||||
* @method renameFile
|
||||
* @param {String} arg0
|
||||
* @param {String} arg1
|
||||
* @param {String} arg2
|
||||
* @return {bool}
|
||||
* @param {String|String} str
|
||||
* @param {String|String} str
|
||||
* @param {String} str
|
||||
* @return {bool|bool}
|
||||
*/
|
||||
renameFile : function(
|
||||
str,
|
||||
|
|
|
@ -17087,26 +17087,49 @@ bool js_cocos2dx_FileUtils_renameFile(JSContext *cx, uint32_t argc, jsval *vp)
|
|||
{
|
||||
JS::CallArgs args = JS::CallArgsFromVp(argc, vp);
|
||||
bool ok = true;
|
||||
JS::RootedObject obj(cx, args.thisv().toObjectOrNull());
|
||||
|
||||
JS::RootedObject obj(cx);
|
||||
cocos2d::FileUtils* cobj = NULL;
|
||||
obj = args.thisv().toObjectOrNull();
|
||||
js_proxy_t *proxy = jsb_get_js_proxy(obj);
|
||||
cocos2d::FileUtils* cobj = (cocos2d::FileUtils *)(proxy ? proxy->ptr : NULL);
|
||||
cobj = (cocos2d::FileUtils *)(proxy ? proxy->ptr : NULL);
|
||||
JSB_PRECONDITION2( cobj, cx, false, "js_cocos2dx_FileUtils_renameFile : Invalid Native Object");
|
||||
do {
|
||||
if (argc == 2) {
|
||||
std::string arg0;
|
||||
ok &= jsval_to_std_string(cx, args.get(0), &arg0);
|
||||
if (!ok) { ok = true; break; }
|
||||
std::string arg1;
|
||||
ok &= jsval_to_std_string(cx, args.get(1), &arg1);
|
||||
if (!ok) { ok = true; break; }
|
||||
bool ret = cobj->renameFile(arg0, arg1);
|
||||
jsval jsret = JSVAL_NULL;
|
||||
jsret = BOOLEAN_TO_JSVAL(ret);
|
||||
args.rval().set(jsret);
|
||||
return true;
|
||||
}
|
||||
} while(0);
|
||||
|
||||
do {
|
||||
if (argc == 3) {
|
||||
std::string arg0;
|
||||
std::string arg1;
|
||||
std::string arg2;
|
||||
ok &= jsval_to_std_string(cx, args.get(0), &arg0);
|
||||
if (!ok) { ok = true; break; }
|
||||
std::string arg1;
|
||||
ok &= jsval_to_std_string(cx, args.get(1), &arg1);
|
||||
if (!ok) { ok = true; break; }
|
||||
std::string arg2;
|
||||
ok &= jsval_to_std_string(cx, args.get(2), &arg2);
|
||||
JSB_PRECONDITION2(ok, cx, false, "js_cocos2dx_FileUtils_renameFile : Error processing arguments");
|
||||
if (!ok) { ok = true; break; }
|
||||
bool ret = cobj->renameFile(arg0, arg1, arg2);
|
||||
jsval jsret = JSVAL_NULL;
|
||||
jsret = BOOLEAN_TO_JSVAL(ret);
|
||||
args.rval().set(jsret);
|
||||
return true;
|
||||
}
|
||||
} while(0);
|
||||
|
||||
JS_ReportError(cx, "js_cocos2dx_FileUtils_renameFile : wrong number of arguments: %d, was expecting %d", argc, 3);
|
||||
JS_ReportError(cx, "js_cocos2dx_FileUtils_renameFile : wrong number of arguments");
|
||||
return false;
|
||||
}
|
||||
bool js_cocos2dx_FileUtils_loadFilenameLookupDictionaryFromFile(JSContext *cx, uint32_t argc, jsval *vp)
|
||||
|
@ -17791,7 +17814,7 @@ void js_register_cocos2dx_FileUtils(JSContext *cx, JS::HandleObject global) {
|
|||
JS_FN("getStringFromFile", js_cocos2dx_FileUtils_getStringFromFile, 1, JSPROP_PERMANENT | JSPROP_ENUMERATE),
|
||||
JS_FN("removeFile", js_cocos2dx_FileUtils_removeFile, 1, JSPROP_PERMANENT | JSPROP_ENUMERATE),
|
||||
JS_FN("isAbsolutePath", js_cocos2dx_FileUtils_isAbsolutePath, 1, JSPROP_PERMANENT | JSPROP_ENUMERATE),
|
||||
JS_FN("renameFile", js_cocos2dx_FileUtils_renameFile, 3, JSPROP_PERMANENT | JSPROP_ENUMERATE),
|
||||
JS_FN("renameFile", js_cocos2dx_FileUtils_renameFile, 2, JSPROP_PERMANENT | JSPROP_ENUMERATE),
|
||||
JS_FN("loadFilenameLookup", js_cocos2dx_FileUtils_loadFilenameLookupDictionaryFromFile, 1, JSPROP_PERMANENT | JSPROP_ENUMERATE),
|
||||
JS_FN("isPopupNotify", js_cocos2dx_FileUtils_isPopupNotify, 0, JSPROP_PERMANENT | JSPROP_ENUMERATE),
|
||||
JS_FN("getValueVectorFromFile", js_cocos2dx_FileUtils_getValueVectorFromFile, 1, JSPROP_PERMANENT | JSPROP_ENUMERATE),
|
||||
|
|
|
@ -80,11 +80,8 @@
|
|||
-- @return bool#bool ret (return value: bool)
|
||||
|
||||
--------------------------------
|
||||
-- Renames a file under the given directory.<br>
|
||||
-- param path The parent directory path of the file, it must be an absolute path.<br>
|
||||
-- param oldname The current name of the file.<br>
|
||||
-- param name The new name of the file.<br>
|
||||
-- return True if the file have been renamed successfully, false if not.
|
||||
-- @overload self, string, string
|
||||
-- @overload self, string, string, string
|
||||
-- @function [parent=#FileUtils] renameFile
|
||||
-- @param self
|
||||
-- @param #string path
|
||||
|
|
|
@ -27068,18 +27068,14 @@ int lua_cocos2dx_FileUtils_renameFile(lua_State* tolua_S)
|
|||
int argc = 0;
|
||||
cocos2d::FileUtils* cobj = nullptr;
|
||||
bool ok = true;
|
||||
|
||||
#if COCOS2D_DEBUG >= 1
|
||||
tolua_Error tolua_err;
|
||||
#endif
|
||||
|
||||
|
||||
#if COCOS2D_DEBUG >= 1
|
||||
if (!tolua_isusertype(tolua_S,1,"cc.FileUtils",0,&tolua_err)) goto tolua_lerror;
|
||||
#endif
|
||||
|
||||
cobj = (cocos2d::FileUtils*)tolua_tousertype(tolua_S,1,0);
|
||||
|
||||
#if COCOS2D_DEBUG >= 1
|
||||
if (!cobj)
|
||||
{
|
||||
|
@ -27087,28 +27083,43 @@ int lua_cocos2dx_FileUtils_renameFile(lua_State* tolua_S)
|
|||
return 0;
|
||||
}
|
||||
#endif
|
||||
|
||||
argc = lua_gettop(tolua_S)-1;
|
||||
if (argc == 3)
|
||||
{
|
||||
do{
|
||||
if (argc == 2) {
|
||||
std::string arg0;
|
||||
std::string arg1;
|
||||
std::string arg2;
|
||||
|
||||
ok &= luaval_to_std_string(tolua_S, 2,&arg0, "cc.FileUtils:renameFile");
|
||||
|
||||
if (!ok) { break; }
|
||||
std::string arg1;
|
||||
ok &= luaval_to_std_string(tolua_S, 3,&arg1, "cc.FileUtils:renameFile");
|
||||
|
||||
ok &= luaval_to_std_string(tolua_S, 4,&arg2, "cc.FileUtils:renameFile");
|
||||
if(!ok)
|
||||
{
|
||||
tolua_error(tolua_S,"invalid arguments in function 'lua_cocos2dx_FileUtils_renameFile'", nullptr);
|
||||
return 0;
|
||||
if (!ok) { break; }
|
||||
bool ret = cobj->renameFile(arg0, arg1);
|
||||
tolua_pushboolean(tolua_S,(bool)ret);
|
||||
return 1;
|
||||
}
|
||||
}while(0);
|
||||
ok = true;
|
||||
do{
|
||||
if (argc == 3) {
|
||||
std::string arg0;
|
||||
ok &= luaval_to_std_string(tolua_S, 2,&arg0, "cc.FileUtils:renameFile");
|
||||
|
||||
if (!ok) { break; }
|
||||
std::string arg1;
|
||||
ok &= luaval_to_std_string(tolua_S, 3,&arg1, "cc.FileUtils:renameFile");
|
||||
|
||||
if (!ok) { break; }
|
||||
std::string arg2;
|
||||
ok &= luaval_to_std_string(tolua_S, 4,&arg2, "cc.FileUtils:renameFile");
|
||||
|
||||
if (!ok) { break; }
|
||||
bool ret = cobj->renameFile(arg0, arg1, arg2);
|
||||
tolua_pushboolean(tolua_S,(bool)ret);
|
||||
return 1;
|
||||
}
|
||||
}while(0);
|
||||
ok = true;
|
||||
luaL_error(tolua_S, "%s has wrong number of arguments: %d, was expecting %d \n", "cc.FileUtils:renameFile",argc, 3);
|
||||
return 0;
|
||||
|
||||
|
|
Loading…
Reference in New Issue