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,12 +6039,12 @@ str
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @method renameFile
|
* @method renameFile
|
||||||
* @param {String} arg0
|
* @param {String|String} str
|
||||||
* @param {String} arg1
|
* @param {String|String} str
|
||||||
* @param {String} arg2
|
* @param {String} str
|
||||||
* @return {bool}
|
* @return {bool|bool}
|
||||||
*/
|
*/
|
||||||
renameFile : function (
|
renameFile : function(
|
||||||
str,
|
str,
|
||||||
str,
|
str,
|
||||||
str
|
str
|
||||||
|
|
|
@ -17087,26 +17087,49 @@ bool js_cocos2dx_FileUtils_renameFile(JSContext *cx, uint32_t argc, jsval *vp)
|
||||||
{
|
{
|
||||||
JS::CallArgs args = JS::CallArgsFromVp(argc, vp);
|
JS::CallArgs args = JS::CallArgsFromVp(argc, vp);
|
||||||
bool ok = true;
|
bool ok = true;
|
||||||
JS::RootedObject obj(cx, args.thisv().toObjectOrNull());
|
|
||||||
js_proxy_t *proxy = jsb_get_js_proxy(obj);
|
|
||||||
cocos2d::FileUtils* cobj = (cocos2d::FileUtils *)(proxy ? proxy->ptr : NULL);
|
|
||||||
JSB_PRECONDITION2( cobj, cx, false, "js_cocos2dx_FileUtils_renameFile : Invalid Native Object");
|
|
||||||
if (argc == 3) {
|
|
||||||
std::string arg0;
|
|
||||||
std::string arg1;
|
|
||||||
std::string arg2;
|
|
||||||
ok &= jsval_to_std_string(cx, args.get(0), &arg0);
|
|
||||||
ok &= jsval_to_std_string(cx, args.get(1), &arg1);
|
|
||||||
ok &= jsval_to_std_string(cx, args.get(2), &arg2);
|
|
||||||
JSB_PRECONDITION2(ok, cx, false, "js_cocos2dx_FileUtils_renameFile : Error processing arguments");
|
|
||||||
bool ret = cobj->renameFile(arg0, arg1, arg2);
|
|
||||||
jsval jsret = JSVAL_NULL;
|
|
||||||
jsret = BOOLEAN_TO_JSVAL(ret);
|
|
||||||
args.rval().set(jsret);
|
|
||||||
return true;
|
|
||||||
}
|
|
||||||
|
|
||||||
JS_ReportError(cx, "js_cocos2dx_FileUtils_renameFile : wrong number of arguments: %d, was expecting %d", argc, 3);
|
JS::RootedObject obj(cx);
|
||||||
|
cocos2d::FileUtils* cobj = NULL;
|
||||||
|
obj = args.thisv().toObjectOrNull();
|
||||||
|
js_proxy_t *proxy = jsb_get_js_proxy(obj);
|
||||||
|
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;
|
||||||
|
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);
|
||||||
|
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");
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
bool js_cocos2dx_FileUtils_loadFilenameLookupDictionaryFromFile(JSContext *cx, uint32_t argc, jsval *vp)
|
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("getStringFromFile", js_cocos2dx_FileUtils_getStringFromFile, 1, JSPROP_PERMANENT | JSPROP_ENUMERATE),
|
||||||
JS_FN("removeFile", js_cocos2dx_FileUtils_removeFile, 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("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("loadFilenameLookup", js_cocos2dx_FileUtils_loadFilenameLookupDictionaryFromFile, 1, JSPROP_PERMANENT | JSPROP_ENUMERATE),
|
||||||
JS_FN("isPopupNotify", js_cocos2dx_FileUtils_isPopupNotify, 0, 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),
|
JS_FN("getValueVectorFromFile", js_cocos2dx_FileUtils_getValueVectorFromFile, 1, JSPROP_PERMANENT | JSPROP_ENUMERATE),
|
||||||
|
|
|
@ -80,11 +80,8 @@
|
||||||
-- @return bool#bool ret (return value: bool)
|
-- @return bool#bool ret (return value: bool)
|
||||||
|
|
||||||
--------------------------------
|
--------------------------------
|
||||||
-- Renames a file under the given directory.<br>
|
-- @overload self, string, string
|
||||||
-- param path The parent directory path of the file, it must be an absolute path.<br>
|
-- @overload self, string, string, string
|
||||||
-- 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.
|
|
||||||
-- @function [parent=#FileUtils] renameFile
|
-- @function [parent=#FileUtils] renameFile
|
||||||
-- @param self
|
-- @param self
|
||||||
-- @param #string path
|
-- @param #string path
|
||||||
|
|
|
@ -27068,18 +27068,14 @@ int lua_cocos2dx_FileUtils_renameFile(lua_State* tolua_S)
|
||||||
int argc = 0;
|
int argc = 0;
|
||||||
cocos2d::FileUtils* cobj = nullptr;
|
cocos2d::FileUtils* cobj = nullptr;
|
||||||
bool ok = true;
|
bool ok = true;
|
||||||
|
|
||||||
#if COCOS2D_DEBUG >= 1
|
#if COCOS2D_DEBUG >= 1
|
||||||
tolua_Error tolua_err;
|
tolua_Error tolua_err;
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
|
||||||
#if COCOS2D_DEBUG >= 1
|
#if COCOS2D_DEBUG >= 1
|
||||||
if (!tolua_isusertype(tolua_S,1,"cc.FileUtils",0,&tolua_err)) goto tolua_lerror;
|
if (!tolua_isusertype(tolua_S,1,"cc.FileUtils",0,&tolua_err)) goto tolua_lerror;
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
cobj = (cocos2d::FileUtils*)tolua_tousertype(tolua_S,1,0);
|
cobj = (cocos2d::FileUtils*)tolua_tousertype(tolua_S,1,0);
|
||||||
|
|
||||||
#if COCOS2D_DEBUG >= 1
|
#if COCOS2D_DEBUG >= 1
|
||||||
if (!cobj)
|
if (!cobj)
|
||||||
{
|
{
|
||||||
|
@ -27087,29 +27083,44 @@ int lua_cocos2dx_FileUtils_renameFile(lua_State* tolua_S)
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
argc = lua_gettop(tolua_S)-1;
|
argc = lua_gettop(tolua_S)-1;
|
||||||
if (argc == 3)
|
do{
|
||||||
{
|
if (argc == 2) {
|
||||||
std::string arg0;
|
std::string arg0;
|
||||||
std::string arg1;
|
ok &= luaval_to_std_string(tolua_S, 2,&arg0, "cc.FileUtils:renameFile");
|
||||||
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, 3,&arg1, "cc.FileUtils:renameFile");
|
if (!ok) { break; }
|
||||||
|
bool ret = cobj->renameFile(arg0, arg1);
|
||||||
ok &= luaval_to_std_string(tolua_S, 4,&arg2, "cc.FileUtils:renameFile");
|
tolua_pushboolean(tolua_S,(bool)ret);
|
||||||
if(!ok)
|
return 1;
|
||||||
{
|
|
||||||
tolua_error(tolua_S,"invalid arguments in function 'lua_cocos2dx_FileUtils_renameFile'", nullptr);
|
|
||||||
return 0;
|
|
||||||
}
|
}
|
||||||
bool ret = cobj->renameFile(arg0, arg1, arg2);
|
}while(0);
|
||||||
tolua_pushboolean(tolua_S,(bool)ret);
|
ok = true;
|
||||||
return 1;
|
do{
|
||||||
}
|
if (argc == 3) {
|
||||||
luaL_error(tolua_S, "%s has wrong number of arguments: %d, was expecting %d \n", "cc.FileUtils:renameFile",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;
|
return 0;
|
||||||
|
|
||||||
#if COCOS2D_DEBUG >= 1
|
#if COCOS2D_DEBUG >= 1
|
||||||
|
|
Loading…
Reference in New Issue