mirror of https://github.com/axmolengine/axmol.git
[ci skip][AUTO]: updating luabinding & jsbinding & cocos_file.json automatically (#16880)
This commit is contained in:
parent
0d0dd05287
commit
18204c1e37
|
@ -7159,6 +7159,18 @@ str
|
||||||
return false;
|
return false;
|
||||||
},
|
},
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @method getNewFilename
|
||||||
|
* @param {String} arg0
|
||||||
|
* @return {String}
|
||||||
|
*/
|
||||||
|
getNewFilename : function (
|
||||||
|
str
|
||||||
|
)
|
||||||
|
{
|
||||||
|
return ;
|
||||||
|
},
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @method getValueMapFromFile
|
* @method getValueMapFromFile
|
||||||
* @param {String} arg0
|
* @param {String} arg0
|
||||||
|
|
|
@ -18943,6 +18943,28 @@ bool js_cocos2dx_FileUtils_writeToFile(JSContext *cx, uint32_t argc, jsval *vp)
|
||||||
JS_ReportError(cx, "js_cocos2dx_FileUtils_writeToFile : wrong number of arguments: %d, was expecting %d", argc, 2);
|
JS_ReportError(cx, "js_cocos2dx_FileUtils_writeToFile : wrong number of arguments: %d, was expecting %d", argc, 2);
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
bool js_cocos2dx_FileUtils_getNewFilename(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_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_getNewFilename : Invalid Native Object");
|
||||||
|
if (argc == 1) {
|
||||||
|
std::string arg0;
|
||||||
|
ok &= jsval_to_std_string(cx, args.get(0), &arg0);
|
||||||
|
JSB_PRECONDITION2(ok, cx, false, "js_cocos2dx_FileUtils_getNewFilename : Error processing arguments");
|
||||||
|
std::string ret = cobj->getNewFilename(arg0);
|
||||||
|
jsval jsret = JSVAL_NULL;
|
||||||
|
jsret = std_string_to_jsval(cx, ret);
|
||||||
|
args.rval().set(jsret);
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
|
JS_ReportError(cx, "js_cocos2dx_FileUtils_getNewFilename : wrong number of arguments: %d, was expecting %d", argc, 1);
|
||||||
|
return false;
|
||||||
|
}
|
||||||
bool js_cocos2dx_FileUtils_getValueMapFromFile(JSContext *cx, uint32_t argc, jsval *vp)
|
bool js_cocos2dx_FileUtils_getValueMapFromFile(JSContext *cx, uint32_t argc, jsval *vp)
|
||||||
{
|
{
|
||||||
JS::CallArgs args = JS::CallArgsFromVp(argc, vp);
|
JS::CallArgs args = JS::CallArgsFromVp(argc, vp);
|
||||||
|
@ -19522,6 +19544,7 @@ void js_register_cocos2dx_FileUtils(JSContext *cx, JS::HandleObject global) {
|
||||||
JS_FN("getValueVectorFromFile", js_cocos2dx_FileUtils_getValueVectorFromFile, 1, JSPROP_PERMANENT | JSPROP_ENUMERATE),
|
JS_FN("getValueVectorFromFile", js_cocos2dx_FileUtils_getValueVectorFromFile, 1, JSPROP_PERMANENT | JSPROP_ENUMERATE),
|
||||||
JS_FN("getSearchPaths", js_cocos2dx_FileUtils_getSearchPaths, 0, JSPROP_PERMANENT | JSPROP_ENUMERATE),
|
JS_FN("getSearchPaths", js_cocos2dx_FileUtils_getSearchPaths, 0, JSPROP_PERMANENT | JSPROP_ENUMERATE),
|
||||||
JS_FN("writeToFile", js_cocos2dx_FileUtils_writeToFile, 2, JSPROP_PERMANENT | JSPROP_ENUMERATE),
|
JS_FN("writeToFile", js_cocos2dx_FileUtils_writeToFile, 2, JSPROP_PERMANENT | JSPROP_ENUMERATE),
|
||||||
|
JS_FN("getNewFilename", js_cocos2dx_FileUtils_getNewFilename, 1, JSPROP_PERMANENT | JSPROP_ENUMERATE),
|
||||||
JS_FN("getValueMapFromFile", js_cocos2dx_FileUtils_getValueMapFromFile, 1, JSPROP_PERMANENT | JSPROP_ENUMERATE),
|
JS_FN("getValueMapFromFile", js_cocos2dx_FileUtils_getValueMapFromFile, 1, JSPROP_PERMANENT | JSPROP_ENUMERATE),
|
||||||
JS_FN("getFileSize", js_cocos2dx_FileUtils_getFileSize, 1, JSPROP_PERMANENT | JSPROP_ENUMERATE),
|
JS_FN("getFileSize", js_cocos2dx_FileUtils_getFileSize, 1, JSPROP_PERMANENT | JSPROP_ENUMERATE),
|
||||||
JS_FN("getValueMapFromData", js_cocos2dx_FileUtils_getValueMapFromData, 2, JSPROP_PERMANENT | JSPROP_ENUMERATE),
|
JS_FN("getValueMapFromData", js_cocos2dx_FileUtils_getValueMapFromData, 2, JSPROP_PERMANENT | JSPROP_ENUMERATE),
|
||||||
|
|
|
@ -1051,6 +1051,7 @@ bool js_cocos2dx_FileUtils_isPopupNotify(JSContext *cx, uint32_t argc, jsval *vp
|
||||||
bool js_cocos2dx_FileUtils_getValueVectorFromFile(JSContext *cx, uint32_t argc, jsval *vp);
|
bool js_cocos2dx_FileUtils_getValueVectorFromFile(JSContext *cx, uint32_t argc, jsval *vp);
|
||||||
bool js_cocos2dx_FileUtils_getSearchPaths(JSContext *cx, uint32_t argc, jsval *vp);
|
bool js_cocos2dx_FileUtils_getSearchPaths(JSContext *cx, uint32_t argc, jsval *vp);
|
||||||
bool js_cocos2dx_FileUtils_writeToFile(JSContext *cx, uint32_t argc, jsval *vp);
|
bool js_cocos2dx_FileUtils_writeToFile(JSContext *cx, uint32_t argc, jsval *vp);
|
||||||
|
bool js_cocos2dx_FileUtils_getNewFilename(JSContext *cx, uint32_t argc, jsval *vp);
|
||||||
bool js_cocos2dx_FileUtils_getValueMapFromFile(JSContext *cx, uint32_t argc, jsval *vp);
|
bool js_cocos2dx_FileUtils_getValueMapFromFile(JSContext *cx, uint32_t argc, jsval *vp);
|
||||||
bool js_cocos2dx_FileUtils_getFileSize(JSContext *cx, uint32_t argc, jsval *vp);
|
bool js_cocos2dx_FileUtils_getFileSize(JSContext *cx, uint32_t argc, jsval *vp);
|
||||||
bool js_cocos2dx_FileUtils_getValueMapFromData(JSContext *cx, uint32_t argc, jsval *vp);
|
bool js_cocos2dx_FileUtils_getValueMapFromData(JSContext *cx, uint32_t argc, jsval *vp);
|
||||||
|
|
|
@ -157,6 +157,17 @@
|
||||||
-- @param #string fullPath
|
-- @param #string fullPath
|
||||||
-- @return bool#bool ret (return value: bool)
|
-- @return bool#bool ret (return value: bool)
|
||||||
|
|
||||||
|
--------------------------------
|
||||||
|
-- Gets the new filename from the filename lookup dictionary.<br>
|
||||||
|
-- It is possible to have a override names.<br>
|
||||||
|
-- param filename The original filename.<br>
|
||||||
|
-- return The new filename after searching in the filename lookup dictionary.<br>
|
||||||
|
-- If the original filename wasn't in the dictionary, it will return the original filename.
|
||||||
|
-- @function [parent=#FileUtils] getNewFilename
|
||||||
|
-- @param self
|
||||||
|
-- @param #string filename
|
||||||
|
-- @return string#string ret (return value: string)
|
||||||
|
|
||||||
--------------------------------
|
--------------------------------
|
||||||
-- Converts the contents of a file to a ValueMap.<br>
|
-- Converts the contents of a file to a ValueMap.<br>
|
||||||
-- param filename The filename of the file to gets content.<br>
|
-- param filename The filename of the file to gets content.<br>
|
||||||
|
|
|
@ -33095,6 +33095,56 @@ int lua_cocos2dx_FileUtils_writeToFile(lua_State* tolua_S)
|
||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
int lua_cocos2dx_FileUtils_getNewFilename(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)
|
||||||
|
{
|
||||||
|
tolua_error(tolua_S,"invalid 'cobj' in function 'lua_cocos2dx_FileUtils_getNewFilename'", nullptr);
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
#endif
|
||||||
|
|
||||||
|
argc = lua_gettop(tolua_S)-1;
|
||||||
|
if (argc == 1)
|
||||||
|
{
|
||||||
|
std::string arg0;
|
||||||
|
|
||||||
|
ok &= luaval_to_std_string(tolua_S, 2,&arg0, "cc.FileUtils:getNewFilename");
|
||||||
|
if(!ok)
|
||||||
|
{
|
||||||
|
tolua_error(tolua_S,"invalid arguments in function 'lua_cocos2dx_FileUtils_getNewFilename'", nullptr);
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
std::string ret = cobj->getNewFilename(arg0);
|
||||||
|
tolua_pushcppstring(tolua_S,ret);
|
||||||
|
return 1;
|
||||||
|
}
|
||||||
|
luaL_error(tolua_S, "%s has wrong number of arguments: %d, was expecting %d \n", "cc.FileUtils:getNewFilename",argc, 1);
|
||||||
|
return 0;
|
||||||
|
|
||||||
|
#if COCOS2D_DEBUG >= 1
|
||||||
|
tolua_lerror:
|
||||||
|
tolua_error(tolua_S,"#ferror in function 'lua_cocos2dx_FileUtils_getNewFilename'.",&tolua_err);
|
||||||
|
#endif
|
||||||
|
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
int lua_cocos2dx_FileUtils_getValueMapFromFile(lua_State* tolua_S)
|
int lua_cocos2dx_FileUtils_getValueMapFromFile(lua_State* tolua_S)
|
||||||
{
|
{
|
||||||
int argc = 0;
|
int argc = 0;
|
||||||
|
@ -34376,6 +34426,7 @@ int lua_register_cocos2dx_FileUtils(lua_State* tolua_S)
|
||||||
tolua_function(tolua_S,"getValueVectorFromFile",lua_cocos2dx_FileUtils_getValueVectorFromFile);
|
tolua_function(tolua_S,"getValueVectorFromFile",lua_cocos2dx_FileUtils_getValueVectorFromFile);
|
||||||
tolua_function(tolua_S,"getSearchPaths",lua_cocos2dx_FileUtils_getSearchPaths);
|
tolua_function(tolua_S,"getSearchPaths",lua_cocos2dx_FileUtils_getSearchPaths);
|
||||||
tolua_function(tolua_S,"writeToFile",lua_cocos2dx_FileUtils_writeToFile);
|
tolua_function(tolua_S,"writeToFile",lua_cocos2dx_FileUtils_writeToFile);
|
||||||
|
tolua_function(tolua_S,"getNewFilename",lua_cocos2dx_FileUtils_getNewFilename);
|
||||||
tolua_function(tolua_S,"getValueMapFromFile",lua_cocos2dx_FileUtils_getValueMapFromFile);
|
tolua_function(tolua_S,"getValueMapFromFile",lua_cocos2dx_FileUtils_getValueMapFromFile);
|
||||||
tolua_function(tolua_S,"getFileSize",lua_cocos2dx_FileUtils_getFileSize);
|
tolua_function(tolua_S,"getFileSize",lua_cocos2dx_FileUtils_getFileSize);
|
||||||
tolua_function(tolua_S,"getValueMapFromData",lua_cocos2dx_FileUtils_getValueMapFromData);
|
tolua_function(tolua_S,"getValueMapFromData",lua_cocos2dx_FileUtils_getValueMapFromData);
|
||||||
|
|
|
@ -2237,6 +2237,7 @@ int register_all_cocos2dx(lua_State* tolua_S);
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
#endif // __cocos2dx_h__
|
#endif // __cocos2dx_h__
|
||||||
|
|
Loading…
Reference in New Issue