diff --git a/frameworks/cclua/src/box2d/box2d-2dx.h b/frameworks/cclua/src/box2d/box2d-2dx.h index 8e543711..5d385141 100644 --- a/frameworks/cclua/src/box2d/box2d-2dx.h +++ b/frameworks/cclua/src/box2d/box2d-2dx.h @@ -12,7 +12,7 @@ NS_BOX2D_BEGIN -typedef olua::array Vec2Array; +typedef olua::pointer Vec2Array; class DestructionListener : public b2DestructionListener { diff --git a/frameworks/cclua/src/cclua/cclua-extend.h b/frameworks/cclua/src/cclua/cclua-extend.h index 19fcaded..1b2ce643 100644 --- a/frameworks/cclua/src/cclua/cclua-extend.h +++ b/frameworks/cclua/src/cclua/cclua-extend.h @@ -16,7 +16,7 @@ typedef olua::pointer> VectorString; typedef olua::pointer> VectorInt; typedef olua::pointer ValueMap; typedef olua::pointer TMXTileFlags; -typedef olua::array Vec2Array; +typedef olua::pointer Vec2Array; } struct Bounds { diff --git a/frameworks/cclua/src/cclua/luauser.h b/frameworks/cclua/src/cclua/luauser.h index 5379201c..2a74a528 100644 --- a/frameworks/cclua/src/cclua/luauser.h +++ b/frameworks/cclua/src/cclua/luauser.h @@ -38,16 +38,16 @@ template void olua_insert_map(cocos2d::Map &map, const K &key, const V &value); template -void olua_insert_vector(cocos2d::Vector &array, const T &value); +void olua_insert_array(cocos2d::Vector &array, const T &value); // spine #ifdef CCLUA_BUILD_SPINE #include "spine/Vector.h" template -void olua_insert_vector(spine::Vector &array, const T &value); +void olua_insert_array(spine::Vector &array, const T &value); template -void olua_foreach_vector(const spine::Vector &array, const std::function &callback); +void olua_foreach_array(const spine::Vector &array, const std::function &callback); #endif // CCLUA_BUILD_SPINE #endif // __cplusplus diff --git a/frameworks/cclua/src/lua-bindings/lua_box2d.cpp b/frameworks/cclua/src/lua-bindings/lua_box2d.cpp index 5bdba956..08014a32 100644 --- a/frameworks/cclua/src/lua-bindings/lua_box2d.cpp +++ b/frameworks/cclua/src/lua-bindings/lua_box2d.cpp @@ -2421,6 +2421,26 @@ static int _box2d_Vec2Array___olua_move(lua_State *L) return 1; } +static int _box2d_Vec2Array_assign(lua_State *L) +{ + olua_startinvoke(L); + + box2d::Vec2Array *self = nullptr; + const char *arg1 = nullptr; /** data */ + size_t arg2 = 0; /** len */ + + olua_to_object(L, 1, &self, "b2.Vec2Array"); + olua_check_string(L, 2, &arg1); + olua_check_integer(L, 3, &arg2); + + // void assign(const char *data, size_t len) + self->assign(arg1, arg2); + + olua_endinvoke(L); + + return 0; +} + static int _box2d_Vec2Array_create$1(lua_State *L) { olua_startinvoke(L); @@ -2478,23 +2498,72 @@ static int _box2d_Vec2Array_create(lua_State *L) return 0; } -static int _box2d_Vec2Array_setstring(lua_State *L) +static int _box2d_Vec2Array_slice$1(lua_State *L) { olua_startinvoke(L); box2d::Vec2Array *self = nullptr; - const char *arg1 = nullptr; /** data */ - size_t arg2 = 0; /** len */ + size_t arg1 = 0; /** from */ + size_t arg2 = 0; /** to */ olua_to_object(L, 1, &self, "b2.Vec2Array"); - olua_check_string(L, 2, &arg1); + olua_check_integer(L, 2, &arg1); olua_check_integer(L, 3, &arg2); - // void setstring(const char *data, size_t len) - self->setstring(arg1, arg2); + // @postnew box2d::Vec2Array *slice(size_t from, @optional size_t to) + box2d::Vec2Array *ret = self->slice(arg1, arg2); + int num_ret = olua_push_object(L, ret, "b2.Vec2Array"); + + // insert code after call + olua_postnew(L, ret); olua_endinvoke(L); + return num_ret; +} + +static int _box2d_Vec2Array_slice$2(lua_State *L) +{ + olua_startinvoke(L); + + box2d::Vec2Array *self = nullptr; + size_t arg1 = 0; /** from */ + + olua_to_object(L, 1, &self, "b2.Vec2Array"); + olua_check_integer(L, 2, &arg1); + + // @postnew box2d::Vec2Array *slice(size_t from, @optional size_t to) + box2d::Vec2Array *ret = self->slice(arg1); + int num_ret = olua_push_object(L, ret, "b2.Vec2Array"); + + // insert code after call + olua_postnew(L, ret); + + olua_endinvoke(L); + + return num_ret; +} + +static int _box2d_Vec2Array_slice(lua_State *L) +{ + int num_args = lua_gettop(L) - 1; + + if (num_args == 1) { + // if ((olua_is_integer(L, 2))) { + // @postnew box2d::Vec2Array *slice(size_t from, @optional size_t to) + return _box2d_Vec2Array_slice$2(L); + // } + } + + if (num_args == 2) { + // if ((olua_is_integer(L, 2)) && (olua_is_integer(L, 3))) { + // @postnew box2d::Vec2Array *slice(size_t from, @optional size_t to) + return _box2d_Vec2Array_slice$1(L); + // } + } + + luaL_error(L, "method 'box2d::Vec2Array::slice' not support '%d' arguments", num_args); + return 0; } @@ -2602,23 +2671,6 @@ static int _box2d_Vec2Array_tostring(lua_State *L) return (int)ret; } -static int _box2d_Vec2Array_data(lua_State *L) -{ - olua_startinvoke(L); - - box2d::Vec2Array *self = nullptr; - - olua_to_object(L, 1, &self, "b2.Vec2Array"); - - // @getter @name(data) b2Vec2 *data() - b2Vec2 *ret = self->data(); - int num_ret = olua_push_object(L, ret, "b2.Vec2"); - - olua_endinvoke(L); - - return num_ret; -} - static int _box2d_Vec2Array_length(lua_State *L) { olua_startinvoke(L); @@ -2695,12 +2747,12 @@ OLUA_LIB int luaopen_box2d_Vec2Array(lua_State *L) oluacls_func(L, "__index", _box2d_Vec2Array___index); oluacls_func(L, "__newindex", _box2d_Vec2Array___newindex); oluacls_func(L, "__olua_move", _box2d_Vec2Array___olua_move); + oluacls_func(L, "assign", _box2d_Vec2Array_assign); oluacls_func(L, "new", _box2d_Vec2Array_create); - oluacls_func(L, "setstring", _box2d_Vec2Array_setstring); + oluacls_func(L, "slice", _box2d_Vec2Array_slice); oluacls_func(L, "sub", _box2d_Vec2Array_sub); oluacls_func(L, "take", _box2d_Vec2Array_take); oluacls_func(L, "tostring", _box2d_Vec2Array_tostring); - oluacls_prop(L, "data", _box2d_Vec2Array_data, nullptr); oluacls_prop(L, "length", _box2d_Vec2Array_length, _box2d_Vec2Array_length); oluacls_prop(L, "rawdata", _box2d_Vec2Array_rawdata, nullptr); oluacls_prop(L, "sizeof", _box2d_Vec2Array_size, nullptr); diff --git a/frameworks/cclua/src/lua-bindings/lua_cclua.cpp b/frameworks/cclua/src/lua-bindings/lua_cclua.cpp index 5d009d2e..c7a9b4a2 100644 --- a/frameworks/cclua/src/lua-bindings/lua_cclua.cpp +++ b/frameworks/cclua/src/lua-bindings/lua_cclua.cpp @@ -930,7 +930,7 @@ static int _cclua_runtime_getArgs(lua_State *L) // static const std::vector &getArgs() const std::vector &ret = cclua::runtime::getArgs(); - int num_ret = olua_push_vector(L, ret, [L](std::string &arg1) { + int num_ret = olua_push_array(L, ret, [L](std::string &arg1) { olua_push_string(L, arg1); }); diff --git a/frameworks/cclua/src/lua-bindings/lua_cocos2d.cpp b/frameworks/cclua/src/lua-bindings/lua_cocos2d.cpp index 1d292eee..0a6dc4a7 100644 --- a/frameworks/cclua/src/lua-bindings/lua_cocos2d.cpp +++ b/frameworks/cclua/src/lua-bindings/lua_cocos2d.cpp @@ -3024,7 +3024,7 @@ static int _cocos2d_Scheduler_pauseAllTargets(lua_State *L) // std::set pauseAllTargets() std::set ret = self->pauseAllTargets(); - int num_ret = olua_push_vector(L, ret, [L](void *arg1) { + int num_ret = olua_push_array(L, ret, [L](void *arg1) { olua_push_object(L, arg1, "void *"); }); @@ -3045,7 +3045,7 @@ static int _cocos2d_Scheduler_pauseAllTargetsWithMinPriority(lua_State *L) // std::set pauseAllTargetsWithMinPriority(int minPriority) std::set ret = self->pauseAllTargetsWithMinPriority(arg1); - int num_ret = olua_push_vector(L, ret, [L](void *arg1) { + int num_ret = olua_push_array(L, ret, [L](void *arg1) { olua_push_object(L, arg1, "void *"); }); @@ -3114,7 +3114,7 @@ static int _cocos2d_Scheduler_resumeTargets(lua_State *L) std::set arg1; /** targetsToResume */ olua_to_object(L, 1, &self, "cc.Scheduler"); - olua_check_vector(L, 2, arg1, [L](void **arg1) { + olua_check_array(L, 2, arg1, [L](void **arg1) { olua_check_object(L, -1, arg1, "void *"); }); @@ -4698,7 +4698,7 @@ static int _cocos2d_EventListenerTouchAllAtOnce_set_onTouchesBegan(lua_State *L) int top = lua_gettop(L); size_t last = olua_push_objpool(L); olua_enable_objpool(L); - olua_push_vector(L, arg1, [L](cocos2d::Touch *arg1) { + olua_push_array(L, arg1, [L](cocos2d::Touch *arg1) { olua_push_object(L, arg1, "cc.Touch"); }); olua_push_object(L, arg2, "cc.Event"); @@ -4771,7 +4771,7 @@ static int _cocos2d_EventListenerTouchAllAtOnce_set_onTouchesCancelled(lua_State int top = lua_gettop(L); size_t last = olua_push_objpool(L); olua_enable_objpool(L); - olua_push_vector(L, arg1, [L](cocos2d::Touch *arg1) { + olua_push_array(L, arg1, [L](cocos2d::Touch *arg1) { olua_push_object(L, arg1, "cc.Touch"); }); olua_push_object(L, arg2, "cc.Event"); @@ -4844,7 +4844,7 @@ static int _cocos2d_EventListenerTouchAllAtOnce_set_onTouchesEnded(lua_State *L) int top = lua_gettop(L); size_t last = olua_push_objpool(L); olua_enable_objpool(L); - olua_push_vector(L, arg1, [L](cocos2d::Touch *arg1) { + olua_push_array(L, arg1, [L](cocos2d::Touch *arg1) { olua_push_object(L, arg1, "cc.Touch"); }); olua_push_object(L, arg2, "cc.Event"); @@ -4917,7 +4917,7 @@ static int _cocos2d_EventListenerTouchAllAtOnce_set_onTouchesMoved(lua_State *L) int top = lua_gettop(L); size_t last = olua_push_objpool(L); olua_enable_objpool(L); - olua_push_vector(L, arg1, [L](cocos2d::Touch *arg1) { + olua_push_array(L, arg1, [L](cocos2d::Touch *arg1) { olua_push_object(L, arg1, "cc.Touch"); }); olua_push_object(L, arg2, "cc.Event"); @@ -6540,7 +6540,7 @@ static int _cocos2d_EventTouch_getTouches(lua_State *L) // const std::vector &getTouches() const std::vector &ret = self->getTouches(); - int num_ret = olua_push_vector(L, ret, [L](cocos2d::Touch *arg1) { + int num_ret = olua_push_array(L, ret, [L](cocos2d::Touch *arg1) { olua_push_object(L, arg1, "cc.Touch"); }); @@ -6589,7 +6589,7 @@ static int _cocos2d_EventTouch_setTouches(lua_State *L) std::vector arg1; /** touches */ olua_to_object(L, 1, &self, "cc.EventTouch"); - olua_check_vector(L, 2, arg1, [L](cocos2d::Touch **arg1) { + olua_check_array(L, 2, arg1, [L](cocos2d::Touch **arg1) { olua_check_object(L, -1, arg1, "cc.Touch"); }); @@ -7797,7 +7797,7 @@ static int _cocos2d_Controller_getAllController(lua_State *L) // static const std::vector &getAllController() const std::vector &ret = cocos2d::Controller::getAllController(); - int num_ret = olua_push_vector(L, ret, [L](cocos2d::Controller *arg1) { + int num_ret = olua_push_array(L, ret, [L](cocos2d::Controller *arg1) { olua_push_object(L, arg1, "cc.Controller"); }); @@ -9946,7 +9946,7 @@ static int _cocos2d_FileUtils_getFileDataFromZip$1(lua_State *L) olua_to_object(L, 1, &self, "cc.FileUtils"); olua_check_string(L, 2, &arg1); olua_check_string(L, 3, &arg2); - olua_check_array(L, 4, &arg3, "olua.ssize_t"); + olua_check_pointer(L, 4, &arg3, "olua.ssize_t"); // unsigned char *getFileDataFromZip(const std::string &zipFilePath, const std::string &filename, ssize_t *size) unsigned char *ret = self->getFileDataFromZip(arg1, arg2, arg3); @@ -9983,7 +9983,7 @@ static int _cocos2d_FileUtils_getFileDataFromZip(lua_State *L) int num_args = lua_gettop(L) - 1; if (num_args == 3) { - if ((olua_is_string(L, 2)) && (olua_is_string(L, 3)) && (olua_is_array(L, 4, "olua.ssize_t"))) { + if ((olua_is_string(L, 2)) && (olua_is_string(L, 3)) && (olua_is_pointer(L, 4, "olua.ssize_t"))) { // unsigned char *getFileDataFromZip(const std::string &zipFilePath, const std::string &filename, ssize_t *size) return _cocos2d_FileUtils_getFileDataFromZip$1(L); } @@ -10162,7 +10162,7 @@ static int _cocos2d_FileUtils_getOriginalSearchPaths(lua_State *L) // const std::vector getOriginalSearchPaths() const std::vector ret = self->getOriginalSearchPaths(); - int num_ret = olua_push_vector(L, ret, [L](std::string &arg1) { + int num_ret = olua_push_array(L, ret, [L](std::string &arg1) { olua_push_string(L, arg1); }); @@ -10181,7 +10181,7 @@ static int _cocos2d_FileUtils_getSearchPaths(lua_State *L) // const std::vector getSearchPaths() const std::vector ret = self->getSearchPaths(); - int num_ret = olua_push_vector(L, ret, [L](std::string &arg1) { + int num_ret = olua_push_array(L, ret, [L](std::string &arg1) { olua_push_string(L, arg1); }); @@ -10200,7 +10200,7 @@ static int _cocos2d_FileUtils_getSearchResolutionsOrder(lua_State *L) // const std::vector getSearchResolutionsOrder() const std::vector ret = self->getSearchResolutionsOrder(); - int num_ret = olua_push_vector(L, ret, [L](std::string &arg1) { + int num_ret = olua_push_array(L, ret, [L](std::string &arg1) { olua_push_string(L, arg1); }); @@ -10598,7 +10598,7 @@ static int _cocos2d_FileUtils_listFiles(lua_State *L) // std::vector listFiles(const std::string &dirPath) std::vector ret = self->listFiles(arg1); - int num_ret = olua_push_vector(L, ret, [L](std::string &arg1) { + int num_ret = olua_push_array(L, ret, [L](std::string &arg1) { olua_push_string(L, arg1); }); @@ -10631,7 +10631,7 @@ static int _cocos2d_FileUtils_listFilesAsync(lua_State *L) int top = lua_gettop(L); size_t last = olua_push_objpool(L); olua_enable_objpool(L); - olua_push_vector(L, arg1, [L](std::string &arg1) { + olua_push_array(L, arg1, [L](std::string &arg1) { olua_push_string(L, arg1); }); olua_disable_objpool(L); @@ -10698,7 +10698,7 @@ static int _cocos2d_FileUtils_listFilesRecursivelyAsync(lua_State *L) int top = lua_gettop(L); size_t last = olua_push_objpool(L); olua_enable_objpool(L); - olua_push_vector(L, arg1, [L](std::string &arg1) { + olua_push_array(L, arg1, [L](std::string &arg1) { olua_push_string(L, arg1); }); olua_disable_objpool(L); @@ -11162,7 +11162,7 @@ static int _cocos2d_FileUtils_setSearchPaths(lua_State *L) std::vector arg1; /** searchPaths */ olua_to_object(L, 1, &self, "cc.FileUtils"); - olua_check_vector(L, 2, arg1, [L](std::string *arg1) { + olua_check_array(L, 2, arg1, [L](std::string *arg1) { olua_check_string(L, -1, arg1); }); @@ -11182,7 +11182,7 @@ static int _cocos2d_FileUtils_setSearchResolutionsOrder(lua_State *L) std::vector arg1; /** searchResolutionsOrder */ olua_to_object(L, 1, &self, "cc.FileUtils"); - olua_check_vector(L, 2, arg1, [L](std::string *arg1) { + olua_check_array(L, 2, arg1, [L](std::string *arg1) { olua_check_string(L, -1, arg1); }); @@ -11688,7 +11688,7 @@ static int _cocos2d_GLView_getAllTouches(lua_State *L) // std::vector getAllTouches() std::vector ret = self->getAllTouches(); - int num_ret = olua_push_vector(L, ret, [L](cocos2d::Touch *arg1) { + int num_ret = olua_push_array(L, ret, [L](cocos2d::Touch *arg1) { olua_push_object(L, arg1, "cc.Touch"); }); @@ -12225,7 +12225,7 @@ static int _cocos2d_GLView_setIcon$2(lua_State *L) std::vector arg1; /** filelist */ olua_to_object(L, 1, &self, "cc.GLView"); - olua_check_vector(L, 2, arg1, [L](std::string *arg1) { + olua_check_array(L, 2, arg1, [L](std::string *arg1) { olua_check_string(L, -1, arg1); }); @@ -12247,7 +12247,7 @@ static int _cocos2d_GLView_setIcon(lua_State *L) return _cocos2d_GLView_setIcon$1(L); } - // if ((olua_is_vector(L, 2))) { + // if ((olua_is_array(L, 2))) { // void setIcon(const std::vector &filelist) return _cocos2d_GLView_setIcon$2(L); // } @@ -14332,7 +14332,7 @@ static int _cocos2d_Material_getTechniques(lua_State *L) // const cocos2d::Vector &getTechniques() const cocos2d::Vector &ret = self->getTechniques(); - int num_ret = olua_push_vector(L, ret, [L](cocos2d::Technique *arg1) { + int num_ret = olua_push_array(L, ret, [L](cocos2d::Technique *arg1) { olua_push_object(L, arg1, "cc.Technique"); }); @@ -18777,7 +18777,7 @@ static int _cocos2d_TextureAtlas_getIndices(lua_State *L) // unsigned short *getIndices() unsigned short *ret = self->getIndices(); - int num_ret = olua_push_array(L, ret, "olua.ushort"); + int num_ret = olua_push_pointer(L, ret, "olua.ushort"); olua_endinvoke(L); @@ -19963,7 +19963,7 @@ static int _cocos2d_ActionManager_pauseAllRunningActions(lua_State *L) // cocos2d::Vector pauseAllRunningActions() cocos2d::Vector ret = self->pauseAllRunningActions(); - int num_ret = olua_push_vector(L, ret, [L](cocos2d::Node *arg1) { + int num_ret = olua_push_array(L, ret, [L](cocos2d::Node *arg1) { olua_push_object(L, arg1, "cc.Node"); }); @@ -20128,7 +20128,7 @@ static int _cocos2d_ActionManager_resumeTargets(lua_State *L) cocos2d::Vector arg1; /** targetsToResume */ olua_to_object(L, 1, &self, "cc.ActionManager"); - olua_check_vector(L, 2, arg1, [L](cocos2d::Node **arg1) { + olua_check_array(L, 2, arg1, [L](cocos2d::Node **arg1) { olua_check_object(L, -1, arg1, "cc.Node"); }); @@ -21664,7 +21664,7 @@ static int _cocos2d_Node_getChildren(lua_State *L) // @addref(children |) cocos2d::Vector &getChildren() cocos2d::Vector &ret = self->getChildren(); - int num_ret = olua_push_vector(L, ret, [L](cocos2d::Node *arg1) { + int num_ret = olua_push_array(L, ret, [L](cocos2d::Node *arg1) { olua_push_object(L, arg1, "cc.Node"); }); @@ -22289,8 +22289,8 @@ static int _cocos2d_Node_getPosition$2(lua_State *L) float *arg2 = nullptr; /** y */ olua_to_object(L, 1, &self, "cc.Node"); - olua_check_array(L, 2, &arg1, "olua.float"); - olua_check_array(L, 3, &arg2, "olua.float"); + olua_check_pointer(L, 2, &arg1, "olua.float"); + olua_check_pointer(L, 3, &arg2, "olua.float"); // void getPosition(float *x, float *y) self->getPosition(arg1, arg2); @@ -22310,7 +22310,7 @@ static int _cocos2d_Node_getPosition(lua_State *L) } if (num_args == 2) { - // if ((olua_is_array(L, 2, "olua.float")) && (olua_is_array(L, 3, "olua.float"))) { + // if ((olua_is_pointer(L, 2, "olua.float")) && (olua_is_pointer(L, 3, "olua.float"))) { // void getPosition(float *x, float *y) return _cocos2d_Node_getPosition$2(L); // } @@ -34020,7 +34020,7 @@ static int _cocos2d_Animation_create$2(lua_State *L) float arg2 = 0; /** delayPerUnit */ unsigned int arg3 = 0; /** loops */ - olua_check_vector(L, 1, arg1, [L](cocos2d::AnimationFrame **arg1) { + olua_check_array(L, 1, arg1, [L](cocos2d::AnimationFrame **arg1) { olua_check_object(L, -1, arg1, "cc.AnimationFrame"); }); olua_check_number(L, 2, &arg2); @@ -34042,7 +34042,7 @@ static int _cocos2d_Animation_create$3(lua_State *L) cocos2d::Vector arg1; /** arrayOfAnimationFrameNames */ float arg2 = 0; /** delayPerUnit */ - olua_check_vector(L, 1, arg1, [L](cocos2d::AnimationFrame **arg1) { + olua_check_array(L, 1, arg1, [L](cocos2d::AnimationFrame **arg1) { olua_check_object(L, -1, arg1, "cc.AnimationFrame"); }); olua_check_number(L, 2, &arg2); @@ -34066,14 +34066,14 @@ static int _cocos2d_Animation_create(lua_State *L) } if (num_args == 2) { - // if ((olua_is_vector(L, 1)) && (olua_is_number(L, 2))) { + // if ((olua_is_array(L, 1)) && (olua_is_number(L, 2))) { // static cocos2d::Animation *create(const cocos2d::Vector &arrayOfAnimationFrameNames, float delayPerUnit, @optional unsigned int loops) return _cocos2d_Animation_create$3(L); // } } if (num_args == 3) { - // if ((olua_is_vector(L, 1)) && (olua_is_number(L, 2)) && (olua_is_integer(L, 3))) { + // if ((olua_is_array(L, 1)) && (olua_is_number(L, 2)) && (olua_is_integer(L, 3))) { // static cocos2d::Animation *create(const cocos2d::Vector &arrayOfAnimationFrameNames, float delayPerUnit, @optional unsigned int loops) return _cocos2d_Animation_create$2(L); // } @@ -34092,7 +34092,7 @@ static int _cocos2d_Animation_createWithSpriteFrames$1(lua_State *L) float arg2 = 0; /** delay */ unsigned int arg3 = 0; /** loops */ - olua_check_vector(L, 1, arg1, [L](cocos2d::SpriteFrame **arg1) { + olua_check_array(L, 1, arg1, [L](cocos2d::SpriteFrame **arg1) { olua_check_object(L, -1, arg1, "cc.SpriteFrame"); }); olua_check_number(L, 2, &arg2); @@ -34113,7 +34113,7 @@ static int _cocos2d_Animation_createWithSpriteFrames$2(lua_State *L) cocos2d::Vector arg1; /** arrayOfSpriteFrameNames */ - olua_check_vector(L, 1, arg1, [L](cocos2d::SpriteFrame **arg1) { + olua_check_array(L, 1, arg1, [L](cocos2d::SpriteFrame **arg1) { olua_check_object(L, -1, arg1, "cc.SpriteFrame"); }); @@ -34133,7 +34133,7 @@ static int _cocos2d_Animation_createWithSpriteFrames$3(lua_State *L) cocos2d::Vector arg1; /** arrayOfSpriteFrameNames */ float arg2 = 0; /** delay */ - olua_check_vector(L, 1, arg1, [L](cocos2d::SpriteFrame **arg1) { + olua_check_array(L, 1, arg1, [L](cocos2d::SpriteFrame **arg1) { olua_check_object(L, -1, arg1, "cc.SpriteFrame"); }); olua_check_number(L, 2, &arg2); @@ -34152,21 +34152,21 @@ static int _cocos2d_Animation_createWithSpriteFrames(lua_State *L) int num_args = lua_gettop(L); if (num_args == 1) { - // if ((olua_is_vector(L, 1))) { + // if ((olua_is_array(L, 1))) { // static cocos2d::Animation *createWithSpriteFrames(const cocos2d::Vector &arrayOfSpriteFrameNames, @optional float delay, @optional unsigned int loops) return _cocos2d_Animation_createWithSpriteFrames$2(L); // } } if (num_args == 2) { - // if ((olua_is_vector(L, 1)) && (olua_is_number(L, 2))) { + // if ((olua_is_array(L, 1)) && (olua_is_number(L, 2))) { // static cocos2d::Animation *createWithSpriteFrames(const cocos2d::Vector &arrayOfSpriteFrameNames, @optional float delay, @optional unsigned int loops) return _cocos2d_Animation_createWithSpriteFrames$3(L); // } } if (num_args == 3) { - // if ((olua_is_vector(L, 1)) && (olua_is_number(L, 2)) && (olua_is_integer(L, 3))) { + // if ((olua_is_array(L, 1)) && (olua_is_number(L, 2)) && (olua_is_integer(L, 3))) { // static cocos2d::Animation *createWithSpriteFrames(const cocos2d::Vector &arrayOfSpriteFrameNames, @optional float delay, @optional unsigned int loops) return _cocos2d_Animation_createWithSpriteFrames$1(L); // } @@ -34221,7 +34221,7 @@ static int _cocos2d_Animation_getFrames(lua_State *L) // const cocos2d::Vector &getFrames() const cocos2d::Vector &ret = self->getFrames(); - int num_ret = olua_push_vector(L, ret, [L](cocos2d::AnimationFrame *arg1) { + int num_ret = olua_push_array(L, ret, [L](cocos2d::AnimationFrame *arg1) { olua_push_object(L, arg1, "cc.AnimationFrame"); }); @@ -34308,7 +34308,7 @@ static int _cocos2d_Animation_initWithAnimationFrames(lua_State *L) unsigned int arg3 = 0; /** loops */ olua_to_object(L, 1, &self, "cc.Animation"); - olua_check_vector(L, 2, arg1, [L](cocos2d::AnimationFrame **arg1) { + olua_check_array(L, 2, arg1, [L](cocos2d::AnimationFrame **arg1) { olua_check_object(L, -1, arg1, "cc.AnimationFrame"); }); olua_check_number(L, 3, &arg2); @@ -34333,7 +34333,7 @@ static int _cocos2d_Animation_initWithSpriteFrames$1(lua_State *L) unsigned int arg3 = 0; /** loops */ olua_to_object(L, 1, &self, "cc.Animation"); - olua_check_vector(L, 2, arg1, [L](cocos2d::SpriteFrame **arg1) { + olua_check_array(L, 2, arg1, [L](cocos2d::SpriteFrame **arg1) { olua_check_object(L, -1, arg1, "cc.SpriteFrame"); }); olua_check_number(L, 3, &arg2); @@ -34356,7 +34356,7 @@ static int _cocos2d_Animation_initWithSpriteFrames$2(lua_State *L) cocos2d::Vector arg1; /** arrayOfSpriteFrameNames */ olua_to_object(L, 1, &self, "cc.Animation"); - olua_check_vector(L, 2, arg1, [L](cocos2d::SpriteFrame **arg1) { + olua_check_array(L, 2, arg1, [L](cocos2d::SpriteFrame **arg1) { olua_check_object(L, -1, arg1, "cc.SpriteFrame"); }); @@ -34378,7 +34378,7 @@ static int _cocos2d_Animation_initWithSpriteFrames$3(lua_State *L) float arg2 = 0; /** delay */ olua_to_object(L, 1, &self, "cc.Animation"); - olua_check_vector(L, 2, arg1, [L](cocos2d::SpriteFrame **arg1) { + olua_check_array(L, 2, arg1, [L](cocos2d::SpriteFrame **arg1) { olua_check_object(L, -1, arg1, "cc.SpriteFrame"); }); olua_check_number(L, 3, &arg2); @@ -34397,21 +34397,21 @@ static int _cocos2d_Animation_initWithSpriteFrames(lua_State *L) int num_args = lua_gettop(L) - 1; if (num_args == 1) { - // if ((olua_is_vector(L, 2))) { + // if ((olua_is_array(L, 2))) { // bool initWithSpriteFrames(const cocos2d::Vector &arrayOfSpriteFrameNames, @optional float delay, @optional unsigned int loops) return _cocos2d_Animation_initWithSpriteFrames$2(L); // } } if (num_args == 2) { - // if ((olua_is_vector(L, 2)) && (olua_is_number(L, 3))) { + // if ((olua_is_array(L, 2)) && (olua_is_number(L, 3))) { // bool initWithSpriteFrames(const cocos2d::Vector &arrayOfSpriteFrameNames, @optional float delay, @optional unsigned int loops) return _cocos2d_Animation_initWithSpriteFrames$3(L); // } } if (num_args == 3) { - // if ((olua_is_vector(L, 2)) && (olua_is_number(L, 3)) && (olua_is_integer(L, 4))) { + // if ((olua_is_array(L, 2)) && (olua_is_number(L, 3)) && (olua_is_integer(L, 4))) { // bool initWithSpriteFrames(const cocos2d::Vector &arrayOfSpriteFrameNames, @optional float delay, @optional unsigned int loops) return _cocos2d_Animation_initWithSpriteFrames$1(L); // } @@ -34462,7 +34462,7 @@ static int _cocos2d_Animation_setFrames(lua_State *L) cocos2d::Vector arg1; /** frames */ olua_to_object(L, 1, &self, "cc.Animation"); - olua_check_vector(L, 2, arg1, [L](cocos2d::AnimationFrame **arg1) { + olua_check_array(L, 2, arg1, [L](cocos2d::AnimationFrame **arg1) { olua_check_object(L, -1, arg1, "cc.AnimationFrame"); }); @@ -36819,7 +36819,7 @@ static int _cocos2d_SpriteBatchNode_getDescendants(lua_State *L) // const std::vector &getDescendants() const std::vector &ret = self->getDescendants(); - int num_ret = olua_push_vector(L, ret, [L](cocos2d::Sprite *arg1) { + int num_ret = olua_push_array(L, ret, [L](cocos2d::Sprite *arg1) { olua_push_object(L, arg1, "cc.Sprite"); }); @@ -37842,7 +37842,7 @@ static int _cocos2d_Scene_getCameras(lua_State *L) // const std::vector &getCameras() const std::vector &ret = self->getCameras(); - int num_ret = olua_push_vector(L, ret, [L](cocos2d::Camera *arg1) { + int num_ret = olua_push_array(L, ret, [L](cocos2d::Camera *arg1) { olua_push_object(L, arg1, "cc.Camera"); }); @@ -37878,7 +37878,7 @@ static int _cocos2d_Scene_getLights(lua_State *L) // const std::vector &getLights() const std::vector &ret = self->getLights(); - int num_ret = olua_push_vector(L, ret, [L](cocos2d::BaseLight *arg1) { + int num_ret = olua_push_array(L, ret, [L](cocos2d::BaseLight *arg1) { olua_push_object(L, arg1, "cc.BaseLight"); }); @@ -38366,7 +38366,7 @@ static int _cocos2d_Layer_onTouchesBegan(lua_State *L) cocos2d::Event *arg2 = nullptr; /** unused_event */ olua_to_object(L, 1, &self, "cc.Layer"); - olua_check_vector(L, 2, arg1, [L](cocos2d::Touch **arg1) { + olua_check_array(L, 2, arg1, [L](cocos2d::Touch **arg1) { olua_check_object(L, -1, arg1, "cc.Touch"); }); olua_check_object(L, 3, &arg2, "cc.Event"); @@ -38388,7 +38388,7 @@ static int _cocos2d_Layer_onTouchesCancelled(lua_State *L) cocos2d::Event *arg2 = nullptr; /** unused_event */ olua_to_object(L, 1, &self, "cc.Layer"); - olua_check_vector(L, 2, arg1, [L](cocos2d::Touch **arg1) { + olua_check_array(L, 2, arg1, [L](cocos2d::Touch **arg1) { olua_check_object(L, -1, arg1, "cc.Touch"); }); olua_check_object(L, 3, &arg2, "cc.Event"); @@ -38410,7 +38410,7 @@ static int _cocos2d_Layer_onTouchesEnded(lua_State *L) cocos2d::Event *arg2 = nullptr; /** unused_event */ olua_to_object(L, 1, &self, "cc.Layer"); - olua_check_vector(L, 2, arg1, [L](cocos2d::Touch **arg1) { + olua_check_array(L, 2, arg1, [L](cocos2d::Touch **arg1) { olua_check_object(L, -1, arg1, "cc.Touch"); }); olua_check_object(L, 3, &arg2, "cc.Event"); @@ -38432,7 +38432,7 @@ static int _cocos2d_Layer_onTouchesMoved(lua_State *L) cocos2d::Event *arg2 = nullptr; /** unused_event */ olua_to_object(L, 1, &self, "cc.Layer"); - olua_check_vector(L, 2, arg1, [L](cocos2d::Touch **arg1) { + olua_check_array(L, 2, arg1, [L](cocos2d::Touch **arg1) { olua_check_object(L, -1, arg1, "cc.Touch"); }); olua_check_object(L, 3, &arg2, "cc.Event"); @@ -40428,7 +40428,7 @@ static int _cocos2d_LayerMultiplex_createWithArray(lua_State *L) cocos2d::Vector arg1; /** arrayOfLayers */ - olua_check_vector(L, 1, arg1, [L](cocos2d::Layer **arg1) { + olua_check_array(L, 1, arg1, [L](cocos2d::Layer **arg1) { olua_check_object(L, -1, arg1, "cc.Layer"); }); @@ -40466,7 +40466,7 @@ static int _cocos2d_LayerMultiplex_initWithArray(lua_State *L) cocos2d::Vector arg1; /** arrayOfLayers */ olua_to_object(L, 1, &self, "cc.LayerMultiplex"); - olua_check_vector(L, 2, arg1, [L](cocos2d::Layer **arg1) { + olua_check_array(L, 2, arg1, [L](cocos2d::Layer **arg1) { olua_check_object(L, -1, arg1, "cc.Layer"); }); @@ -46620,7 +46620,7 @@ static int _cocos2d_ParticleSystem_getAllParticleSystems(lua_State *L) // static cocos2d::Vector &getAllParticleSystems() cocos2d::Vector &ret = cocos2d::ParticleSystem::getAllParticleSystems(); - int num_ret = olua_push_vector(L, ret, [L](cocos2d::ParticleSystem *arg1) { + int num_ret = olua_push_array(L, ret, [L](cocos2d::ParticleSystem *arg1) { olua_push_object(L, arg1, "cc.ParticleSystem"); }); @@ -50038,7 +50038,7 @@ static int _cocos2d_TMXLayer_getTiles(lua_State *L) // uint32_t *getTiles() uint32_t *ret = self->getTiles(); - int num_ret = olua_push_array(L, ret, "olua.uint32_t"); + int num_ret = olua_push_pointer(L, ret, "olua.uint32_t"); olua_endinvoke(L); @@ -50297,7 +50297,7 @@ static int _cocos2d_TMXLayer_setTiles(lua_State *L) uint32_t *arg1 = nullptr; /** tiles */ olua_to_object(L, 1, &self, "cc.TMXLayer"); - olua_check_array(L, 2, &arg1, "olua.uint32_t"); + olua_check_pointer(L, 2, &arg1, "olua.uint32_t"); // void setTiles(uint32_t *tiles) self->setTiles(arg1); @@ -50588,7 +50588,7 @@ static int _cocos2d_TMXMapInfo_getLayers(lua_State *L) // const cocos2d::Vector &getLayers() const cocos2d::Vector &ret = self->getLayers(); - int num_ret = olua_push_vector(L, ret, [L](cocos2d::TMXLayerInfo *arg1) { + int num_ret = olua_push_array(L, ret, [L](cocos2d::TMXLayerInfo *arg1) { olua_push_object(L, arg1, "cc.TMXLayerInfo"); }); @@ -50624,7 +50624,7 @@ static int _cocos2d_TMXMapInfo_getObjectGroups(lua_State *L) // const cocos2d::Vector &getObjectGroups() const cocos2d::Vector &ret = self->getObjectGroups(); - int num_ret = olua_push_vector(L, ret, [L](cocos2d::TMXObjectGroup *arg1) { + int num_ret = olua_push_array(L, ret, [L](cocos2d::TMXObjectGroup *arg1) { olua_push_object(L, arg1, "cc.TMXObjectGroup"); }); @@ -50796,7 +50796,7 @@ static int _cocos2d_TMXMapInfo_getTilesets(lua_State *L) // const cocos2d::Vector &getTilesets() const cocos2d::Vector &ret = self->getTilesets(); - int num_ret = olua_push_vector(L, ret, [L](cocos2d::TMXTilesetInfo *arg1) { + int num_ret = olua_push_array(L, ret, [L](cocos2d::TMXTilesetInfo *arg1) { olua_push_object(L, arg1, "cc.TMXTilesetInfo"); }); @@ -50976,7 +50976,7 @@ static int _cocos2d_TMXMapInfo_setLayers(lua_State *L) cocos2d::Vector arg1; /** layers */ olua_to_object(L, 1, &self, "cc.TMXMapInfo"); - olua_check_vector(L, 2, arg1, [L](cocos2d::TMXLayerInfo **arg1) { + olua_check_array(L, 2, arg1, [L](cocos2d::TMXLayerInfo **arg1) { olua_check_object(L, -1, arg1, "cc.TMXLayerInfo"); }); @@ -51014,7 +51014,7 @@ static int _cocos2d_TMXMapInfo_setObjectGroups(lua_State *L) cocos2d::Vector arg1; /** groups */ olua_to_object(L, 1, &self, "cc.TMXMapInfo"); - olua_check_vector(L, 2, arg1, [L](cocos2d::TMXObjectGroup **arg1) { + olua_check_array(L, 2, arg1, [L](cocos2d::TMXObjectGroup **arg1) { olua_check_object(L, -1, arg1, "cc.TMXObjectGroup"); }); @@ -51214,7 +51214,7 @@ static int _cocos2d_TMXMapInfo_setTilesets(lua_State *L) cocos2d::Vector arg1; /** tilesets */ olua_to_object(L, 1, &self, "cc.TMXMapInfo"); - olua_check_vector(L, 2, arg1, [L](cocos2d::TMXTilesetInfo **arg1) { + olua_check_array(L, 2, arg1, [L](cocos2d::TMXTilesetInfo **arg1) { olua_check_object(L, -1, arg1, "cc.TMXTilesetInfo"); }); @@ -51499,7 +51499,7 @@ static int _cocos2d_TMXTiledMap_getObjectGroups(lua_State *L) // const cocos2d::Vector &getObjectGroups() const cocos2d::Vector &ret = self->getObjectGroups(); - int num_ret = olua_push_vector(L, ret, [L](cocos2d::TMXObjectGroup *arg1) { + int num_ret = olua_push_array(L, ret, [L](cocos2d::TMXObjectGroup *arg1) { olua_push_object(L, arg1, "cc.TMXObjectGroup"); }); @@ -51695,7 +51695,7 @@ static int _cocos2d_TMXTiledMap_setObjectGroups(lua_State *L) cocos2d::Vector arg1; /** groups */ olua_to_object(L, 1, &self, "cc.TMXTiledMap"); - olua_check_vector(L, 2, arg1, [L](cocos2d::TMXObjectGroup **arg1) { + olua_check_array(L, 2, arg1, [L](cocos2d::TMXObjectGroup **arg1) { olua_check_object(L, -1, arg1, "cc.TMXObjectGroup"); }); @@ -51898,7 +51898,7 @@ static int _cocos2d_FastTMXTiledMap_getObjectGroups(lua_State *L) // const cocos2d::Vector &getObjectGroups() const cocos2d::Vector &ret = self->getObjectGroups(); - int num_ret = olua_push_vector(L, ret, [L](cocos2d::TMXObjectGroup *arg1) { + int num_ret = olua_push_array(L, ret, [L](cocos2d::TMXObjectGroup *arg1) { olua_push_object(L, arg1, "cc.TMXObjectGroup"); }); @@ -52023,7 +52023,7 @@ static int _cocos2d_FastTMXTiledMap_setObjectGroups(lua_State *L) cocos2d::Vector arg1; /** groups */ olua_to_object(L, 1, &self, "cc.FastTMXTiledMap"); - olua_check_vector(L, 2, arg1, [L](cocos2d::TMXObjectGroup **arg1) { + olua_check_array(L, 2, arg1, [L](cocos2d::TMXObjectGroup **arg1) { olua_check_object(L, -1, arg1, "cc.TMXObjectGroup"); }); @@ -52354,7 +52354,7 @@ static int _cocos2d_FastTMXLayer_getTiles(lua_State *L) // const uint32_t *getTiles() const uint32_t *ret = self->getTiles(); - int num_ret = olua_push_array(L, ret, "olua.uint32_t"); + int num_ret = olua_push_pointer(L, ret, "olua.uint32_t"); olua_endinvoke(L); @@ -52574,7 +52574,7 @@ static int _cocos2d_FastTMXLayer_setTiles(lua_State *L) uint32_t *arg1 = nullptr; /** tiles */ olua_to_object(L, 1, &self, "cc.FastTMXLayer"); - olua_check_array(L, 2, &arg1, "olua.uint32_t"); + olua_check_pointer(L, 2, &arg1, "olua.uint32_t"); // void setTiles(uint32_t *tiles) self->setTiles(arg1); @@ -53706,7 +53706,7 @@ static int _cocos2d_NavMesh_findPath(lua_State *L) olua_to_object(L, 1, &self, "cc.NavMesh"); olua_check_object(L, 2, &arg1, "cc.Vec3"); olua_check_object(L, 3, &arg2, "cc.Vec3"); - olua_check_vector(L, 4, arg3, [L](cocos2d::Vec3 *arg1) { + olua_check_array(L, 4, arg3, [L](cocos2d::Vec3 *arg1) { olua_check_object(L, -1, arg1, "cc.Vec3"); }); diff --git a/frameworks/cclua/src/lua-bindings/lua_cocos2d_3d.cpp b/frameworks/cclua/src/lua-bindings/lua_cocos2d_3d.cpp index 7c3fc821..58cff449 100644 --- a/frameworks/cclua/src/lua-bindings/lua_cocos2d_3d.cpp +++ b/frameworks/cclua/src/lua-bindings/lua_cocos2d_3d.cpp @@ -523,16 +523,16 @@ static int _cocos2d_Mesh_create$1(lua_State *L) std::vector arg3; /** texs */ std::vector arg4; /** indices */ - olua_check_vector(L, 1, arg1, [L](float *arg1) { + olua_check_array(L, 1, arg1, [L](float *arg1) { olua_check_number(L, -1, arg1); }); - olua_check_vector(L, 2, arg2, [L](float *arg1) { + olua_check_array(L, 2, arg2, [L](float *arg1) { olua_check_number(L, -1, arg1); }); - olua_check_vector(L, 3, arg3, [L](float *arg1) { + olua_check_array(L, 3, arg3, [L](float *arg1) { olua_check_number(L, -1, arg1); }); - olua_check_vector(L, 4, arg4, [L](unsigned short *arg1) { + olua_check_array(L, 4, arg4, [L](unsigned short *arg1) { olua_check_integer(L, -1, arg1); }); @@ -554,14 +554,14 @@ static int _cocos2d_Mesh_create$2(lua_State *L) std::vector arg3; /** indices */ std::vector arg4; /** attribs */ - olua_check_vector(L, 1, arg1, [L](float *arg1) { + olua_check_array(L, 1, arg1, [L](float *arg1) { olua_check_number(L, -1, arg1); }); olua_check_integer(L, 2, &arg2); - olua_check_vector(L, 3, arg3, [L](unsigned short *arg1) { + olua_check_array(L, 3, arg3, [L](unsigned short *arg1) { olua_check_integer(L, -1, arg1); }); - olua_check_vector(L, 4, arg4, [L](cocos2d::MeshVertexAttrib *arg1) { + olua_check_array(L, 4, arg4, [L](cocos2d::MeshVertexAttrib *arg1) { olua_check_object(L, -1, arg1, "cc.MeshVertexAttrib"); }); @@ -579,12 +579,12 @@ static int _cocos2d_Mesh_create(lua_State *L) int num_args = lua_gettop(L); if (num_args == 4) { - if ((olua_is_vector(L, 1)) && (olua_is_vector(L, 2)) && (olua_is_vector(L, 3)) && (olua_is_vector(L, 4))) { + if ((olua_is_array(L, 1)) && (olua_is_array(L, 2)) && (olua_is_array(L, 3)) && (olua_is_array(L, 4))) { // static cocos2d::Mesh *create(const std::vector &positions, const std::vector &normals, const std::vector &texs, const std::vector &indices) return _cocos2d_Mesh_create$1(L); } - // if ((olua_is_vector(L, 1)) && (olua_is_integer(L, 2)) && (olua_is_vector(L, 3)) && (olua_is_vector(L, 4))) { + // if ((olua_is_array(L, 1)) && (olua_is_integer(L, 2)) && (olua_is_array(L, 3)) && (olua_is_array(L, 4))) { // static cocos2d::Mesh *create(const std::vector &vertices, int perVertexSizeInFloat, const std::vector &indices, const std::vector &attribs) return _cocos2d_Mesh_create$2(L); // } @@ -2402,7 +2402,7 @@ static int _cocos2d_Sprite3D_getMeshArrayByName(lua_State *L) // std::vector getMeshArrayByName(const std::string &name) std::vector ret = self->getMeshArrayByName(arg1); - int num_ret = olua_push_vector(L, ret, [L](cocos2d::Mesh *arg1) { + int num_ret = olua_push_array(L, ret, [L](cocos2d::Mesh *arg1) { olua_push_object(L, arg1, "cc.Mesh"); }); @@ -2476,7 +2476,7 @@ static int _cocos2d_Sprite3D_getMeshes(lua_State *L) // const cocos2d::Vector &getMeshes() const cocos2d::Vector &ret = self->getMeshes(); - int num_ret = olua_push_vector(L, ret, [L](cocos2d::Mesh *arg1) { + int num_ret = olua_push_array(L, ret, [L](cocos2d::Mesh *arg1) { olua_push_object(L, arg1, "cc.Mesh"); }); @@ -3172,9 +3172,9 @@ static int _cocos2d_Bone3D_setAnimationValue$1(lua_State *L) float arg5 = 0; /** weight */ olua_to_object(L, 1, &self, "cc.Bone3D"); - olua_check_array(L, 2, &arg1, "olua.float"); - olua_check_array(L, 3, &arg2, "olua.float"); - olua_check_array(L, 4, &arg3, "olua.float"); + olua_check_pointer(L, 2, &arg1, "olua.float"); + olua_check_pointer(L, 3, &arg2, "olua.float"); + olua_check_pointer(L, 4, &arg3, "olua.float"); olua_check_object(L, 5, &arg4, "void *"); olua_check_number(L, 6, &arg5); @@ -3196,9 +3196,9 @@ static int _cocos2d_Bone3D_setAnimationValue$2(lua_State *L) float *arg3 = nullptr; /** scale */ olua_to_object(L, 1, &self, "cc.Bone3D"); - olua_check_array(L, 2, &arg1, "olua.float"); - olua_check_array(L, 3, &arg2, "olua.float"); - olua_check_array(L, 4, &arg3, "olua.float"); + olua_check_pointer(L, 2, &arg1, "olua.float"); + olua_check_pointer(L, 3, &arg2, "olua.float"); + olua_check_pointer(L, 4, &arg3, "olua.float"); // void setAnimationValue(float *trans, float *rot, float *scale, @optional void *tag, @optional float weight) self->setAnimationValue(arg1, arg2, arg3); @@ -3219,9 +3219,9 @@ static int _cocos2d_Bone3D_setAnimationValue$3(lua_State *L) void *arg4 = nullptr; /** tag */ olua_to_object(L, 1, &self, "cc.Bone3D"); - olua_check_array(L, 2, &arg1, "olua.float"); - olua_check_array(L, 3, &arg2, "olua.float"); - olua_check_array(L, 4, &arg3, "olua.float"); + olua_check_pointer(L, 2, &arg1, "olua.float"); + olua_check_pointer(L, 3, &arg2, "olua.float"); + olua_check_pointer(L, 4, &arg3, "olua.float"); olua_check_object(L, 5, &arg4, "void *"); // void setAnimationValue(float *trans, float *rot, float *scale, @optional void *tag, @optional float weight) @@ -3237,21 +3237,21 @@ static int _cocos2d_Bone3D_setAnimationValue(lua_State *L) int num_args = lua_gettop(L) - 1; if (num_args == 3) { - // if ((olua_is_array(L, 2, "olua.float")) && (olua_is_array(L, 3, "olua.float")) && (olua_is_array(L, 4, "olua.float"))) { + // if ((olua_is_pointer(L, 2, "olua.float")) && (olua_is_pointer(L, 3, "olua.float")) && (olua_is_pointer(L, 4, "olua.float"))) { // void setAnimationValue(float *trans, float *rot, float *scale, @optional void *tag, @optional float weight) return _cocos2d_Bone3D_setAnimationValue$2(L); // } } if (num_args == 4) { - // if ((olua_is_array(L, 2, "olua.float")) && (olua_is_array(L, 3, "olua.float")) && (olua_is_array(L, 4, "olua.float")) && (olua_is_object(L, 5, "void *"))) { + // if ((olua_is_pointer(L, 2, "olua.float")) && (olua_is_pointer(L, 3, "olua.float")) && (olua_is_pointer(L, 4, "olua.float")) && (olua_is_object(L, 5, "void *"))) { // void setAnimationValue(float *trans, float *rot, float *scale, @optional void *tag, @optional float weight) return _cocos2d_Bone3D_setAnimationValue$3(L); // } } if (num_args == 5) { - // if ((olua_is_array(L, 2, "olua.float")) && (olua_is_array(L, 3, "olua.float")) && (olua_is_array(L, 4, "olua.float")) && (olua_is_object(L, 5, "void *")) && (olua_is_number(L, 6))) { + // if ((olua_is_pointer(L, 2, "olua.float")) && (olua_is_pointer(L, 3, "olua.float")) && (olua_is_pointer(L, 4, "olua.float")) && (olua_is_object(L, 5, "void *")) && (olua_is_number(L, 6))) { // void setAnimationValue(float *trans, float *rot, float *scale, @optional void *tag, @optional float weight) return _cocos2d_Bone3D_setAnimationValue$1(L); // } diff --git a/frameworks/cclua/src/lua-bindings/lua_cocos2d_action.cpp b/frameworks/cclua/src/lua-bindings/lua_cocos2d_action.cpp index c097ef0c..c1cf7ca1 100644 --- a/frameworks/cclua/src/lua-bindings/lua_cocos2d_action.cpp +++ b/frameworks/cclua/src/lua-bindings/lua_cocos2d_action.cpp @@ -1261,7 +1261,7 @@ static int _cocos2d_tweenfunc_customEase(lua_State *L) float *arg2 = nullptr; /** easingParam */ olua_check_number(L, 1, &arg1); - olua_check_array(L, 2, &arg2, "olua.float"); + olua_check_pointer(L, 2, &arg2, "olua.float"); // static float customEase(float time, float *easingParam) float ret = cocos2d::tweenfunc::customEase(arg1, arg2); @@ -1719,7 +1719,7 @@ static int _cocos2d_tweenfunc_tweenTo(lua_State *L) olua_check_number(L, 1, &arg1); olua_check_enum(L, 2, &arg2); - olua_check_array(L, 3, &arg3, "olua.float"); + olua_check_pointer(L, 3, &arg3, "olua.float"); // static float tweenTo(float time, cocos2d::tweenfunc::TweenType type, float *easingParam) float ret = cocos2d::tweenfunc::tweenTo(arg1, arg2, arg3); @@ -2041,7 +2041,7 @@ static int _cocos2d_Sequence_create$2(lua_State *L) cocos2d::Vector arg1; /** arrayOfActions */ - olua_check_vector(L, 1, arg1, [L](cocos2d::FiniteTimeAction **arg1) { + olua_check_array(L, 1, arg1, [L](cocos2d::FiniteTimeAction **arg1) { olua_check_object(L, -1, arg1, "cc.FiniteTimeAction"); }); @@ -2742,7 +2742,7 @@ static int _cocos2d_Sequence_create(lua_State *L) int num_args = lua_gettop(L); if (num_args == 1) { - if ((olua_is_vector(L, 1))) { + if ((olua_is_array(L, 1))) { // static cocos2d::Sequence *create(@addref(actions |) const cocos2d::Vector &arrayOfActions) return _cocos2d_Sequence_create$2(L); } @@ -3236,7 +3236,7 @@ static int _cocos2d_Spawn_create$2(lua_State *L) cocos2d::Vector arg1; /** arrayOfActions */ - olua_check_vector(L, 1, arg1, [L](cocos2d::FiniteTimeAction **arg1) { + olua_check_array(L, 1, arg1, [L](cocos2d::FiniteTimeAction **arg1) { olua_check_object(L, -1, arg1, "cc.FiniteTimeAction"); }); @@ -3937,7 +3937,7 @@ static int _cocos2d_Spawn_create(lua_State *L) int num_args = lua_gettop(L); if (num_args == 1) { - if ((olua_is_vector(L, 1))) { + if ((olua_is_array(L, 1))) { // static cocos2d::Spawn *create(@addref(actions |) const cocos2d::Vector &arrayOfActions) return _cocos2d_Spawn_create$2(L); } @@ -9868,7 +9868,7 @@ static int _cocos2d_PointArray_getControlPoints(lua_State *L) // const std::vector &getControlPoints() const std::vector &ret = self->getControlPoints(); - int num_ret = olua_push_vector(L, ret, [L](cocos2d::Vec2 &arg1) { + int num_ret = olua_push_array(L, ret, [L](cocos2d::Vec2 &arg1) { olua_pushcopy_object(L, arg1, "cc.Vec2"); }); @@ -9995,7 +9995,7 @@ static int _cocos2d_PointArray_setControlPoints(lua_State *L) std::vector arg1; /** controlPoints */ olua_to_object(L, 1, &self, "cc.PointArray"); - olua_check_vector(L, 2, arg1, [L](cocos2d::Vec2 *arg1) { + olua_check_array(L, 2, arg1, [L](cocos2d::Vec2 *arg1) { olua_check_object(L, -1, arg1, "cc.Vec2"); }); @@ -11187,9 +11187,9 @@ static int _cocos2d_OrbitCamera_sphericalRadius(lua_State *L) float *arg3 = nullptr; /** azimuth */ olua_to_object(L, 1, &self, "cc.OrbitCamera"); - olua_check_array(L, 2, &arg1, "olua.float"); - olua_check_array(L, 3, &arg2, "olua.float"); - olua_check_array(L, 4, &arg3, "olua.float"); + olua_check_pointer(L, 2, &arg1, "olua.float"); + olua_check_pointer(L, 3, &arg2, "olua.float"); + olua_check_pointer(L, 4, &arg3, "olua.float"); // void sphericalRadius(float *r, float *zenith, float *azimuth) self->sphericalRadius(arg1, arg2, arg3); @@ -14067,7 +14067,7 @@ static int _cocos2d_ShuffleTiles_shuffle(lua_State *L) unsigned int arg2 = 0; /** len */ olua_to_object(L, 1, &self, "cc.ShuffleTiles"); - olua_check_array(L, 2, &arg1, "olua.uint"); + olua_check_pointer(L, 2, &arg1, "olua.uint"); olua_check_integer(L, 3, &arg2); // void shuffle(unsigned int *array, unsigned int len) @@ -14449,7 +14449,7 @@ static int _cocos2d_TurnOffTiles_shuffle(lua_State *L) unsigned int arg2 = 0; /** len */ olua_to_object(L, 1, &self, "cc.TurnOffTiles"); - olua_check_array(L, 2, &arg1, "olua.uint"); + olua_check_pointer(L, 2, &arg1, "olua.uint"); olua_check_integer(L, 3, &arg2); // void shuffle(unsigned int *array, unsigned int len) diff --git a/frameworks/cclua/src/lua-bindings/lua_cocos2d_backend.cpp b/frameworks/cclua/src/lua-bindings/lua_cocos2d_backend.cpp index ed02b4f3..5572e92d 100644 --- a/frameworks/cclua/src/lua-bindings/lua_cocos2d_backend.cpp +++ b/frameworks/cclua/src/lua-bindings/lua_cocos2d_backend.cpp @@ -2261,10 +2261,10 @@ static int _cocos2d_backend_ProgramState_setTextureArray(lua_State *L) olua_to_object(L, 1, &self, "ccb.ProgramState"); olua_check_object(L, 2, &arg1, "ccb.UniformLocation"); - olua_check_vector(L, 3, arg2, [L](uint32_t *arg1) { + olua_check_array(L, 3, arg2, [L](uint32_t *arg1) { olua_check_integer(L, -1, arg1); }); - olua_check_vector(L, 4, arg3, [L](cocos2d::backend::TextureBackend **arg1) { + olua_check_array(L, 4, arg3, [L](cocos2d::backend::TextureBackend **arg1) { olua_check_object(L, -1, arg1, "ccb.TextureBackend"); }); @@ -2887,7 +2887,7 @@ static int _cocos2d_backend_Texture2DBackend_updateCompressedData(lua_State *L) std::size_t arg5 = 0; /** level */ olua_to_object(L, 1, &self, "ccb.Texture2DBackend"); - olua_check_array(L, 2, &arg1, "olua.uint8_t"); + olua_check_pointer(L, 2, &arg1, "olua.uint8_t"); olua_check_integer(L, 3, &arg2); olua_check_integer(L, 4, &arg3); olua_check_integer(L, 5, &arg4); @@ -2921,7 +2921,7 @@ static int _cocos2d_backend_Texture2DBackend_updateCompressedSubData(lua_State * olua_check_integer(L, 5, &arg4); olua_check_integer(L, 6, &arg5); olua_check_integer(L, 7, &arg6); - olua_check_array(L, 8, &arg7, "olua.uint8_t"); + olua_check_pointer(L, 8, &arg7, "olua.uint8_t"); // void updateCompressedSubData(std::size_t xoffset, std::size_t yoffset, std::size_t width, std::size_t height, std::size_t dataLen, std::size_t level, uint8_t *data) self->updateCompressedSubData(arg1, arg2, arg3, arg4, arg5, arg6, arg7); @@ -2942,7 +2942,7 @@ static int _cocos2d_backend_Texture2DBackend_updateData(lua_State *L) std::size_t arg4 = 0; /** level */ olua_to_object(L, 1, &self, "ccb.Texture2DBackend"); - olua_check_array(L, 2, &arg1, "olua.uint8_t"); + olua_check_pointer(L, 2, &arg1, "olua.uint8_t"); olua_check_integer(L, 3, &arg2); olua_check_integer(L, 4, &arg3); olua_check_integer(L, 5, &arg4); @@ -2973,7 +2973,7 @@ static int _cocos2d_backend_Texture2DBackend_updateSubData(lua_State *L) olua_check_integer(L, 4, &arg3); olua_check_integer(L, 5, &arg4); olua_check_integer(L, 6, &arg5); - olua_check_array(L, 7, &arg6, "olua.uint8_t"); + olua_check_pointer(L, 7, &arg6, "olua.uint8_t"); // void updateSubData(std::size_t xoffset, std::size_t yoffset, std::size_t width, std::size_t height, std::size_t level, uint8_t *data) self->updateSubData(arg1, arg2, arg3, arg4, arg5, arg6); diff --git a/frameworks/cclua/src/lua-bindings/lua_cocos2d_physics.cpp b/frameworks/cclua/src/lua-bindings/lua_cocos2d_physics.cpp index dc1f722f..bed329cc 100644 --- a/frameworks/cclua/src/lua-bindings/lua_cocos2d_physics.cpp +++ b/frameworks/cclua/src/lua-bindings/lua_cocos2d_physics.cpp @@ -1992,7 +1992,7 @@ static int _cocos2d_PhysicsBody_getJoints(lua_State *L) // const std::vector &getJoints() const std::vector &ret = self->getJoints(); - int num_ret = olua_push_vector(L, ret, [L](cocos2d::PhysicsJoint *arg1) { + int num_ret = olua_push_array(L, ret, [L](cocos2d::PhysicsJoint *arg1) { olua_push_object(L, arg1, "cc.PhysicsJoint"); }); @@ -2166,7 +2166,7 @@ static int _cocos2d_PhysicsBody_getShapes(lua_State *L) // const cocos2d::Vector &getShapes() const cocos2d::Vector &ret = self->getShapes(); - int num_ret = olua_push_vector(L, ret, [L](cocos2d::PhysicsShape *arg1) { + int num_ret = olua_push_array(L, ret, [L](cocos2d::PhysicsShape *arg1) { olua_push_object(L, arg1, "cc.PhysicsShape"); }); @@ -7588,7 +7588,7 @@ static int _cocos2d_PhysicsWorld_getAllBodies(lua_State *L) // const cocos2d::Vector &getAllBodies() const cocos2d::Vector &ret = self->getAllBodies(); - int num_ret = olua_push_vector(L, ret, [L](cocos2d::PhysicsBody *arg1) { + int num_ret = olua_push_array(L, ret, [L](cocos2d::PhysicsBody *arg1) { olua_push_object(L, arg1, "cc.PhysicsBody"); }); @@ -7715,7 +7715,7 @@ static int _cocos2d_PhysicsWorld_getShapes(lua_State *L) // cocos2d::Vector getShapes(const cocos2d::Vec2 &point) cocos2d::Vector ret = self->getShapes(arg1); - int num_ret = olua_push_vector(L, ret, [L](cocos2d::PhysicsShape *arg1) { + int num_ret = olua_push_array(L, ret, [L](cocos2d::PhysicsShape *arg1) { olua_push_object(L, arg1, "cc.PhysicsShape"); }); diff --git a/frameworks/cclua/src/lua-bindings/lua_cocos2d_studio.cpp b/frameworks/cclua/src/lua-bindings/lua_cocos2d_studio.cpp index 4c00d77f..7ff5b4d7 100644 --- a/frameworks/cclua/src/lua-bindings/lua_cocos2d_studio.cpp +++ b/frameworks/cclua/src/lua-bindings/lua_cocos2d_studio.cpp @@ -1137,7 +1137,7 @@ static int _cocostudio_ActionFrame_setEasingParameter(lua_State *L) std::vector arg1; /** parameter */ olua_to_object(L, 1, &self, "ccs.ActionFrame"); - olua_check_vector(L, 2, arg1, [L](float *arg1) { + olua_check_array(L, 2, arg1, [L](float *arg1) { olua_check_number(L, -1, arg1); }); @@ -1789,7 +1789,7 @@ static int _cocostudio_AnimationData_get_movementNames(lua_State *L) // std::vector movementNames std::vector &ret = self->movementNames; - int num_ret = olua_push_vector(L, ret, [L](std::string &arg1) { + int num_ret = olua_push_array(L, ret, [L](std::string &arg1) { olua_push_string(L, arg1); }); @@ -1806,7 +1806,7 @@ static int _cocostudio_AnimationData_set_movementNames(lua_State *L) std::vector arg1; /** movementNames */ olua_to_object(L, 1, &self, "ccs.AnimationData"); - olua_check_vector(L, 2, arg1, [L](std::string *arg1) { + olua_check_array(L, 2, arg1, [L](std::string *arg1) { olua_check_string(L, -1, arg1); }); @@ -4123,7 +4123,7 @@ static int _cocostudio_ArmatureAnimation_playWithIndexes$1(lua_State *L) bool arg3 = false; /** loop */ olua_to_object(L, 1, &self, "ccs.ArmatureAnimation"); - olua_check_vector(L, 2, arg1, [L](int *arg1) { + olua_check_array(L, 2, arg1, [L](int *arg1) { olua_check_integer(L, -1, arg1); }); olua_check_integer(L, 3, &arg2); @@ -4145,7 +4145,7 @@ static int _cocostudio_ArmatureAnimation_playWithIndexes$2(lua_State *L) std::vector arg1; /** movementIndexes */ olua_to_object(L, 1, &self, "ccs.ArmatureAnimation"); - olua_check_vector(L, 2, arg1, [L](int *arg1) { + olua_check_array(L, 2, arg1, [L](int *arg1) { olua_check_integer(L, -1, arg1); }); @@ -4166,7 +4166,7 @@ static int _cocostudio_ArmatureAnimation_playWithIndexes$3(lua_State *L) int arg2 = 0; /** durationTo */ olua_to_object(L, 1, &self, "ccs.ArmatureAnimation"); - olua_check_vector(L, 2, arg1, [L](int *arg1) { + olua_check_array(L, 2, arg1, [L](int *arg1) { olua_check_integer(L, -1, arg1); }); olua_check_integer(L, 3, &arg2); @@ -4184,21 +4184,21 @@ static int _cocostudio_ArmatureAnimation_playWithIndexes(lua_State *L) int num_args = lua_gettop(L) - 1; if (num_args == 1) { - // if ((olua_is_vector(L, 2))) { + // if ((olua_is_array(L, 2))) { // void playWithIndexes(const std::vector &movementIndexes, @optional int durationTo, @optional bool loop) return _cocostudio_ArmatureAnimation_playWithIndexes$2(L); // } } if (num_args == 2) { - // if ((olua_is_vector(L, 2)) && (olua_is_integer(L, 3))) { + // if ((olua_is_array(L, 2)) && (olua_is_integer(L, 3))) { // void playWithIndexes(const std::vector &movementIndexes, @optional int durationTo, @optional bool loop) return _cocostudio_ArmatureAnimation_playWithIndexes$3(L); // } } if (num_args == 3) { - // if ((olua_is_vector(L, 2)) && (olua_is_integer(L, 3)) && (olua_is_bool(L, 4))) { + // if ((olua_is_array(L, 2)) && (olua_is_integer(L, 3)) && (olua_is_bool(L, 4))) { // void playWithIndexes(const std::vector &movementIndexes, @optional int durationTo, @optional bool loop) return _cocostudio_ArmatureAnimation_playWithIndexes$1(L); // } @@ -4219,7 +4219,7 @@ static int _cocostudio_ArmatureAnimation_playWithNames$1(lua_State *L) bool arg3 = false; /** loop */ olua_to_object(L, 1, &self, "ccs.ArmatureAnimation"); - olua_check_vector(L, 2, arg1, [L](std::string *arg1) { + olua_check_array(L, 2, arg1, [L](std::string *arg1) { olua_check_string(L, -1, arg1); }); olua_check_integer(L, 3, &arg2); @@ -4241,7 +4241,7 @@ static int _cocostudio_ArmatureAnimation_playWithNames$2(lua_State *L) std::vector arg1; /** movementNames */ olua_to_object(L, 1, &self, "ccs.ArmatureAnimation"); - olua_check_vector(L, 2, arg1, [L](std::string *arg1) { + olua_check_array(L, 2, arg1, [L](std::string *arg1) { olua_check_string(L, -1, arg1); }); @@ -4262,7 +4262,7 @@ static int _cocostudio_ArmatureAnimation_playWithNames$3(lua_State *L) int arg2 = 0; /** durationTo */ olua_to_object(L, 1, &self, "ccs.ArmatureAnimation"); - olua_check_vector(L, 2, arg1, [L](std::string *arg1) { + olua_check_array(L, 2, arg1, [L](std::string *arg1) { olua_check_string(L, -1, arg1); }); olua_check_integer(L, 3, &arg2); @@ -4280,21 +4280,21 @@ static int _cocostudio_ArmatureAnimation_playWithNames(lua_State *L) int num_args = lua_gettop(L) - 1; if (num_args == 1) { - // if ((olua_is_vector(L, 2))) { + // if ((olua_is_array(L, 2))) { // void playWithNames(const std::vector &movementNames, @optional int durationTo, @optional bool loop) return _cocostudio_ArmatureAnimation_playWithNames$2(L); // } } if (num_args == 2) { - // if ((olua_is_vector(L, 2)) && (olua_is_integer(L, 3))) { + // if ((olua_is_array(L, 2)) && (olua_is_integer(L, 3))) { // void playWithNames(const std::vector &movementNames, @optional int durationTo, @optional bool loop) return _cocostudio_ArmatureAnimation_playWithNames$3(L); // } } if (num_args == 3) { - // if ((olua_is_vector(L, 2)) && (olua_is_integer(L, 3)) && (olua_is_bool(L, 4))) { + // if ((olua_is_array(L, 2)) && (olua_is_integer(L, 3)) && (olua_is_bool(L, 4))) { // void playWithNames(const std::vector &movementNames, @optional int durationTo, @optional bool loop) return _cocostudio_ArmatureAnimation_playWithNames$1(L); // } @@ -7257,7 +7257,7 @@ static int _cocostudio_BoneData_get_displayDataList(lua_State *L) // cocos2d::Vector displayDataList cocos2d::Vector &ret = self->displayDataList; - int num_ret = olua_push_vector(L, ret, [L](cocostudio::DisplayData *arg1) { + int num_ret = olua_push_array(L, ret, [L](cocostudio::DisplayData *arg1) { olua_push_object(L, arg1, "ccs.DisplayData"); }); @@ -7274,7 +7274,7 @@ static int _cocostudio_BoneData_set_displayDataList(lua_State *L) cocos2d::Vector arg1; /** displayDataList */ olua_to_object(L, 1, &self, "ccs.BoneData"); - olua_check_vector(L, 2, arg1, [L](cocostudio::DisplayData **arg1) { + olua_check_array(L, 2, arg1, [L](cocostudio::DisplayData **arg1) { olua_check_object(L, -1, arg1, "ccs.DisplayData"); }); @@ -7419,7 +7419,7 @@ static int _cocostudio_ColliderBody_getCalculatedVertexList(lua_State *L) // const std::vector &getCalculatedVertexList() const std::vector &ret = self->getCalculatedVertexList(); - int num_ret = olua_push_vector(L, ret, [L](cocos2d::Vec2 &arg1) { + int num_ret = olua_push_array(L, ret, [L](cocos2d::Vec2 &arg1) { olua_pushcopy_object(L, arg1, "cc.Vec2"); }); @@ -7503,7 +7503,7 @@ static int _cocostudio_ColliderDetector_addContourDataList(lua_State *L) cocos2d::Vector arg1; /** contourDataList */ olua_to_object(L, 1, &self, "ccs.ColliderDetector"); - olua_check_vector(L, 2, arg1, [L](cocostudio::ContourData **arg1) { + olua_check_array(L, 2, arg1, [L](cocostudio::ContourData **arg1) { olua_check_object(L, -1, arg1, "ccs.ContourData"); }); @@ -7610,7 +7610,7 @@ static int _cocostudio_ColliderDetector_getColliderBodyList(lua_State *L) // const cocos2d::Vector &getColliderBodyList() const cocos2d::Vector &ret = self->getColliderBodyList(); - int num_ret = olua_push_vector(L, ret, [L](cocostudio::ColliderBody *arg1) { + int num_ret = olua_push_array(L, ret, [L](cocostudio::ColliderBody *arg1) { olua_push_object(L, arg1, "ccs.ColliderBody"); }); @@ -9317,7 +9317,7 @@ static int _cocostudio_ComController_onTouchesBegan(lua_State *L) cocos2d::Event *arg2 = nullptr; /** event */ olua_to_object(L, 1, &self, "ccs.ComController"); - olua_check_vector(L, 2, arg1, [L](cocos2d::Touch **arg1) { + olua_check_array(L, 2, arg1, [L](cocos2d::Touch **arg1) { olua_check_object(L, -1, arg1, "cc.Touch"); }); olua_check_object(L, 3, &arg2, "cc.Event"); @@ -9339,7 +9339,7 @@ static int _cocostudio_ComController_onTouchesCancelled(lua_State *L) cocos2d::Event *arg2 = nullptr; /** event */ olua_to_object(L, 1, &self, "ccs.ComController"); - olua_check_vector(L, 2, arg1, [L](cocos2d::Touch **arg1) { + olua_check_array(L, 2, arg1, [L](cocos2d::Touch **arg1) { olua_check_object(L, -1, arg1, "cc.Touch"); }); olua_check_object(L, 3, &arg2, "cc.Event"); @@ -9361,7 +9361,7 @@ static int _cocostudio_ComController_onTouchesEnded(lua_State *L) cocos2d::Event *arg2 = nullptr; /** event */ olua_to_object(L, 1, &self, "ccs.ComController"); - olua_check_vector(L, 2, arg1, [L](cocos2d::Touch **arg1) { + olua_check_array(L, 2, arg1, [L](cocos2d::Touch **arg1) { olua_check_object(L, -1, arg1, "cc.Touch"); }); olua_check_object(L, 3, &arg2, "cc.Event"); @@ -9383,7 +9383,7 @@ static int _cocostudio_ComController_onTouchesMoved(lua_State *L) cocos2d::Event *arg2 = nullptr; /** event */ olua_to_object(L, 1, &self, "ccs.ComController"); - olua_check_vector(L, 2, arg1, [L](cocos2d::Touch **arg1) { + olua_check_array(L, 2, arg1, [L](cocos2d::Touch **arg1) { olua_check_object(L, -1, arg1, "cc.Touch"); }); olua_check_object(L, 3, &arg2, "cc.Event"); @@ -9770,7 +9770,7 @@ static int _cocostudio_ContourData_get_vertexList(lua_State *L) // std::vector vertexList std::vector &ret = self->vertexList; - int num_ret = olua_push_vector(L, ret, [L](cocos2d::Vec2 &arg1) { + int num_ret = olua_push_array(L, ret, [L](cocos2d::Vec2 &arg1) { olua_pushcopy_object(L, arg1, "cc.Vec2"); }); @@ -9787,7 +9787,7 @@ static int _cocostudio_ContourData_set_vertexList(lua_State *L) std::vector arg1; /** vertexList */ olua_to_object(L, 1, &self, "ccs.ContourData"); - olua_check_vector(L, 2, arg1, [L](cocos2d::Vec2 *arg1) { + olua_check_array(L, 2, arg1, [L](cocos2d::Vec2 *arg1) { olua_check_object(L, -1, arg1, "cc.Vec2"); }); @@ -10743,7 +10743,7 @@ static int _cocostudio_DisplayManager_getDecorativeDisplayList(lua_State *L) // const cocos2d::Vector &getDecorativeDisplayList() const cocos2d::Vector &ret = self->getDecorativeDisplayList(); - int num_ret = olua_push_vector(L, ret, [L](cocostudio::DecorativeDisplay *arg1) { + int num_ret = olua_push_array(L, ret, [L](cocostudio::DecorativeDisplay *arg1) { olua_push_object(L, arg1, "ccs.DecorativeDisplay"); }); @@ -11164,7 +11164,7 @@ static int _cocostudio_FrameData_get_easingParams(lua_State *L) // float *easingParams float *ret = self->easingParams; - int num_ret = olua_push_array(L, ret, "olua.float"); + int num_ret = olua_push_pointer(L, ret, "olua.float"); olua_endinvoke(L); @@ -11179,7 +11179,7 @@ static int _cocostudio_FrameData_set_easingParams(lua_State *L) float *arg1 = nullptr; /** easingParams */ olua_to_object(L, 1, &self, "ccs.FrameData"); - olua_check_array(L, 2, &arg1, "olua.float"); + olua_check_pointer(L, 2, &arg1, "olua.float"); // float *easingParams self->easingParams = arg1; @@ -11906,7 +11906,7 @@ static int _cocostudio_InputDelegate_onTouchesBegan(lua_State *L) cocos2d::Event *arg2 = nullptr; /** event */ olua_to_object(L, 1, &self, "ccs.InputDelegate"); - olua_check_vector(L, 2, arg1, [L](cocos2d::Touch **arg1) { + olua_check_array(L, 2, arg1, [L](cocos2d::Touch **arg1) { olua_check_object(L, -1, arg1, "cc.Touch"); }); olua_check_object(L, 3, &arg2, "cc.Event"); @@ -11928,7 +11928,7 @@ static int _cocostudio_InputDelegate_onTouchesCancelled(lua_State *L) cocos2d::Event *arg2 = nullptr; /** event */ olua_to_object(L, 1, &self, "ccs.InputDelegate"); - olua_check_vector(L, 2, arg1, [L](cocos2d::Touch **arg1) { + olua_check_array(L, 2, arg1, [L](cocos2d::Touch **arg1) { olua_check_object(L, -1, arg1, "cc.Touch"); }); olua_check_object(L, 3, &arg2, "cc.Event"); @@ -11950,7 +11950,7 @@ static int _cocostudio_InputDelegate_onTouchesEnded(lua_State *L) cocos2d::Event *arg2 = nullptr; /** event */ olua_to_object(L, 1, &self, "ccs.InputDelegate"); - olua_check_vector(L, 2, arg1, [L](cocos2d::Touch **arg1) { + olua_check_array(L, 2, arg1, [L](cocos2d::Touch **arg1) { olua_check_object(L, -1, arg1, "cc.Touch"); }); olua_check_object(L, 3, &arg2, "cc.Event"); @@ -11972,7 +11972,7 @@ static int _cocostudio_InputDelegate_onTouchesMoved(lua_State *L) cocos2d::Event *arg2 = nullptr; /** event */ olua_to_object(L, 1, &self, "ccs.InputDelegate"); - olua_check_vector(L, 2, arg1, [L](cocos2d::Touch **arg1) { + olua_check_array(L, 2, arg1, [L](cocos2d::Touch **arg1) { olua_check_object(L, -1, arg1, "cc.Touch"); }); olua_check_object(L, 3, &arg2, "cc.Event"); @@ -12274,7 +12274,7 @@ static int _cocostudio_MovementBoneData_get_frameList(lua_State *L) // cocos2d::Vector frameList cocos2d::Vector &ret = self->frameList; - int num_ret = olua_push_vector(L, ret, [L](cocostudio::FrameData *arg1) { + int num_ret = olua_push_array(L, ret, [L](cocostudio::FrameData *arg1) { olua_push_object(L, arg1, "ccs.FrameData"); }); @@ -12291,7 +12291,7 @@ static int _cocostudio_MovementBoneData_set_frameList(lua_State *L) cocos2d::Vector arg1; /** frameList */ olua_to_object(L, 1, &self, "ccs.MovementBoneData"); - olua_check_vector(L, 2, arg1, [L](cocostudio::FrameData **arg1) { + olua_check_array(L, 2, arg1, [L](cocostudio::FrameData **arg1) { olua_check_object(L, -1, arg1, "ccs.FrameData"); }); @@ -13541,7 +13541,7 @@ static int _cocostudio_TextureData_get_contourDataList(lua_State *L) // cocos2d::Vector contourDataList cocos2d::Vector &ret = self->contourDataList; - int num_ret = olua_push_vector(L, ret, [L](cocostudio::ContourData *arg1) { + int num_ret = olua_push_array(L, ret, [L](cocostudio::ContourData *arg1) { olua_push_object(L, arg1, "ccs.ContourData"); }); @@ -13558,7 +13558,7 @@ static int _cocostudio_TextureData_set_contourDataList(lua_State *L) cocos2d::Vector arg1; /** contourDataList */ olua_to_object(L, 1, &self, "ccs.TextureData"); - olua_check_vector(L, 2, arg1, [L](cocostudio::ContourData **arg1) { + olua_check_array(L, 2, arg1, [L](cocostudio::ContourData **arg1) { olua_check_object(L, -1, arg1, "ccs.ContourData"); }); @@ -14074,7 +14074,7 @@ static int _cocostudio_timeline_Frame_getEasingParams(lua_State *L) // const std::vector &getEasingParams() const std::vector &ret = self->getEasingParams(); - int num_ret = olua_push_vector(L, ret, [L](float &arg1) { + int num_ret = olua_push_array(L, ret, [L](float &arg1) { olua_push_number(L, arg1); }); @@ -14219,7 +14219,7 @@ static int _cocostudio_timeline_Frame_setEasingParams(lua_State *L) std::vector arg1; /** easingParams */ olua_to_object(L, 1, &self, "ccs.timeline.Frame"); - olua_check_vector(L, 2, arg1, [L](float *arg1) { + olua_check_array(L, 2, arg1, [L](float *arg1) { olua_check_number(L, -1, arg1); }); @@ -16638,7 +16638,7 @@ static int _cocostudio_timeline_BoneNode_getAllSubBones(lua_State *L) // @addref(subBones |) cocos2d::Vector getAllSubBones() cocos2d::Vector ret = self->getAllSubBones(); - int num_ret = olua_push_vector(L, ret, [L](cocostudio::timeline::BoneNode *arg1) { + int num_ret = olua_push_array(L, ret, [L](cocostudio::timeline::BoneNode *arg1) { olua_push_object(L, arg1, "ccs.timeline.BoneNode"); }); @@ -16660,7 +16660,7 @@ static int _cocostudio_timeline_BoneNode_getAllSubSkins(lua_State *L) // @addref(subSkins |) cocos2d::Vector getAllSubSkins() cocos2d::Vector ret = self->getAllSubSkins(); - int num_ret = olua_push_vector(L, ret, [L](cocostudio::timeline::SkinNode *arg1) { + int num_ret = olua_push_array(L, ret, [L](cocostudio::timeline::SkinNode *arg1) { olua_push_object(L, arg1, "cc.Node"); }); @@ -16699,7 +16699,7 @@ static int _cocostudio_timeline_BoneNode_getChildBones(lua_State *L) // @addref(bones |) const cocos2d::Vector &getChildBones() const cocos2d::Vector &ret = self->getChildBones(); - int num_ret = olua_push_vector(L, ret, [L](cocostudio::timeline::BoneNode *arg1) { + int num_ret = olua_push_array(L, ret, [L](cocostudio::timeline::BoneNode *arg1) { olua_push_object(L, arg1, "ccs.timeline.BoneNode"); }); @@ -16792,7 +16792,7 @@ static int _cocostudio_timeline_BoneNode_getSkins(lua_State *L) // @addref(skins |) const cocos2d::Vector &getSkins() const cocos2d::Vector &ret = self->getSkins(); - int num_ret = olua_push_vector(L, ret, [L](cocostudio::timeline::SkinNode *arg1) { + int num_ret = olua_push_array(L, ret, [L](cocostudio::timeline::SkinNode *arg1) { olua_push_object(L, arg1, "cc.Node"); }); @@ -16814,7 +16814,7 @@ static int _cocostudio_timeline_BoneNode_getVisibleSkins(lua_State *L) // @addref(skins |) cocos2d::Vector getVisibleSkins() cocos2d::Vector ret = self->getVisibleSkins(); - int num_ret = olua_push_vector(L, ret, [L](cocostudio::timeline::SkinNode *arg1) { + int num_ret = olua_push_array(L, ret, [L](cocostudio::timeline::SkinNode *arg1) { olua_push_object(L, arg1, "cc.Node"); }); @@ -17295,7 +17295,7 @@ static int _cocostudio_timeline_Timeline_getFrames(lua_State *L) // @addref(frames |) const cocos2d::Vector &getFrames() const cocos2d::Vector &ret = self->getFrames(); - int num_ret = olua_push_vector(L, ret, [L](cocostudio::timeline::Frame *arg1) { + int num_ret = olua_push_array(L, ret, [L](cocostudio::timeline::Frame *arg1) { olua_push_object(L, arg1, "ccs.timeline.Frame"); }); @@ -17862,7 +17862,7 @@ static int _cocostudio_timeline_ActionTimeline_getTimelines(lua_State *L) // @addref(timelines |) const cocos2d::Vector &getTimelines() const cocos2d::Vector &ret = self->getTimelines(); - int num_ret = olua_push_vector(L, ret, [L](cocostudio::timeline::Timeline *arg1) { + int num_ret = olua_push_array(L, ret, [L](cocostudio::timeline::Timeline *arg1) { olua_push_object(L, arg1, "ccs.timeline.Timeline"); }); diff --git a/frameworks/cclua/src/lua-bindings/lua_cocos2d_types.cpp b/frameworks/cclua/src/lua-bindings/lua_cocos2d_types.cpp index d885149e..6526cc3c 100644 --- a/frameworks/cclua/src/lua-bindings/lua_cocos2d_types.cpp +++ b/frameworks/cclua/src/lua-bindings/lua_cocos2d_types.cpp @@ -868,8 +868,8 @@ static int _cocos2d_Vec2_isLineIntersect$1(lua_State *L) olua_check_object(L, 2, &arg2, "cc.Vec2"); olua_check_object(L, 3, &arg3, "cc.Vec2"); olua_check_object(L, 4, &arg4, "cc.Vec2"); - olua_check_array(L, 5, &arg5, "olua.float"); - olua_check_array(L, 6, &arg6, "olua.float"); + olua_check_pointer(L, 5, &arg5, "olua.float"); + olua_check_pointer(L, 6, &arg6, "olua.float"); // static bool isLineIntersect(const cocos2d::Vec2 &A, const cocos2d::Vec2 &B, const cocos2d::Vec2 &C, const cocos2d::Vec2 &D, @optional float *S, @optional float *T) bool ret = cocos2d::Vec2::isLineIntersect(arg1, arg2, arg3, arg4, arg5, arg6); @@ -917,7 +917,7 @@ static int _cocos2d_Vec2_isLineIntersect$3(lua_State *L) olua_check_object(L, 2, &arg2, "cc.Vec2"); olua_check_object(L, 3, &arg3, "cc.Vec2"); olua_check_object(L, 4, &arg4, "cc.Vec2"); - olua_check_array(L, 5, &arg5, "olua.float"); + olua_check_pointer(L, 5, &arg5, "olua.float"); // static bool isLineIntersect(const cocos2d::Vec2 &A, const cocos2d::Vec2 &B, const cocos2d::Vec2 &C, const cocos2d::Vec2 &D, @optional float *S, @optional float *T) bool ret = cocos2d::Vec2::isLineIntersect(arg1, arg2, arg3, arg4, arg5); @@ -940,14 +940,14 @@ static int _cocos2d_Vec2_isLineIntersect(lua_State *L) } if (num_args == 5) { - // if ((olua_is_object(L, 1, "cc.Vec2")) && (olua_is_object(L, 2, "cc.Vec2")) && (olua_is_object(L, 3, "cc.Vec2")) && (olua_is_object(L, 4, "cc.Vec2")) && (olua_is_array(L, 5, "olua.float"))) { + // if ((olua_is_object(L, 1, "cc.Vec2")) && (olua_is_object(L, 2, "cc.Vec2")) && (olua_is_object(L, 3, "cc.Vec2")) && (olua_is_object(L, 4, "cc.Vec2")) && (olua_is_pointer(L, 5, "olua.float"))) { // static bool isLineIntersect(const cocos2d::Vec2 &A, const cocos2d::Vec2 &B, const cocos2d::Vec2 &C, const cocos2d::Vec2 &D, @optional float *S, @optional float *T) return _cocos2d_Vec2_isLineIntersect$3(L); // } } if (num_args == 6) { - // if ((olua_is_object(L, 1, "cc.Vec2")) && (olua_is_object(L, 2, "cc.Vec2")) && (olua_is_object(L, 3, "cc.Vec2")) && (olua_is_object(L, 4, "cc.Vec2")) && (olua_is_array(L, 5, "olua.float")) && (olua_is_array(L, 6, "olua.float"))) { + // if ((olua_is_object(L, 1, "cc.Vec2")) && (olua_is_object(L, 2, "cc.Vec2")) && (olua_is_object(L, 3, "cc.Vec2")) && (olua_is_object(L, 4, "cc.Vec2")) && (olua_is_pointer(L, 5, "olua.float")) && (olua_is_pointer(L, 6, "olua.float"))) { // static bool isLineIntersect(const cocos2d::Vec2 &A, const cocos2d::Vec2 &B, const cocos2d::Vec2 &C, const cocos2d::Vec2 &D, @optional float *S, @optional float *T) return _cocos2d_Vec2_isLineIntersect$1(L); // } @@ -1277,7 +1277,7 @@ static int _cocos2d_Vec2_new$3(lua_State *L) float *arg1 = nullptr; /** array */ - olua_check_array(L, 1, &arg1, "olua.float"); + olua_check_pointer(L, 1, &arg1, "olua.float"); // Vec2(const float *array) cocos2d::Vec2 *ret = new cocos2d::Vec2(arg1); @@ -1319,7 +1319,7 @@ static int _cocos2d_Vec2_new(lua_State *L) } if (num_args == 1) { - // if ((olua_is_array(L, 1, "olua.float"))) { + // if ((olua_is_pointer(L, 1, "olua.float"))) { // Vec2(const float *array) return _cocos2d_Vec2_new$3(L); // } @@ -1545,7 +1545,7 @@ static int _cocos2d_Vec2_set$2(lua_State *L) float *arg1 = nullptr; /** array */ olua_to_object(L, 1, &self, "cc.Vec2"); - olua_check_array(L, 2, &arg1, "olua.float"); + olua_check_pointer(L, 2, &arg1, "olua.float"); // void set(const float *array) self->set(arg1); @@ -1603,7 +1603,7 @@ static int _cocos2d_Vec2_set(lua_State *L) return _cocos2d_Vec2_set$3(L); } - // if ((olua_is_array(L, 2, "olua.float"))) { + // if ((olua_is_pointer(L, 2, "olua.float"))) { // void set(const float *array) return _cocos2d_Vec2_set$2(L); // } @@ -2484,7 +2484,7 @@ static int _cocos2d_Vec3_new$3(lua_State *L) float *arg1 = nullptr; /** array */ - olua_check_array(L, 1, &arg1, "olua.float"); + olua_check_pointer(L, 1, &arg1, "olua.float"); // Vec3(const float *array) cocos2d::Vec3 *ret = new cocos2d::Vec3(arg1); @@ -2526,7 +2526,7 @@ static int _cocos2d_Vec3_new(lua_State *L) } if (num_args == 1) { - // if ((olua_is_array(L, 1, "olua.float"))) { + // if ((olua_is_pointer(L, 1, "olua.float"))) { // Vec3(const float *array) return _cocos2d_Vec3_new$3(L); // } @@ -2615,7 +2615,7 @@ static int _cocos2d_Vec3_set$2(lua_State *L) float *arg1 = nullptr; /** array */ olua_to_object(L, 1, &self, "cc.Vec3"); - olua_check_array(L, 2, &arg1, "olua.float"); + olua_check_pointer(L, 2, &arg1, "olua.float"); // void set(const float *array) self->set(arg1); @@ -2673,7 +2673,7 @@ static int _cocos2d_Vec3_set(lua_State *L) return _cocos2d_Vec3_set$3(L); } - // if ((olua_is_array(L, 2, "olua.float"))) { + // if ((olua_is_pointer(L, 2, "olua.float"))) { // void set(const float *array) return _cocos2d_Vec3_set$2(L); // } @@ -3417,7 +3417,7 @@ static int _cocos2d_Vec4_new$3(lua_State *L) float *arg1 = nullptr; /** array */ - olua_check_array(L, 1, &arg1, "olua.float"); + olua_check_pointer(L, 1, &arg1, "olua.float"); // Vec4(const float *array) cocos2d::Vec4 *ret = new cocos2d::Vec4(arg1); @@ -3482,7 +3482,7 @@ static int _cocos2d_Vec4_new(lua_State *L) return _cocos2d_Vec4_new$5(L); } - // if ((olua_is_array(L, 1, "olua.float"))) { + // if ((olua_is_pointer(L, 1, "olua.float"))) { // Vec4(const float *array) return _cocos2d_Vec4_new$3(L); // } @@ -3573,7 +3573,7 @@ static int _cocos2d_Vec4_set$2(lua_State *L) float *arg1 = nullptr; /** array */ olua_to_object(L, 1, &self, "cc.Vec4"); - olua_check_array(L, 2, &arg1, "olua.float"); + olua_check_pointer(L, 2, &arg1, "olua.float"); // void set(const float *array) self->set(arg1); @@ -3631,7 +3631,7 @@ static int _cocos2d_Vec4_set(lua_State *L) return _cocos2d_Vec4_set$3(L); } - // if ((olua_is_array(L, 2, "olua.float"))) { + // if ((olua_is_pointer(L, 2, "olua.float"))) { // void set(const float *array) return _cocos2d_Vec4_set$2(L); // } @@ -6084,7 +6084,7 @@ static int _cocos2d_Mat4_new$3(lua_State *L) float *arg1 = nullptr; /** mat */ - olua_check_array(L, 1, &arg1, "olua.float"); + olua_check_pointer(L, 1, &arg1, "olua.float"); // Mat4(const float *mat) cocos2d::Mat4 *ret = new cocos2d::Mat4(arg1); @@ -6124,7 +6124,7 @@ static int _cocos2d_Mat4_new(lua_State *L) } if (num_args == 1) { - if ((olua_is_array(L, 1, "olua.float"))) { + if ((olua_is_pointer(L, 1, "olua.float"))) { // Mat4(const float *mat) return _cocos2d_Mat4_new$3(L); } @@ -6670,7 +6670,7 @@ static int _cocos2d_Mat4_set$2(lua_State *L) float *arg1 = nullptr; /** mat */ olua_to_object(L, 1, &self, "cc.Mat4"); - olua_check_array(L, 2, &arg1, "olua.float"); + olua_check_pointer(L, 2, &arg1, "olua.float"); // void set(const float *mat) self->set(arg1); @@ -6703,7 +6703,7 @@ static int _cocos2d_Mat4_set(lua_State *L) int num_args = lua_gettop(L) - 1; if (num_args == 1) { - if ((olua_is_array(L, 2, "olua.float"))) { + if ((olua_is_pointer(L, 2, "olua.float"))) { // void set(const float *mat) return _cocos2d_Mat4_set$2(L); } @@ -8201,7 +8201,7 @@ static int _cocos2d_Quaternion_new$3(lua_State *L) float *arg1 = nullptr; /** array */ - olua_check_array(L, 1, &arg1, "olua.float"); + olua_check_pointer(L, 1, &arg1, "olua.float"); // Quaternion(float *array) cocos2d::Quaternion *ret = new cocos2d::Quaternion(arg1); @@ -8261,7 +8261,7 @@ static int _cocos2d_Quaternion_new(lua_State *L) } if (num_args == 1) { - if ((olua_is_array(L, 1, "olua.float"))) { + if ((olua_is_pointer(L, 1, "olua.float"))) { // Quaternion(float *array) return _cocos2d_Quaternion_new$3(L); } @@ -8339,7 +8339,7 @@ static int _cocos2d_Quaternion_set$2(lua_State *L) float *arg1 = nullptr; /** array */ olua_to_object(L, 1, &self, "cc.Quaternion"); - olua_check_array(L, 2, &arg1, "olua.float"); + olua_check_pointer(L, 2, &arg1, "olua.float"); // void set(float *array) self->set(arg1); @@ -8410,7 +8410,7 @@ static int _cocos2d_Quaternion_set(lua_State *L) int num_args = lua_gettop(L) - 1; if (num_args == 1) { - if ((olua_is_array(L, 2, "olua.float"))) { + if ((olua_is_pointer(L, 2, "olua.float"))) { // void set(float *array) return _cocos2d_Quaternion_set$2(L); } @@ -13082,14 +13082,14 @@ static int _cocos2d_backend_TextureInfo___call(lua_State *L) std::vector arg2; /** textures */ olua_getfield(L, 2, "slot"); - olua_check_vector(L, -1, arg1, [L](uint32_t *arg1) { + olua_check_array(L, -1, arg1, [L](uint32_t *arg1) { olua_check_integer(L, -1, arg1); }); ret.slot = arg1; lua_pop(L, 1); olua_getfield(L, 2, "textures"); - olua_check_vector(L, -1, arg2, [L](cocos2d::backend::TextureBackend **arg1) { + olua_check_array(L, -1, arg2, [L](cocos2d::backend::TextureBackend **arg1) { olua_check_object(L, -1, arg1, "ccb.TextureBackend"); }); ret.textures = arg2; @@ -13133,10 +13133,10 @@ static int _cocos2d_backend_TextureInfo_new$1(lua_State *L) std::vector arg1; /** _slots */ std::vector arg2; /** _textures */ - olua_check_vector(L, 1, arg1, [L](uint32_t *arg1) { + olua_check_array(L, 1, arg1, [L](uint32_t *arg1) { olua_check_integer(L, -1, arg1); }); - olua_check_vector(L, 2, arg2, [L](cocos2d::backend::TextureBackend **arg1) { + olua_check_array(L, 2, arg2, [L](cocos2d::backend::TextureBackend **arg1) { olua_check_object(L, -1, arg1, "ccb.TextureBackend"); }); @@ -13199,7 +13199,7 @@ static int _cocos2d_backend_TextureInfo_new(lua_State *L) } if (num_args == 2) { - // if ((olua_is_vector(L, 1)) && (olua_is_vector(L, 2))) { + // if ((olua_is_array(L, 1)) && (olua_is_array(L, 2))) { // TextureInfo(const std::vector &_slots, const std::vector _textures) return _cocos2d_backend_TextureInfo_new$1(L); // } @@ -13252,7 +13252,7 @@ static int _cocos2d_backend_TextureInfo_get_slot(lua_State *L) // std::vector slot std::vector &ret = self->slot; - int num_ret = olua_push_vector(L, ret, [L](uint32_t &arg1) { + int num_ret = olua_push_array(L, ret, [L](uint32_t &arg1) { olua_push_integer(L, arg1); }); @@ -13269,7 +13269,7 @@ static int _cocos2d_backend_TextureInfo_set_slot(lua_State *L) std::vector arg1; /** slot */ olua_to_object(L, 1, &self, "ccb.TextureInfo"); - olua_check_vector(L, 2, arg1, [L](uint32_t *arg1) { + olua_check_array(L, 2, arg1, [L](uint32_t *arg1) { olua_check_integer(L, -1, arg1); }); @@ -13291,7 +13291,7 @@ static int _cocos2d_backend_TextureInfo_get_textures(lua_State *L) // std::vector textures std::vector &ret = self->textures; - int num_ret = olua_push_vector(L, ret, [L](cocos2d::backend::TextureBackend *arg1) { + int num_ret = olua_push_array(L, ret, [L](cocos2d::backend::TextureBackend *arg1) { olua_push_object(L, arg1, "ccb.TextureBackend"); }); @@ -13308,7 +13308,7 @@ static int _cocos2d_backend_TextureInfo_set_textures(lua_State *L) std::vector arg1; /** textures */ olua_to_object(L, 1, &self, "ccb.TextureInfo"); - olua_check_vector(L, 2, arg1, [L](cocos2d::backend::TextureBackend **arg1) { + olua_check_array(L, 2, arg1, [L](cocos2d::backend::TextureBackend **arg1) { olua_check_object(L, -1, arg1, "ccb.TextureBackend"); }); @@ -15345,6 +15345,49 @@ static int _cocos2d_types_VectorString___gc(lua_State *L) return (int)ret; } +static int _cocos2d_types_VectorString___index(lua_State *L) +{ + olua_startinvoke(L); + + cocos2d::types::VectorString *self = nullptr; + unsigned int arg1 = 0; /** idx */ + + olua_to_object(L, 1, &self, "cc.VectorString"); + olua_check_integer(L, 2, &arg1); + + // std::vector __index(unsigned int idx) + std::vector ret = self->__index(arg1); + int num_ret = olua_push_array(L, ret, [L](std::string &arg1) { + olua_push_string(L, arg1); + }); + + olua_endinvoke(L); + + return num_ret; +} + +static int _cocos2d_types_VectorString___newindex(lua_State *L) +{ + olua_startinvoke(L); + + cocos2d::types::VectorString *self = nullptr; + unsigned int arg1 = 0; /** idx */ + std::vector arg2; /** v */ + + olua_to_object(L, 1, &self, "cc.VectorString"); + olua_check_integer(L, 2, &arg1); + olua_check_array(L, 3, arg2, [L](std::string *arg1) { + olua_check_string(L, -1, arg1); + }); + + // void __newindex(unsigned int idx, const std::vector &v) + self->__newindex(arg1, arg2); + + olua_endinvoke(L); + + return 0; +} + static int _cocos2d_types_VectorString___olua_move(lua_State *L) { olua_startinvoke(L); @@ -15357,12 +15400,36 @@ static int _cocos2d_types_VectorString___olua_move(lua_State *L) return 1; } +static int _cocos2d_types_VectorString_assign(lua_State *L) +{ + olua_startinvoke(L); + + cocos2d::types::VectorString *self = nullptr; + const char *arg1 = nullptr; /** data */ + size_t arg2 = 0; /** len */ + + olua_to_object(L, 1, &self, "cc.VectorString"); + olua_check_string(L, 2, &arg1); + olua_check_integer(L, 3, &arg2); + + // void assign(const char *data, size_t len) + self->assign(arg1, arg2); + + olua_endinvoke(L); + + return 0; +} + static int _cocos2d_types_VectorString_create$1(lua_State *L) { olua_startinvoke(L); - // @postnew @name(new) static cocos2d::types::VectorString *create() - cocos2d::types::VectorString *ret = cocos2d::types::VectorString::create(); + size_t arg1 = 0; /** len */ + + olua_check_integer(L, 1, &arg1); + + // @postnew @name(new) static cocos2d::types::VectorString *create(@optional size_t len) + cocos2d::types::VectorString *ret = cocos2d::types::VectorString::create(arg1); int num_ret = olua_push_object(L, ret, "cc.VectorString"); // insert code after call @@ -15377,14 +15444,8 @@ static int _cocos2d_types_VectorString_create$2(lua_State *L) { olua_startinvoke(L); - std::vector arg1; /** v */ - - olua_check_vector(L, 1, arg1, [L](std::string *arg1) { - olua_check_string(L, -1, arg1); - }); - - // @postnew @name(new) static cocos2d::types::VectorString *create(const std::vector &v) - cocos2d::types::VectorString *ret = cocos2d::types::VectorString::create(arg1); + // @postnew @name(new) static cocos2d::types::VectorString *create(@optional size_t len) + cocos2d::types::VectorString *ret = cocos2d::types::VectorString::create(); int num_ret = olua_push_object(L, ret, "cc.VectorString"); // insert code after call @@ -15400,14 +15461,14 @@ static int _cocos2d_types_VectorString_create(lua_State *L) int num_args = lua_gettop(L); if (num_args == 0) { - // @postnew @name(new) static cocos2d::types::VectorString *create() - return _cocos2d_types_VectorString_create$1(L); + // @postnew @name(new) static cocos2d::types::VectorString *create(@optional size_t len) + return _cocos2d_types_VectorString_create$2(L); } if (num_args == 1) { - // if ((olua_is_vector(L, 1))) { - // @postnew @name(new) static cocos2d::types::VectorString *create(const std::vector &v) - return _cocos2d_types_VectorString_create$2(L); + // if ((olua_is_integer(L, 1))) { + // @postnew @name(new) static cocos2d::types::VectorString *create(@optional size_t len) + return _cocos2d_types_VectorString_create$1(L); // } } @@ -15416,6 +15477,144 @@ static int _cocos2d_types_VectorString_create(lua_State *L) return 0; } +static int _cocos2d_types_VectorString_slice$1(lua_State *L) +{ + olua_startinvoke(L); + + cocos2d::types::VectorString *self = nullptr; + size_t arg1 = 0; /** from */ + size_t arg2 = 0; /** to */ + + olua_to_object(L, 1, &self, "cc.VectorString"); + olua_check_integer(L, 2, &arg1); + olua_check_integer(L, 3, &arg2); + + // @postnew cocos2d::types::VectorString *slice(size_t from, @optional size_t to) + cocos2d::types::VectorString *ret = self->slice(arg1, arg2); + int num_ret = olua_push_object(L, ret, "cc.VectorString"); + + // insert code after call + olua_postnew(L, ret); + + olua_endinvoke(L); + + return num_ret; +} + +static int _cocos2d_types_VectorString_slice$2(lua_State *L) +{ + olua_startinvoke(L); + + cocos2d::types::VectorString *self = nullptr; + size_t arg1 = 0; /** from */ + + olua_to_object(L, 1, &self, "cc.VectorString"); + olua_check_integer(L, 2, &arg1); + + // @postnew cocos2d::types::VectorString *slice(size_t from, @optional size_t to) + cocos2d::types::VectorString *ret = self->slice(arg1); + int num_ret = olua_push_object(L, ret, "cc.VectorString"); + + // insert code after call + olua_postnew(L, ret); + + olua_endinvoke(L); + + return num_ret; +} + +static int _cocos2d_types_VectorString_slice(lua_State *L) +{ + int num_args = lua_gettop(L) - 1; + + if (num_args == 1) { + // if ((olua_is_integer(L, 2))) { + // @postnew cocos2d::types::VectorString *slice(size_t from, @optional size_t to) + return _cocos2d_types_VectorString_slice$2(L); + // } + } + + if (num_args == 2) { + // if ((olua_is_integer(L, 2)) && (olua_is_integer(L, 3))) { + // @postnew cocos2d::types::VectorString *slice(size_t from, @optional size_t to) + return _cocos2d_types_VectorString_slice$1(L); + // } + } + + luaL_error(L, "method 'cocos2d::types::VectorString::slice' not support '%d' arguments", num_args); + + return 0; +} + +static int _cocos2d_types_VectorString_sub$1(lua_State *L) +{ + olua_startinvoke(L); + + cocos2d::types::VectorString *self = nullptr; + size_t arg1 = 0; /** from */ + size_t arg2 = 0; /** to */ + + olua_to_object(L, 1, &self, "cc.VectorString"); + olua_check_integer(L, 2, &arg1); + olua_check_integer(L, 3, &arg2); + + // @postnew cocos2d::types::VectorString *sub(size_t from, @optional size_t to) + cocos2d::types::VectorString *ret = self->sub(arg1, arg2); + int num_ret = olua_push_object(L, ret, "cc.VectorString"); + + // insert code after call + olua_postnew(L, ret); + + olua_endinvoke(L); + + return num_ret; +} + +static int _cocos2d_types_VectorString_sub$2(lua_State *L) +{ + olua_startinvoke(L); + + cocos2d::types::VectorString *self = nullptr; + size_t arg1 = 0; /** from */ + + olua_to_object(L, 1, &self, "cc.VectorString"); + olua_check_integer(L, 2, &arg1); + + // @postnew cocos2d::types::VectorString *sub(size_t from, @optional size_t to) + cocos2d::types::VectorString *ret = self->sub(arg1); + int num_ret = olua_push_object(L, ret, "cc.VectorString"); + + // insert code after call + olua_postnew(L, ret); + + olua_endinvoke(L); + + return num_ret; +} + +static int _cocos2d_types_VectorString_sub(lua_State *L) +{ + int num_args = lua_gettop(L) - 1; + + if (num_args == 1) { + // if ((olua_is_integer(L, 2))) { + // @postnew cocos2d::types::VectorString *sub(size_t from, @optional size_t to) + return _cocos2d_types_VectorString_sub$2(L); + // } + } + + if (num_args == 2) { + // if ((olua_is_integer(L, 2)) && (olua_is_integer(L, 3))) { + // @postnew cocos2d::types::VectorString *sub(size_t from, @optional size_t to) + return _cocos2d_types_VectorString_sub$1(L); + // } + } + + luaL_error(L, "method 'cocos2d::types::VectorString::sub' not support '%d' arguments", num_args); + + return 0; +} + static int _cocos2d_types_VectorString_take(lua_State *L) { olua_startinvoke(L); @@ -15433,7 +15632,25 @@ static int _cocos2d_types_VectorString_take(lua_State *L) return num_ret; } -static int _cocos2d_types_VectorString_data(lua_State *L) +static int _cocos2d_types_VectorString_tostring(lua_State *L) +{ + olua_startinvoke(L); + + cocos2d::types::VectorString *self = nullptr; + size_t arg2 = 0; /** len */ + + olua_to_object(L, 1, &self, "cc.VectorString"); + olua_check_integer(L, 2, &arg2); + + // olua_Return tostring(lua_State *L, size_t len) + olua_Return ret = self->tostring(L, arg2); + + olua_endinvoke(L); + + return (int)ret; +} + +static int _cocos2d_types_VectorString_length(lua_State *L) { olua_startinvoke(L); @@ -15441,9 +15658,9 @@ static int _cocos2d_types_VectorString_data(lua_State *L) olua_to_object(L, 1, &self, "cc.VectorString"); - // @getter @name(data) std::vector *data() - std::vector *ret = self->data(); - int num_ret = olua_push_pointer(L, ret, "cc.VectorString"); + // @getter @name(length) size_t length() + size_t ret = self->length(); + int num_ret = olua_push_integer(L, ret); olua_endinvoke(L); @@ -15494,7 +15711,7 @@ static int _cocos2d_types_VectorString_value(lua_State *L) // @getter @name(value) const std::vector &value() const std::vector &ret = self->value(); - int num_ret = olua_push_vector(L, ret, [L](std::string &arg1) { + int num_ret = olua_push_array(L, ret, [L](std::string &arg1) { olua_push_string(L, arg1); }); @@ -15508,10 +15725,16 @@ OLUA_LIB int luaopen_cocos2d_types_VectorString(lua_State *L) { oluacls_class(L, "cc.VectorString"); oluacls_func(L, "__gc", _cocos2d_types_VectorString___gc); + oluacls_func(L, "__index", _cocos2d_types_VectorString___index); + oluacls_func(L, "__newindex", _cocos2d_types_VectorString___newindex); oluacls_func(L, "__olua_move", _cocos2d_types_VectorString___olua_move); + oluacls_func(L, "assign", _cocos2d_types_VectorString_assign); oluacls_func(L, "new", _cocos2d_types_VectorString_create); + oluacls_func(L, "slice", _cocos2d_types_VectorString_slice); + oluacls_func(L, "sub", _cocos2d_types_VectorString_sub); oluacls_func(L, "take", _cocos2d_types_VectorString_take); - oluacls_prop(L, "data", _cocos2d_types_VectorString_data, nullptr); + oluacls_func(L, "tostring", _cocos2d_types_VectorString_tostring); + oluacls_prop(L, "length", _cocos2d_types_VectorString_length, _cocos2d_types_VectorString_length); oluacls_prop(L, "rawdata", _cocos2d_types_VectorString_rawdata, nullptr); oluacls_prop(L, "sizeof", _cocos2d_types_VectorString_size, nullptr); oluacls_prop(L, "value", _cocos2d_types_VectorString_value, _cocos2d_types_VectorString_value); @@ -15536,6 +15759,49 @@ static int _cocos2d_types_VectorInt___gc(lua_State *L) return (int)ret; } +static int _cocos2d_types_VectorInt___index(lua_State *L) +{ + olua_startinvoke(L); + + cocos2d::types::VectorInt *self = nullptr; + unsigned int arg1 = 0; /** idx */ + + olua_to_object(L, 1, &self, "cc.VectorInt"); + olua_check_integer(L, 2, &arg1); + + // std::vector __index(unsigned int idx) + std::vector ret = self->__index(arg1); + int num_ret = olua_push_array(L, ret, [L](int &arg1) { + olua_push_integer(L, arg1); + }); + + olua_endinvoke(L); + + return num_ret; +} + +static int _cocos2d_types_VectorInt___newindex(lua_State *L) +{ + olua_startinvoke(L); + + cocos2d::types::VectorInt *self = nullptr; + unsigned int arg1 = 0; /** idx */ + std::vector arg2; /** v */ + + olua_to_object(L, 1, &self, "cc.VectorInt"); + olua_check_integer(L, 2, &arg1); + olua_check_array(L, 3, arg2, [L](int *arg1) { + olua_check_integer(L, -1, arg1); + }); + + // void __newindex(unsigned int idx, const std::vector &v) + self->__newindex(arg1, arg2); + + olua_endinvoke(L); + + return 0; +} + static int _cocos2d_types_VectorInt___olua_move(lua_State *L) { olua_startinvoke(L); @@ -15548,33 +15814,35 @@ static int _cocos2d_types_VectorInt___olua_move(lua_State *L) return 1; } -static int _cocos2d_types_VectorInt_create$1(lua_State *L) +static int _cocos2d_types_VectorInt_assign(lua_State *L) { olua_startinvoke(L); - // @postnew @name(new) static cocos2d::types::VectorInt *create() - cocos2d::types::VectorInt *ret = cocos2d::types::VectorInt::create(); - int num_ret = olua_push_object(L, ret, "cc.VectorInt"); + cocos2d::types::VectorInt *self = nullptr; + const char *arg1 = nullptr; /** data */ + size_t arg2 = 0; /** len */ - // insert code after call - olua_postnew(L, ret); + olua_to_object(L, 1, &self, "cc.VectorInt"); + olua_check_string(L, 2, &arg1); + olua_check_integer(L, 3, &arg2); + + // void assign(const char *data, size_t len) + self->assign(arg1, arg2); olua_endinvoke(L); - return num_ret; + return 0; } -static int _cocos2d_types_VectorInt_create$2(lua_State *L) +static int _cocos2d_types_VectorInt_create$1(lua_State *L) { olua_startinvoke(L); - std::vector arg1; /** v */ + size_t arg1 = 0; /** len */ - olua_check_vector(L, 1, arg1, [L](int *arg1) { - olua_check_integer(L, -1, arg1); - }); + olua_check_integer(L, 1, &arg1); - // @postnew @name(new) static cocos2d::types::VectorInt *create(const std::vector &v) + // @postnew @name(new) static cocos2d::types::VectorInt *create(@optional size_t len) cocos2d::types::VectorInt *ret = cocos2d::types::VectorInt::create(arg1); int num_ret = olua_push_object(L, ret, "cc.VectorInt"); @@ -15586,19 +15854,35 @@ static int _cocos2d_types_VectorInt_create$2(lua_State *L) return num_ret; } -static int _cocos2d_types_VectorInt_create(lua_State *L) +static int _cocos2d_types_VectorInt_create$2(lua_State *L) +{ + olua_startinvoke(L); + + // @postnew @name(new) static cocos2d::types::VectorInt *create(@optional size_t len) + cocos2d::types::VectorInt *ret = cocos2d::types::VectorInt::create(); + int num_ret = olua_push_object(L, ret, "cc.VectorInt"); + + // insert code after call + olua_postnew(L, ret); + + olua_endinvoke(L); + + return num_ret; +} + +static int _cocos2d_types_VectorInt_create(lua_State *L) { int num_args = lua_gettop(L); if (num_args == 0) { - // @postnew @name(new) static cocos2d::types::VectorInt *create() - return _cocos2d_types_VectorInt_create$1(L); + // @postnew @name(new) static cocos2d::types::VectorInt *create(@optional size_t len) + return _cocos2d_types_VectorInt_create$2(L); } if (num_args == 1) { - // if ((olua_is_vector(L, 1))) { - // @postnew @name(new) static cocos2d::types::VectorInt *create(const std::vector &v) - return _cocos2d_types_VectorInt_create$2(L); + // if ((olua_is_integer(L, 1))) { + // @postnew @name(new) static cocos2d::types::VectorInt *create(@optional size_t len) + return _cocos2d_types_VectorInt_create$1(L); // } } @@ -15607,6 +15891,144 @@ static int _cocos2d_types_VectorInt_create(lua_State *L) return 0; } +static int _cocos2d_types_VectorInt_slice$1(lua_State *L) +{ + olua_startinvoke(L); + + cocos2d::types::VectorInt *self = nullptr; + size_t arg1 = 0; /** from */ + size_t arg2 = 0; /** to */ + + olua_to_object(L, 1, &self, "cc.VectorInt"); + olua_check_integer(L, 2, &arg1); + olua_check_integer(L, 3, &arg2); + + // @postnew cocos2d::types::VectorInt *slice(size_t from, @optional size_t to) + cocos2d::types::VectorInt *ret = self->slice(arg1, arg2); + int num_ret = olua_push_object(L, ret, "cc.VectorInt"); + + // insert code after call + olua_postnew(L, ret); + + olua_endinvoke(L); + + return num_ret; +} + +static int _cocos2d_types_VectorInt_slice$2(lua_State *L) +{ + olua_startinvoke(L); + + cocos2d::types::VectorInt *self = nullptr; + size_t arg1 = 0; /** from */ + + olua_to_object(L, 1, &self, "cc.VectorInt"); + olua_check_integer(L, 2, &arg1); + + // @postnew cocos2d::types::VectorInt *slice(size_t from, @optional size_t to) + cocos2d::types::VectorInt *ret = self->slice(arg1); + int num_ret = olua_push_object(L, ret, "cc.VectorInt"); + + // insert code after call + olua_postnew(L, ret); + + olua_endinvoke(L); + + return num_ret; +} + +static int _cocos2d_types_VectorInt_slice(lua_State *L) +{ + int num_args = lua_gettop(L) - 1; + + if (num_args == 1) { + // if ((olua_is_integer(L, 2))) { + // @postnew cocos2d::types::VectorInt *slice(size_t from, @optional size_t to) + return _cocos2d_types_VectorInt_slice$2(L); + // } + } + + if (num_args == 2) { + // if ((olua_is_integer(L, 2)) && (olua_is_integer(L, 3))) { + // @postnew cocos2d::types::VectorInt *slice(size_t from, @optional size_t to) + return _cocos2d_types_VectorInt_slice$1(L); + // } + } + + luaL_error(L, "method 'cocos2d::types::VectorInt::slice' not support '%d' arguments", num_args); + + return 0; +} + +static int _cocos2d_types_VectorInt_sub$1(lua_State *L) +{ + olua_startinvoke(L); + + cocos2d::types::VectorInt *self = nullptr; + size_t arg1 = 0; /** from */ + size_t arg2 = 0; /** to */ + + olua_to_object(L, 1, &self, "cc.VectorInt"); + olua_check_integer(L, 2, &arg1); + olua_check_integer(L, 3, &arg2); + + // @postnew cocos2d::types::VectorInt *sub(size_t from, @optional size_t to) + cocos2d::types::VectorInt *ret = self->sub(arg1, arg2); + int num_ret = olua_push_object(L, ret, "cc.VectorInt"); + + // insert code after call + olua_postnew(L, ret); + + olua_endinvoke(L); + + return num_ret; +} + +static int _cocos2d_types_VectorInt_sub$2(lua_State *L) +{ + olua_startinvoke(L); + + cocos2d::types::VectorInt *self = nullptr; + size_t arg1 = 0; /** from */ + + olua_to_object(L, 1, &self, "cc.VectorInt"); + olua_check_integer(L, 2, &arg1); + + // @postnew cocos2d::types::VectorInt *sub(size_t from, @optional size_t to) + cocos2d::types::VectorInt *ret = self->sub(arg1); + int num_ret = olua_push_object(L, ret, "cc.VectorInt"); + + // insert code after call + olua_postnew(L, ret); + + olua_endinvoke(L); + + return num_ret; +} + +static int _cocos2d_types_VectorInt_sub(lua_State *L) +{ + int num_args = lua_gettop(L) - 1; + + if (num_args == 1) { + // if ((olua_is_integer(L, 2))) { + // @postnew cocos2d::types::VectorInt *sub(size_t from, @optional size_t to) + return _cocos2d_types_VectorInt_sub$2(L); + // } + } + + if (num_args == 2) { + // if ((olua_is_integer(L, 2)) && (olua_is_integer(L, 3))) { + // @postnew cocos2d::types::VectorInt *sub(size_t from, @optional size_t to) + return _cocos2d_types_VectorInt_sub$1(L); + // } + } + + luaL_error(L, "method 'cocos2d::types::VectorInt::sub' not support '%d' arguments", num_args); + + return 0; +} + static int _cocos2d_types_VectorInt_take(lua_State *L) { olua_startinvoke(L); @@ -15624,17 +16046,35 @@ static int _cocos2d_types_VectorInt_take(lua_State *L) return num_ret; } -static int _cocos2d_types_VectorInt_data(lua_State *L) +static int _cocos2d_types_VectorInt_tostring(lua_State *L) { olua_startinvoke(L); cocos2d::types::VectorInt *self = nullptr; + size_t arg2 = 0; /** len */ olua_to_object(L, 1, &self, "cc.VectorInt"); + olua_check_integer(L, 2, &arg2); - // @getter @name(data) std::vector *data() - std::vector *ret = self->data(); - int num_ret = olua_push_pointer(L, ret, "cc.VectorInt"); + // olua_Return tostring(lua_State *L, size_t len) + olua_Return ret = self->tostring(L, arg2); + + olua_endinvoke(L); + + return (int)ret; +} + +static int _cocos2d_types_VectorInt_length(lua_State *L) +{ + olua_startinvoke(L); + + cocos2d::types::VectorInt *self = nullptr; + + olua_to_object(L, 1, &self, "cc.VectorInt"); + + // @getter @name(length) size_t length() + size_t ret = self->length(); + int num_ret = olua_push_integer(L, ret); olua_endinvoke(L); @@ -15685,7 +16125,7 @@ static int _cocos2d_types_VectorInt_value(lua_State *L) // @getter @name(value) const std::vector &value() const std::vector &ret = self->value(); - int num_ret = olua_push_vector(L, ret, [L](int &arg1) { + int num_ret = olua_push_array(L, ret, [L](int &arg1) { olua_push_integer(L, arg1); }); @@ -15699,10 +16139,16 @@ OLUA_LIB int luaopen_cocos2d_types_VectorInt(lua_State *L) { oluacls_class(L, "cc.VectorInt"); oluacls_func(L, "__gc", _cocos2d_types_VectorInt___gc); + oluacls_func(L, "__index", _cocos2d_types_VectorInt___index); + oluacls_func(L, "__newindex", _cocos2d_types_VectorInt___newindex); oluacls_func(L, "__olua_move", _cocos2d_types_VectorInt___olua_move); + oluacls_func(L, "assign", _cocos2d_types_VectorInt_assign); oluacls_func(L, "new", _cocos2d_types_VectorInt_create); + oluacls_func(L, "slice", _cocos2d_types_VectorInt_slice); + oluacls_func(L, "sub", _cocos2d_types_VectorInt_sub); oluacls_func(L, "take", _cocos2d_types_VectorInt_take); - oluacls_prop(L, "data", _cocos2d_types_VectorInt_data, nullptr); + oluacls_func(L, "tostring", _cocos2d_types_VectorInt_tostring); + oluacls_prop(L, "length", _cocos2d_types_VectorInt_length, _cocos2d_types_VectorInt_length); oluacls_prop(L, "rawdata", _cocos2d_types_VectorInt_rawdata, nullptr); oluacls_prop(L, "sizeof", _cocos2d_types_VectorInt_size, nullptr); oluacls_prop(L, "value", _cocos2d_types_VectorInt_value, _cocos2d_types_VectorInt_value); @@ -15727,6 +16173,45 @@ static int _cocos2d_types_ValueMap___gc(lua_State *L) return (int)ret; } +static int _cocos2d_types_ValueMap___index(lua_State *L) +{ + olua_startinvoke(L); + + cocos2d::types::ValueMap *self = nullptr; + unsigned int arg1 = 0; /** idx */ + + olua_to_object(L, 1, &self, "cc.ValueMap"); + olua_check_integer(L, 2, &arg1); + + // cocos2d::ValueMap __index(unsigned int idx) + cocos2d::ValueMap ret = self->__index(arg1); + int num_ret = olua_push_cocos2d_ValueMap(L, ret); + + olua_endinvoke(L); + + return num_ret; +} + +static int _cocos2d_types_ValueMap___newindex(lua_State *L) +{ + olua_startinvoke(L); + + cocos2d::types::ValueMap *self = nullptr; + unsigned int arg1 = 0; /** idx */ + cocos2d::ValueMap arg2; /** v */ + + olua_to_object(L, 1, &self, "cc.ValueMap"); + olua_check_integer(L, 2, &arg1); + olua_check_cocos2d_ValueMap(L, 3, &arg2); + + // void __newindex(unsigned int idx, const cocos2d::ValueMap &v) + self->__newindex(arg1, arg2); + + olua_endinvoke(L); + + return 0; +} + static int _cocos2d_types_ValueMap___olua_move(lua_State *L) { olua_startinvoke(L); @@ -15739,12 +16224,36 @@ static int _cocos2d_types_ValueMap___olua_move(lua_State *L) return 1; } +static int _cocos2d_types_ValueMap_assign(lua_State *L) +{ + olua_startinvoke(L); + + cocos2d::types::ValueMap *self = nullptr; + const char *arg1 = nullptr; /** data */ + size_t arg2 = 0; /** len */ + + olua_to_object(L, 1, &self, "cc.ValueMap"); + olua_check_string(L, 2, &arg1); + olua_check_integer(L, 3, &arg2); + + // void assign(const char *data, size_t len) + self->assign(arg1, arg2); + + olua_endinvoke(L); + + return 0; +} + static int _cocos2d_types_ValueMap_create$1(lua_State *L) { olua_startinvoke(L); - // @postnew @name(new) static cocos2d::types::ValueMap *create() - cocos2d::types::ValueMap *ret = cocos2d::types::ValueMap::create(); + size_t arg1 = 0; /** len */ + + olua_check_integer(L, 1, &arg1); + + // @postnew @name(new) static cocos2d::types::ValueMap *create(@optional size_t len) + cocos2d::types::ValueMap *ret = cocos2d::types::ValueMap::create(arg1); int num_ret = olua_push_object(L, ret, "cc.ValueMap"); // insert code after call @@ -15759,12 +16268,8 @@ static int _cocos2d_types_ValueMap_create$2(lua_State *L) { olua_startinvoke(L); - cocos2d::ValueMap arg1; /** v */ - - olua_check_cocos2d_ValueMap(L, 1, &arg1); - - // @postnew @name(new) static cocos2d::types::ValueMap *create(const cocos2d::ValueMap &v) - cocos2d::types::ValueMap *ret = cocos2d::types::ValueMap::create(arg1); + // @postnew @name(new) static cocos2d::types::ValueMap *create(@optional size_t len) + cocos2d::types::ValueMap *ret = cocos2d::types::ValueMap::create(); int num_ret = olua_push_object(L, ret, "cc.ValueMap"); // insert code after call @@ -15780,14 +16285,14 @@ static int _cocos2d_types_ValueMap_create(lua_State *L) int num_args = lua_gettop(L); if (num_args == 0) { - // @postnew @name(new) static cocos2d::types::ValueMap *create() - return _cocos2d_types_ValueMap_create$1(L); + // @postnew @name(new) static cocos2d::types::ValueMap *create(@optional size_t len) + return _cocos2d_types_ValueMap_create$2(L); } if (num_args == 1) { - // if ((olua_is_cocos2d_ValueMap(L, 1))) { - // @postnew @name(new) static cocos2d::types::ValueMap *create(const cocos2d::ValueMap &v) - return _cocos2d_types_ValueMap_create$2(L); + // if ((olua_is_integer(L, 1))) { + // @postnew @name(new) static cocos2d::types::ValueMap *create(@optional size_t len) + return _cocos2d_types_ValueMap_create$1(L); // } } @@ -15796,142 +16301,497 @@ static int _cocos2d_types_ValueMap_create(lua_State *L) return 0; } +static int _cocos2d_types_ValueMap_slice$1(lua_State *L) +{ + olua_startinvoke(L); + + cocos2d::types::ValueMap *self = nullptr; + size_t arg1 = 0; /** from */ + size_t arg2 = 0; /** to */ + + olua_to_object(L, 1, &self, "cc.ValueMap"); + olua_check_integer(L, 2, &arg1); + olua_check_integer(L, 3, &arg2); + + // @postnew cocos2d::types::ValueMap *slice(size_t from, @optional size_t to) + cocos2d::types::ValueMap *ret = self->slice(arg1, arg2); + int num_ret = olua_push_object(L, ret, "cc.ValueMap"); + + // insert code after call + olua_postnew(L, ret); + + olua_endinvoke(L); + + return num_ret; +} + +static int _cocos2d_types_ValueMap_slice$2(lua_State *L) +{ + olua_startinvoke(L); + + cocos2d::types::ValueMap *self = nullptr; + size_t arg1 = 0; /** from */ + + olua_to_object(L, 1, &self, "cc.ValueMap"); + olua_check_integer(L, 2, &arg1); + + // @postnew cocos2d::types::ValueMap *slice(size_t from, @optional size_t to) + cocos2d::types::ValueMap *ret = self->slice(arg1); + int num_ret = olua_push_object(L, ret, "cc.ValueMap"); + + // insert code after call + olua_postnew(L, ret); + + olua_endinvoke(L); + + return num_ret; +} + +static int _cocos2d_types_ValueMap_slice(lua_State *L) +{ + int num_args = lua_gettop(L) - 1; + + if (num_args == 1) { + // if ((olua_is_integer(L, 2))) { + // @postnew cocos2d::types::ValueMap *slice(size_t from, @optional size_t to) + return _cocos2d_types_ValueMap_slice$2(L); + // } + } + + if (num_args == 2) { + // if ((olua_is_integer(L, 2)) && (olua_is_integer(L, 3))) { + // @postnew cocos2d::types::ValueMap *slice(size_t from, @optional size_t to) + return _cocos2d_types_ValueMap_slice$1(L); + // } + } + + luaL_error(L, "method 'cocos2d::types::ValueMap::slice' not support '%d' arguments", num_args); + + return 0; +} + +static int _cocos2d_types_ValueMap_sub$1(lua_State *L) +{ + olua_startinvoke(L); + + cocos2d::types::ValueMap *self = nullptr; + size_t arg1 = 0; /** from */ + size_t arg2 = 0; /** to */ + + olua_to_object(L, 1, &self, "cc.ValueMap"); + olua_check_integer(L, 2, &arg1); + olua_check_integer(L, 3, &arg2); + + // @postnew cocos2d::types::ValueMap *sub(size_t from, @optional size_t to) + cocos2d::types::ValueMap *ret = self->sub(arg1, arg2); + int num_ret = olua_push_object(L, ret, "cc.ValueMap"); + + // insert code after call + olua_postnew(L, ret); + + olua_endinvoke(L); + + return num_ret; +} + +static int _cocos2d_types_ValueMap_sub$2(lua_State *L) +{ + olua_startinvoke(L); + + cocos2d::types::ValueMap *self = nullptr; + size_t arg1 = 0; /** from */ + + olua_to_object(L, 1, &self, "cc.ValueMap"); + olua_check_integer(L, 2, &arg1); + + // @postnew cocos2d::types::ValueMap *sub(size_t from, @optional size_t to) + cocos2d::types::ValueMap *ret = self->sub(arg1); + int num_ret = olua_push_object(L, ret, "cc.ValueMap"); + + // insert code after call + olua_postnew(L, ret); + + olua_endinvoke(L); + + return num_ret; +} + +static int _cocos2d_types_ValueMap_sub(lua_State *L) +{ + int num_args = lua_gettop(L) - 1; + + if (num_args == 1) { + // if ((olua_is_integer(L, 2))) { + // @postnew cocos2d::types::ValueMap *sub(size_t from, @optional size_t to) + return _cocos2d_types_ValueMap_sub$2(L); + // } + } + + if (num_args == 2) { + // if ((olua_is_integer(L, 2)) && (olua_is_integer(L, 3))) { + // @postnew cocos2d::types::ValueMap *sub(size_t from, @optional size_t to) + return _cocos2d_types_ValueMap_sub$1(L); + // } + } + + luaL_error(L, "method 'cocos2d::types::ValueMap::sub' not support '%d' arguments", num_args); + + return 0; +} + static int _cocos2d_types_ValueMap_take(lua_State *L) { olua_startinvoke(L); - cocos2d::types::ValueMap *self = nullptr; + cocos2d::types::ValueMap *self = nullptr; + + olua_to_object(L, 1, &self, "cc.ValueMap"); + + // cocos2d::types::ValueMap *take() + cocos2d::types::ValueMap *ret = self->take(); + int num_ret = olua_push_object(L, ret, "cc.ValueMap"); + + olua_endinvoke(L); + + return num_ret; +} + +static int _cocos2d_types_ValueMap_tostring(lua_State *L) +{ + olua_startinvoke(L); + + cocos2d::types::ValueMap *self = nullptr; + size_t arg2 = 0; /** len */ + + olua_to_object(L, 1, &self, "cc.ValueMap"); + olua_check_integer(L, 2, &arg2); + + // olua_Return tostring(lua_State *L, size_t len) + olua_Return ret = self->tostring(L, arg2); + + olua_endinvoke(L); + + return (int)ret; +} + +static int _cocos2d_types_ValueMap_length(lua_State *L) +{ + olua_startinvoke(L); + + cocos2d::types::ValueMap *self = nullptr; + + olua_to_object(L, 1, &self, "cc.ValueMap"); + + // @getter @name(length) size_t length() + size_t ret = self->length(); + int num_ret = olua_push_integer(L, ret); + + olua_endinvoke(L); + + return num_ret; +} + +static int _cocos2d_types_ValueMap_rawdata(lua_State *L) +{ + olua_startinvoke(L); + + cocos2d::types::ValueMap *self = nullptr; + + olua_to_object(L, 1, &self, "cc.ValueMap"); + + // @getter @name(rawdata) void *rawdata() + void *ret = self->rawdata(); + int num_ret = olua_push_object(L, ret, "void *"); + + olua_endinvoke(L); + + return num_ret; +} + +static int _cocos2d_types_ValueMap_size(lua_State *L) +{ + olua_startinvoke(L); + + cocos2d::types::ValueMap *self = nullptr; + + olua_to_object(L, 1, &self, "cc.ValueMap"); + + // @getter @name(sizeof) size_t size() + size_t ret = self->size(); + int num_ret = olua_push_integer(L, ret); + + olua_endinvoke(L); + + return num_ret; +} + +static int _cocos2d_types_ValueMap_value(lua_State *L) +{ + olua_startinvoke(L); + + cocos2d::types::ValueMap *self = nullptr; + + olua_to_object(L, 1, &self, "cc.ValueMap"); + + // @getter @name(value) const cocos2d::ValueMap &value() + const cocos2d::ValueMap &ret = self->value(); + int num_ret = olua_push_cocos2d_ValueMap(L, ret); + + olua_endinvoke(L); + + return num_ret; +} + +OLUA_BEGIN_DECLS +OLUA_LIB int luaopen_cocos2d_types_ValueMap(lua_State *L) +{ + oluacls_class(L, "cc.ValueMap"); + oluacls_func(L, "__gc", _cocos2d_types_ValueMap___gc); + oluacls_func(L, "__index", _cocos2d_types_ValueMap___index); + oluacls_func(L, "__newindex", _cocos2d_types_ValueMap___newindex); + oluacls_func(L, "__olua_move", _cocos2d_types_ValueMap___olua_move); + oluacls_func(L, "assign", _cocos2d_types_ValueMap_assign); + oluacls_func(L, "new", _cocos2d_types_ValueMap_create); + oluacls_func(L, "slice", _cocos2d_types_ValueMap_slice); + oluacls_func(L, "sub", _cocos2d_types_ValueMap_sub); + oluacls_func(L, "take", _cocos2d_types_ValueMap_take); + oluacls_func(L, "tostring", _cocos2d_types_ValueMap_tostring); + oluacls_prop(L, "length", _cocos2d_types_ValueMap_length, _cocos2d_types_ValueMap_length); + oluacls_prop(L, "rawdata", _cocos2d_types_ValueMap_rawdata, nullptr); + oluacls_prop(L, "sizeof", _cocos2d_types_ValueMap_size, nullptr); + oluacls_prop(L, "value", _cocos2d_types_ValueMap_value, _cocos2d_types_ValueMap_value); + + return 1; +} +OLUA_END_DECLS + +static int _cocos2d_types_TMXTileFlags___gc(lua_State *L) +{ + olua_startinvoke(L); + + cocos2d::types::TMXTileFlags *self = nullptr; + + olua_to_object(L, 1, &self, "cc.TMXTileFlags"); + + // olua_Return __gc(lua_State *L) + olua_Return ret = self->__gc(L); + + olua_endinvoke(L); + + return (int)ret; +} + +static int _cocos2d_types_TMXTileFlags___index(lua_State *L) +{ + olua_startinvoke(L); + + cocos2d::types::TMXTileFlags *self = nullptr; + unsigned int arg1 = 0; /** idx */ + + olua_to_object(L, 1, &self, "cc.TMXTileFlags"); + olua_check_integer(L, 2, &arg1); + + // cocos2d::TMXTileFlags __index(unsigned int idx) + cocos2d::TMXTileFlags ret = self->__index(arg1); + int num_ret = olua_push_enum(L, ret); + + olua_endinvoke(L); + + return num_ret; +} + +static int _cocos2d_types_TMXTileFlags___newindex(lua_State *L) +{ + olua_startinvoke(L); + + cocos2d::types::TMXTileFlags *self = nullptr; + unsigned int arg1 = 0; /** idx */ + cocos2d::TMXTileFlags arg2 = (cocos2d::TMXTileFlags)0; /** v */ - olua_to_object(L, 1, &self, "cc.ValueMap"); + olua_to_object(L, 1, &self, "cc.TMXTileFlags"); + olua_check_integer(L, 2, &arg1); + olua_check_enum(L, 3, &arg2); - // cocos2d::types::ValueMap *take() - cocos2d::types::ValueMap *ret = self->take(); - int num_ret = olua_push_object(L, ret, "cc.ValueMap"); + // void __newindex(unsigned int idx, const cocos2d::TMXTileFlags &v) + self->__newindex(arg1, arg2); olua_endinvoke(L); - return num_ret; + return 0; } -static int _cocos2d_types_ValueMap_data(lua_State *L) +static int _cocos2d_types_TMXTileFlags___olua_move(lua_State *L) { olua_startinvoke(L); - cocos2d::types::ValueMap *self = nullptr; - - olua_to_object(L, 1, &self, "cc.ValueMap"); - - // @getter @name(data) cocos2d::ValueMap *data() - cocos2d::ValueMap *ret = self->data(); - int num_ret = olua_push_pointer(L, ret, "cc.ValueMap"); + auto self = (cocos2d::types::TMXTileFlags *)olua_toobj(L, 1, "cc.TMXTileFlags"); + olua_push_object(L, self, "cc.TMXTileFlags"); olua_endinvoke(L); - return num_ret; + return 1; } -static int _cocos2d_types_ValueMap_rawdata(lua_State *L) +static int _cocos2d_types_TMXTileFlags_assign(lua_State *L) { olua_startinvoke(L); - cocos2d::types::ValueMap *self = nullptr; + cocos2d::types::TMXTileFlags *self = nullptr; + const char *arg1 = nullptr; /** data */ + size_t arg2 = 0; /** len */ - olua_to_object(L, 1, &self, "cc.ValueMap"); + olua_to_object(L, 1, &self, "cc.TMXTileFlags"); + olua_check_string(L, 2, &arg1); + olua_check_integer(L, 3, &arg2); - // @getter @name(rawdata) void *rawdata() - void *ret = self->rawdata(); - int num_ret = olua_push_object(L, ret, "void *"); + // void assign(const char *data, size_t len) + self->assign(arg1, arg2); olua_endinvoke(L); - return num_ret; + return 0; } -static int _cocos2d_types_ValueMap_size(lua_State *L) +static int _cocos2d_types_TMXTileFlags_create$1(lua_State *L) { olua_startinvoke(L); - cocos2d::types::ValueMap *self = nullptr; + size_t arg1 = 0; /** len */ - olua_to_object(L, 1, &self, "cc.ValueMap"); + olua_check_integer(L, 1, &arg1); - // @getter @name(sizeof) size_t size() - size_t ret = self->size(); - int num_ret = olua_push_integer(L, ret); + // @postnew @name(new) static cocos2d::types::TMXTileFlags *create(@optional size_t len) + cocos2d::types::TMXTileFlags *ret = cocos2d::types::TMXTileFlags::create(arg1); + int num_ret = olua_push_object(L, ret, "cc.TMXTileFlags"); + + // insert code after call + olua_postnew(L, ret); olua_endinvoke(L); return num_ret; } -static int _cocos2d_types_ValueMap_value(lua_State *L) +static int _cocos2d_types_TMXTileFlags_create$2(lua_State *L) { olua_startinvoke(L); - cocos2d::types::ValueMap *self = nullptr; - - olua_to_object(L, 1, &self, "cc.ValueMap"); + // @postnew @name(new) static cocos2d::types::TMXTileFlags *create(@optional size_t len) + cocos2d::types::TMXTileFlags *ret = cocos2d::types::TMXTileFlags::create(); + int num_ret = olua_push_object(L, ret, "cc.TMXTileFlags"); - // @getter @name(value) const cocos2d::ValueMap &value() - const cocos2d::ValueMap &ret = self->value(); - int num_ret = olua_push_cocos2d_ValueMap(L, ret); + // insert code after call + olua_postnew(L, ret); olua_endinvoke(L); return num_ret; } -OLUA_BEGIN_DECLS -OLUA_LIB int luaopen_cocos2d_types_ValueMap(lua_State *L) +static int _cocos2d_types_TMXTileFlags_create(lua_State *L) { - oluacls_class(L, "cc.ValueMap"); - oluacls_func(L, "__gc", _cocos2d_types_ValueMap___gc); - oluacls_func(L, "__olua_move", _cocos2d_types_ValueMap___olua_move); - oluacls_func(L, "new", _cocos2d_types_ValueMap_create); - oluacls_func(L, "take", _cocos2d_types_ValueMap_take); - oluacls_prop(L, "data", _cocos2d_types_ValueMap_data, nullptr); - oluacls_prop(L, "rawdata", _cocos2d_types_ValueMap_rawdata, nullptr); - oluacls_prop(L, "sizeof", _cocos2d_types_ValueMap_size, nullptr); - oluacls_prop(L, "value", _cocos2d_types_ValueMap_value, _cocos2d_types_ValueMap_value); + int num_args = lua_gettop(L); - return 1; + if (num_args == 0) { + // @postnew @name(new) static cocos2d::types::TMXTileFlags *create(@optional size_t len) + return _cocos2d_types_TMXTileFlags_create$2(L); + } + + if (num_args == 1) { + // if ((olua_is_integer(L, 1))) { + // @postnew @name(new) static cocos2d::types::TMXTileFlags *create(@optional size_t len) + return _cocos2d_types_TMXTileFlags_create$1(L); + // } + } + + luaL_error(L, "method 'cocos2d::types::TMXTileFlags::create' not support '%d' arguments", num_args); + + return 0; } -OLUA_END_DECLS -static int _cocos2d_types_TMXTileFlags___gc(lua_State *L) +static int _cocos2d_types_TMXTileFlags_slice$1(lua_State *L) { olua_startinvoke(L); cocos2d::types::TMXTileFlags *self = nullptr; + size_t arg1 = 0; /** from */ + size_t arg2 = 0; /** to */ olua_to_object(L, 1, &self, "cc.TMXTileFlags"); + olua_check_integer(L, 2, &arg1); + olua_check_integer(L, 3, &arg2); - // olua_Return __gc(lua_State *L) - olua_Return ret = self->__gc(L); + // @postnew cocos2d::types::TMXTileFlags *slice(size_t from, @optional size_t to) + cocos2d::types::TMXTileFlags *ret = self->slice(arg1, arg2); + int num_ret = olua_push_object(L, ret, "cc.TMXTileFlags"); + + // insert code after call + olua_postnew(L, ret); olua_endinvoke(L); - return (int)ret; + return num_ret; } -static int _cocos2d_types_TMXTileFlags___olua_move(lua_State *L) +static int _cocos2d_types_TMXTileFlags_slice$2(lua_State *L) { olua_startinvoke(L); - auto self = (cocos2d::types::TMXTileFlags *)olua_toobj(L, 1, "cc.TMXTileFlags"); - olua_push_object(L, self, "cc.TMXTileFlags"); + cocos2d::types::TMXTileFlags *self = nullptr; + size_t arg1 = 0; /** from */ + + olua_to_object(L, 1, &self, "cc.TMXTileFlags"); + olua_check_integer(L, 2, &arg1); + + // @postnew cocos2d::types::TMXTileFlags *slice(size_t from, @optional size_t to) + cocos2d::types::TMXTileFlags *ret = self->slice(arg1); + int num_ret = olua_push_object(L, ret, "cc.TMXTileFlags"); + + // insert code after call + olua_postnew(L, ret); olua_endinvoke(L); - return 1; + return num_ret; } -static int _cocos2d_types_TMXTileFlags_create$1(lua_State *L) +static int _cocos2d_types_TMXTileFlags_slice(lua_State *L) +{ + int num_args = lua_gettop(L) - 1; + + if (num_args == 1) { + // if ((olua_is_integer(L, 2))) { + // @postnew cocos2d::types::TMXTileFlags *slice(size_t from, @optional size_t to) + return _cocos2d_types_TMXTileFlags_slice$2(L); + // } + } + + if (num_args == 2) { + // if ((olua_is_integer(L, 2)) && (olua_is_integer(L, 3))) { + // @postnew cocos2d::types::TMXTileFlags *slice(size_t from, @optional size_t to) + return _cocos2d_types_TMXTileFlags_slice$1(L); + // } + } + + luaL_error(L, "method 'cocos2d::types::TMXTileFlags::slice' not support '%d' arguments", num_args); + + return 0; +} + +static int _cocos2d_types_TMXTileFlags_sub$1(lua_State *L) { olua_startinvoke(L); - // @postnew @name(new) static cocos2d::types::TMXTileFlags *create() - cocos2d::types::TMXTileFlags *ret = cocos2d::types::TMXTileFlags::create(); + cocos2d::types::TMXTileFlags *self = nullptr; + size_t arg1 = 0; /** from */ + size_t arg2 = 0; /** to */ + + olua_to_object(L, 1, &self, "cc.TMXTileFlags"); + olua_check_integer(L, 2, &arg1); + olua_check_integer(L, 3, &arg2); + + // @postnew cocos2d::types::TMXTileFlags *sub(size_t from, @optional size_t to) + cocos2d::types::TMXTileFlags *ret = self->sub(arg1, arg2); int num_ret = olua_push_object(L, ret, "cc.TMXTileFlags"); // insert code after call @@ -15942,16 +16802,18 @@ static int _cocos2d_types_TMXTileFlags_create$1(lua_State *L) return num_ret; } -static int _cocos2d_types_TMXTileFlags_create$2(lua_State *L) +static int _cocos2d_types_TMXTileFlags_sub$2(lua_State *L) { olua_startinvoke(L); - cocos2d::TMXTileFlags arg1 = (cocos2d::TMXTileFlags)0; /** v */ + cocos2d::types::TMXTileFlags *self = nullptr; + size_t arg1 = 0; /** from */ - olua_check_enum(L, 1, &arg1); + olua_to_object(L, 1, &self, "cc.TMXTileFlags"); + olua_check_integer(L, 2, &arg1); - // @postnew @name(new) static cocos2d::types::TMXTileFlags *create(const cocos2d::TMXTileFlags &v) - cocos2d::types::TMXTileFlags *ret = cocos2d::types::TMXTileFlags::create(arg1); + // @postnew cocos2d::types::TMXTileFlags *sub(size_t from, @optional size_t to) + cocos2d::types::TMXTileFlags *ret = self->sub(arg1); int num_ret = olua_push_object(L, ret, "cc.TMXTileFlags"); // insert code after call @@ -15962,23 +16824,25 @@ static int _cocos2d_types_TMXTileFlags_create$2(lua_State *L) return num_ret; } -static int _cocos2d_types_TMXTileFlags_create(lua_State *L) +static int _cocos2d_types_TMXTileFlags_sub(lua_State *L) { - int num_args = lua_gettop(L); + int num_args = lua_gettop(L) - 1; - if (num_args == 0) { - // @postnew @name(new) static cocos2d::types::TMXTileFlags *create() - return _cocos2d_types_TMXTileFlags_create$1(L); + if (num_args == 1) { + // if ((olua_is_integer(L, 2))) { + // @postnew cocos2d::types::TMXTileFlags *sub(size_t from, @optional size_t to) + return _cocos2d_types_TMXTileFlags_sub$2(L); + // } } - if (num_args == 1) { - // if ((olua_is_enum(L, 1))) { - // @postnew @name(new) static cocos2d::types::TMXTileFlags *create(const cocos2d::TMXTileFlags &v) - return _cocos2d_types_TMXTileFlags_create$2(L); + if (num_args == 2) { + // if ((olua_is_integer(L, 2)) && (olua_is_integer(L, 3))) { + // @postnew cocos2d::types::TMXTileFlags *sub(size_t from, @optional size_t to) + return _cocos2d_types_TMXTileFlags_sub$1(L); // } } - luaL_error(L, "method 'cocos2d::types::TMXTileFlags::create' not support '%d' arguments", num_args); + luaL_error(L, "method 'cocos2d::types::TMXTileFlags::sub' not support '%d' arguments", num_args); return 0; } @@ -16000,7 +16864,25 @@ static int _cocos2d_types_TMXTileFlags_take(lua_State *L) return num_ret; } -static int _cocos2d_types_TMXTileFlags_data(lua_State *L) +static int _cocos2d_types_TMXTileFlags_tostring(lua_State *L) +{ + olua_startinvoke(L); + + cocos2d::types::TMXTileFlags *self = nullptr; + size_t arg2 = 0; /** len */ + + olua_to_object(L, 1, &self, "cc.TMXTileFlags"); + olua_check_integer(L, 2, &arg2); + + // olua_Return tostring(lua_State *L, size_t len) + olua_Return ret = self->tostring(L, arg2); + + olua_endinvoke(L); + + return (int)ret; +} + +static int _cocos2d_types_TMXTileFlags_length(lua_State *L) { olua_startinvoke(L); @@ -16008,9 +16890,9 @@ static int _cocos2d_types_TMXTileFlags_data(lua_State *L) olua_to_object(L, 1, &self, "cc.TMXTileFlags"); - // @getter @name(data) cocos2d::TMXTileFlags *data() - cocos2d::TMXTileFlags *ret = self->data(); - int num_ret = olua_push_pointer(L, ret, "cc.TMXTileFlags"); + // @getter @name(length) size_t length() + size_t ret = self->length(); + int num_ret = olua_push_integer(L, ret); olua_endinvoke(L); @@ -16073,10 +16955,16 @@ OLUA_LIB int luaopen_cocos2d_types_TMXTileFlags(lua_State *L) { oluacls_class(L, "cc.TMXTileFlags"); oluacls_func(L, "__gc", _cocos2d_types_TMXTileFlags___gc); + oluacls_func(L, "__index", _cocos2d_types_TMXTileFlags___index); + oluacls_func(L, "__newindex", _cocos2d_types_TMXTileFlags___newindex); oluacls_func(L, "__olua_move", _cocos2d_types_TMXTileFlags___olua_move); + oluacls_func(L, "assign", _cocos2d_types_TMXTileFlags_assign); oluacls_func(L, "new", _cocos2d_types_TMXTileFlags_create); + oluacls_func(L, "slice", _cocos2d_types_TMXTileFlags_slice); + oluacls_func(L, "sub", _cocos2d_types_TMXTileFlags_sub); oluacls_func(L, "take", _cocos2d_types_TMXTileFlags_take); - oluacls_prop(L, "data", _cocos2d_types_TMXTileFlags_data, nullptr); + oluacls_func(L, "tostring", _cocos2d_types_TMXTileFlags_tostring); + oluacls_prop(L, "length", _cocos2d_types_TMXTileFlags_length, _cocos2d_types_TMXTileFlags_length); oluacls_prop(L, "rawdata", _cocos2d_types_TMXTileFlags_rawdata, nullptr); oluacls_prop(L, "sizeof", _cocos2d_types_TMXTileFlags_size, nullptr); oluacls_prop(L, "value", _cocos2d_types_TMXTileFlags_value, _cocos2d_types_TMXTileFlags_value); @@ -16152,6 +17040,26 @@ static int _cocos2d_types_Vec2Array___olua_move(lua_State *L) return 1; } +static int _cocos2d_types_Vec2Array_assign(lua_State *L) +{ + olua_startinvoke(L); + + cocos2d::types::Vec2Array *self = nullptr; + const char *arg1 = nullptr; /** data */ + size_t arg2 = 0; /** len */ + + olua_to_object(L, 1, &self, "cc.Vec2Array"); + olua_check_string(L, 2, &arg1); + olua_check_integer(L, 3, &arg2); + + // void assign(const char *data, size_t len) + self->assign(arg1, arg2); + + olua_endinvoke(L); + + return 0; +} + static int _cocos2d_types_Vec2Array_create$1(lua_State *L) { olua_startinvoke(L); @@ -16209,23 +17117,72 @@ static int _cocos2d_types_Vec2Array_create(lua_State *L) return 0; } -static int _cocos2d_types_Vec2Array_setstring(lua_State *L) +static int _cocos2d_types_Vec2Array_slice$1(lua_State *L) { olua_startinvoke(L); cocos2d::types::Vec2Array *self = nullptr; - const char *arg1 = nullptr; /** data */ - size_t arg2 = 0; /** len */ + size_t arg1 = 0; /** from */ + size_t arg2 = 0; /** to */ olua_to_object(L, 1, &self, "cc.Vec2Array"); - olua_check_string(L, 2, &arg1); + olua_check_integer(L, 2, &arg1); olua_check_integer(L, 3, &arg2); - // void setstring(const char *data, size_t len) - self->setstring(arg1, arg2); + // @postnew cocos2d::types::Vec2Array *slice(size_t from, @optional size_t to) + cocos2d::types::Vec2Array *ret = self->slice(arg1, arg2); + int num_ret = olua_push_object(L, ret, "cc.Vec2Array"); + + // insert code after call + olua_postnew(L, ret); + + olua_endinvoke(L); + + return num_ret; +} + +static int _cocos2d_types_Vec2Array_slice$2(lua_State *L) +{ + olua_startinvoke(L); + + cocos2d::types::Vec2Array *self = nullptr; + size_t arg1 = 0; /** from */ + + olua_to_object(L, 1, &self, "cc.Vec2Array"); + olua_check_integer(L, 2, &arg1); + + // @postnew cocos2d::types::Vec2Array *slice(size_t from, @optional size_t to) + cocos2d::types::Vec2Array *ret = self->slice(arg1); + int num_ret = olua_push_object(L, ret, "cc.Vec2Array"); + + // insert code after call + olua_postnew(L, ret); olua_endinvoke(L); + return num_ret; +} + +static int _cocos2d_types_Vec2Array_slice(lua_State *L) +{ + int num_args = lua_gettop(L) - 1; + + if (num_args == 1) { + // if ((olua_is_integer(L, 2))) { + // @postnew cocos2d::types::Vec2Array *slice(size_t from, @optional size_t to) + return _cocos2d_types_Vec2Array_slice$2(L); + // } + } + + if (num_args == 2) { + // if ((olua_is_integer(L, 2)) && (olua_is_integer(L, 3))) { + // @postnew cocos2d::types::Vec2Array *slice(size_t from, @optional size_t to) + return _cocos2d_types_Vec2Array_slice$1(L); + // } + } + + luaL_error(L, "method 'cocos2d::types::Vec2Array::slice' not support '%d' arguments", num_args); + return 0; } @@ -16333,23 +17290,6 @@ static int _cocos2d_types_Vec2Array_tostring(lua_State *L) return (int)ret; } -static int _cocos2d_types_Vec2Array_data(lua_State *L) -{ - olua_startinvoke(L); - - cocos2d::types::Vec2Array *self = nullptr; - - olua_to_object(L, 1, &self, "cc.Vec2Array"); - - // @getter @name(data) cocos2d::Vec2 *data() - cocos2d::Vec2 *ret = self->data(); - int num_ret = olua_push_object(L, ret, "cc.Vec2"); - - olua_endinvoke(L); - - return num_ret; -} - static int _cocos2d_types_Vec2Array_length(lua_State *L) { olua_startinvoke(L); @@ -16426,12 +17366,12 @@ OLUA_LIB int luaopen_cocos2d_types_Vec2Array(lua_State *L) oluacls_func(L, "__index", _cocos2d_types_Vec2Array___index); oluacls_func(L, "__newindex", _cocos2d_types_Vec2Array___newindex); oluacls_func(L, "__olua_move", _cocos2d_types_Vec2Array___olua_move); + oluacls_func(L, "assign", _cocos2d_types_Vec2Array_assign); oluacls_func(L, "new", _cocos2d_types_Vec2Array_create); - oluacls_func(L, "setstring", _cocos2d_types_Vec2Array_setstring); + oluacls_func(L, "slice", _cocos2d_types_Vec2Array_slice); oluacls_func(L, "sub", _cocos2d_types_Vec2Array_sub); oluacls_func(L, "take", _cocos2d_types_Vec2Array_take); oluacls_func(L, "tostring", _cocos2d_types_Vec2Array_tostring); - oluacls_prop(L, "data", _cocos2d_types_Vec2Array_data, nullptr); oluacls_prop(L, "length", _cocos2d_types_Vec2Array_length, _cocos2d_types_Vec2Array_length); oluacls_prop(L, "rawdata", _cocos2d_types_Vec2Array_rawdata, nullptr); oluacls_prop(L, "sizeof", _cocos2d_types_Vec2Array_size, nullptr); diff --git a/frameworks/cclua/src/lua-bindings/lua_cocos2d_ui.cpp b/frameworks/cclua/src/lua-bindings/lua_cocos2d_ui.cpp index 066880d6..2346c9fa 100644 --- a/frameworks/cclua/src/lua-bindings/lua_cocos2d_ui.cpp +++ b/frameworks/cclua/src/lua-bindings/lua_cocos2d_ui.cpp @@ -324,7 +324,7 @@ static int _cocos2d_ui_LayoutProtocol_getLayoutElements(lua_State *L) // const cocos2d::Vector &getLayoutElements() const cocos2d::Vector &ret = self->getLayoutElements(); - int num_ret = olua_push_vector(L, ret, [L](cocos2d::Node *arg1) { + int num_ret = olua_push_array(L, ret, [L](cocos2d::Node *arg1) { olua_push_object(L, arg1, "cc.Node"); }); @@ -10811,7 +10811,7 @@ static int _cocos2d_ui_ListView_getItems(lua_State *L) // @addref(children |) cocos2d::Vector &getItems() cocos2d::Vector &ret = self->getItems(); - int num_ret = olua_push_vector(L, ret, [L](cocos2d::ui::Widget *arg1) { + int num_ret = olua_push_array(L, ret, [L](cocos2d::ui::Widget *arg1) { olua_push_object(L, arg1, "ccui.Widget"); }); diff --git a/frameworks/cclua/src/lua-bindings/lua_conv_manual.h b/frameworks/cclua/src/lua-bindings/lua_conv_manual.h index 801dd6f3..16e8667a 100644 --- a/frameworks/cclua/src/lua-bindings/lua_conv_manual.h +++ b/frameworks/cclua/src/lua-bindings/lua_conv_manual.h @@ -34,7 +34,7 @@ bool olua_is_cocos2d_Color4F(lua_State *L, int idx); // Vector template -void olua_insert_vector(cocos2d::Vector &array, const T &value) +void olua_insert_array(cocos2d::Vector &array, const T &value) { array.pushBack(value); } @@ -64,13 +64,13 @@ void olua_check_cocos2d_ValueMap(lua_State *L, int idx, cocos2d::ValueMap *value #ifdef CCLUA_BUILD_SPINE template -void olua_insert_vector(spine::Vector &array, const T &value) +void olua_insert_array(spine::Vector &array, const T &value) { array.add(value); } template -void olua_foreach_vector(const spine::Vector &array, const std::function &callback) +void olua_foreach_array(const spine::Vector &array, const std::function &callback) { spine::Vector &arr = *const_cast *>(&array); for (int i = 0, n = (int)array.size(); i < n; i++) { diff --git a/frameworks/cclua/src/lua-bindings/lua_dragonbones.cpp b/frameworks/cclua/src/lua-bindings/lua_dragonbones.cpp index ff33109e..95b479e9 100644 --- a/frameworks/cclua/src/lua-bindings/lua_dragonbones.cpp +++ b/frameworks/cclua/src/lua-bindings/lua_dragonbones.cpp @@ -4728,7 +4728,7 @@ static int _dragonBones_UserData_getFloats(lua_State *L) // const std::vector &getFloats() const std::vector &ret = self->getFloats(); - int num_ret = olua_push_vector(L, ret, [L](float &arg1) { + int num_ret = olua_push_array(L, ret, [L](float &arg1) { olua_push_number(L, arg1); }); @@ -4766,7 +4766,7 @@ static int _dragonBones_UserData_getInts(lua_State *L) // const std::vector &getInts() const std::vector &ret = self->getInts(); - int num_ret = olua_push_vector(L, ret, [L](int &arg1) { + int num_ret = olua_push_array(L, ret, [L](int &arg1) { olua_push_integer(L, arg1); }); @@ -4804,7 +4804,7 @@ static int _dragonBones_UserData_getStrings(lua_State *L) // const std::vector &getStrings() const std::vector &ret = self->getStrings(); - int num_ret = olua_push_vector(L, ret, [L](std::string &arg1) { + int num_ret = olua_push_array(L, ret, [L](std::string &arg1) { olua_push_string(L, arg1); }); @@ -4850,7 +4850,7 @@ static int _dragonBones_UserData_get_floats(lua_State *L) // std::vector floats std::vector &ret = self->floats; - int num_ret = olua_push_vector(L, ret, [L](float &arg1) { + int num_ret = olua_push_array(L, ret, [L](float &arg1) { olua_push_number(L, arg1); }); @@ -4867,7 +4867,7 @@ static int _dragonBones_UserData_set_floats(lua_State *L) std::vector arg1; /** floats */ olua_to_object(L, 1, &self, "db.UserData"); - olua_check_vector(L, 2, arg1, [L](float *arg1) { + olua_check_array(L, 2, arg1, [L](float *arg1) { olua_check_number(L, -1, arg1); }); @@ -4889,7 +4889,7 @@ static int _dragonBones_UserData_get_ints(lua_State *L) // std::vector ints std::vector &ret = self->ints; - int num_ret = olua_push_vector(L, ret, [L](int &arg1) { + int num_ret = olua_push_array(L, ret, [L](int &arg1) { olua_push_integer(L, arg1); }); @@ -4906,7 +4906,7 @@ static int _dragonBones_UserData_set_ints(lua_State *L) std::vector arg1; /** ints */ olua_to_object(L, 1, &self, "db.UserData"); - olua_check_vector(L, 2, arg1, [L](int *arg1) { + olua_check_array(L, 2, arg1, [L](int *arg1) { olua_check_integer(L, -1, arg1); }); @@ -4928,7 +4928,7 @@ static int _dragonBones_UserData_get_strings(lua_State *L) // std::vector strings std::vector &ret = self->strings; - int num_ret = olua_push_vector(L, ret, [L](std::string &arg1) { + int num_ret = olua_push_array(L, ret, [L](std::string &arg1) { olua_push_string(L, arg1); }); @@ -4945,7 +4945,7 @@ static int _dragonBones_UserData_set_strings(lua_State *L) std::vector arg1; /** strings */ olua_to_object(L, 1, &self, "db.UserData"); - olua_check_vector(L, 2, arg1, [L](std::string *arg1) { + olua_check_array(L, 2, arg1, [L](std::string *arg1) { olua_check_string(L, -1, arg1); }); @@ -6442,7 +6442,7 @@ static int _dragonBones_ArmatureData_getActions(lua_State *L) // const std::vector &getActions() const std::vector &ret = self->getActions(); - int num_ret = olua_push_vector(L, ret, [L](dragonBones::ActionData *arg1) { + int num_ret = olua_push_array(L, ret, [L](dragonBones::ActionData *arg1) { olua_push_object(L, arg1, "db.ActionData"); }); @@ -6480,7 +6480,7 @@ static int _dragonBones_ArmatureData_getAnimationNames(lua_State *L) // const std::vector &getAnimationNames() const std::vector &ret = self->getAnimationNames(); - int num_ret = olua_push_vector(L, ret, [L](std::string &arg1) { + int num_ret = olua_push_array(L, ret, [L](std::string &arg1) { olua_push_string(L, arg1); }); @@ -6537,7 +6537,7 @@ static int _dragonBones_ArmatureData_getDefaultActions(lua_State *L) // const std::vector &getDefaultActions() const std::vector &ret = self->getDefaultActions(); - int num_ret = olua_push_vector(L, ret, [L](dragonBones::ActionData *arg1) { + int num_ret = olua_push_array(L, ret, [L](dragonBones::ActionData *arg1) { olua_push_object(L, arg1, "db.ActionData"); }); @@ -6645,7 +6645,7 @@ static int _dragonBones_ArmatureData_getSortedBones(lua_State *L) // const std::vector &getSortedBones() const std::vector &ret = self->getSortedBones(); - int num_ret = olua_push_vector(L, ret, [L](dragonBones::BoneData *arg1) { + int num_ret = olua_push_array(L, ret, [L](dragonBones::BoneData *arg1) { olua_push_object(L, arg1, "db.BoneData"); }); @@ -6664,7 +6664,7 @@ static int _dragonBones_ArmatureData_getSortedSlots(lua_State *L) // const std::vector &getSortedSlots() const std::vector &ret = self->getSortedSlots(); - int num_ret = olua_push_vector(L, ret, [L](dragonBones::SlotData *arg1) { + int num_ret = olua_push_array(L, ret, [L](dragonBones::SlotData *arg1) { olua_push_object(L, arg1, "db.SlotData"); }); @@ -6885,7 +6885,7 @@ static int _dragonBones_ArmatureData_get_actions(lua_State *L) // std::vector actions std::vector &ret = self->actions; - int num_ret = olua_push_vector(L, ret, [L](dragonBones::ActionData *arg1) { + int num_ret = olua_push_array(L, ret, [L](dragonBones::ActionData *arg1) { olua_push_object(L, arg1, "db.ActionData"); }); @@ -6902,7 +6902,7 @@ static int _dragonBones_ArmatureData_set_actions(lua_State *L) std::vector arg1; /** actions */ olua_to_object(L, 1, &self, "db.ArmatureData"); - olua_check_vector(L, 2, arg1, [L](dragonBones::ActionData **arg1) { + olua_check_array(L, 2, arg1, [L](dragonBones::ActionData **arg1) { olua_check_object(L, -1, arg1, "db.ActionData"); }); @@ -6924,7 +6924,7 @@ static int _dragonBones_ArmatureData_get_animationNames(lua_State *L) // std::vector animationNames std::vector &ret = self->animationNames; - int num_ret = olua_push_vector(L, ret, [L](std::string &arg1) { + int num_ret = olua_push_array(L, ret, [L](std::string &arg1) { olua_push_string(L, arg1); }); @@ -6941,7 +6941,7 @@ static int _dragonBones_ArmatureData_set_animationNames(lua_State *L) std::vector arg1; /** animationNames */ olua_to_object(L, 1, &self, "db.ArmatureData"); - olua_check_vector(L, 2, arg1, [L](std::string *arg1) { + olua_check_array(L, 2, arg1, [L](std::string *arg1) { olua_check_string(L, -1, arg1); }); @@ -7156,7 +7156,7 @@ static int _dragonBones_ArmatureData_get_defaultActions(lua_State *L) // std::vector defaultActions std::vector &ret = self->defaultActions; - int num_ret = olua_push_vector(L, ret, [L](dragonBones::ActionData *arg1) { + int num_ret = olua_push_array(L, ret, [L](dragonBones::ActionData *arg1) { olua_push_object(L, arg1, "db.ActionData"); }); @@ -7173,7 +7173,7 @@ static int _dragonBones_ArmatureData_set_defaultActions(lua_State *L) std::vector arg1; /** defaultActions */ olua_to_object(L, 1, &self, "db.ArmatureData"); - olua_check_vector(L, 2, arg1, [L](dragonBones::ActionData **arg1) { + olua_check_array(L, 2, arg1, [L](dragonBones::ActionData **arg1) { olua_check_object(L, -1, arg1, "db.ActionData"); }); @@ -7487,7 +7487,7 @@ static int _dragonBones_ArmatureData_get_sortedBones(lua_State *L) // std::vector sortedBones std::vector &ret = self->sortedBones; - int num_ret = olua_push_vector(L, ret, [L](dragonBones::BoneData *arg1) { + int num_ret = olua_push_array(L, ret, [L](dragonBones::BoneData *arg1) { olua_push_object(L, arg1, "db.BoneData"); }); @@ -7504,7 +7504,7 @@ static int _dragonBones_ArmatureData_set_sortedBones(lua_State *L) std::vector arg1; /** sortedBones */ olua_to_object(L, 1, &self, "db.ArmatureData"); - olua_check_vector(L, 2, arg1, [L](dragonBones::BoneData **arg1) { + olua_check_array(L, 2, arg1, [L](dragonBones::BoneData **arg1) { olua_check_object(L, -1, arg1, "db.BoneData"); }); @@ -7526,7 +7526,7 @@ static int _dragonBones_ArmatureData_get_sortedSlots(lua_State *L) // std::vector sortedSlots std::vector &ret = self->sortedSlots; - int num_ret = olua_push_vector(L, ret, [L](dragonBones::SlotData *arg1) { + int num_ret = olua_push_array(L, ret, [L](dragonBones::SlotData *arg1) { olua_push_object(L, arg1, "db.SlotData"); }); @@ -7543,7 +7543,7 @@ static int _dragonBones_ArmatureData_set_sortedSlots(lua_State *L) std::vector arg1; /** sortedSlots */ olua_to_object(L, 1, &self, "db.ArmatureData"); - olua_check_vector(L, 2, arg1, [L](dragonBones::SlotData **arg1) { + olua_check_array(L, 2, arg1, [L](dragonBones::SlotData **arg1) { olua_check_object(L, -1, arg1, "db.SlotData"); }); @@ -9895,7 +9895,7 @@ static int _dragonBones_AnimationData_get_cachedFrames(lua_State *L) // std::vector cachedFrames std::vector &ret = self->cachedFrames; - int num_ret = olua_push_vector(L, ret, [L](bool &arg1) { + int num_ret = olua_push_array(L, ret, [L](bool &arg1) { olua_push_bool(L, arg1); }); @@ -9912,7 +9912,7 @@ static int _dragonBones_AnimationData_set_cachedFrames(lua_State *L) std::vector arg1; /** cachedFrames */ olua_to_object(L, 1, &self, "db.AnimationData"); - olua_check_vector(L, 2, arg1, [L](bool *arg1) { + olua_check_array(L, 2, arg1, [L](bool *arg1) { olua_check_bool(L, -1, arg1); }); @@ -10727,7 +10727,7 @@ static int _dragonBones_AnimationConfig_get_boneMask(lua_State *L) // std::vector boneMask std::vector &ret = self->boneMask; - int num_ret = olua_push_vector(L, ret, [L](std::string &arg1) { + int num_ret = olua_push_array(L, ret, [L](std::string &arg1) { olua_push_string(L, arg1); }); @@ -10744,7 +10744,7 @@ static int _dragonBones_AnimationConfig_set_boneMask(lua_State *L) std::vector arg1; /** boneMask */ olua_to_object(L, 1, &self, "db.AnimationConfig"); - olua_check_vector(L, 2, arg1, [L](std::string *arg1) { + olua_check_array(L, 2, arg1, [L](std::string *arg1) { olua_check_string(L, -1, arg1); }); @@ -11446,7 +11446,7 @@ static int _dragonBones_DragonBonesData_getArmatureNames(lua_State *L) // const std::vector &getArmatureNames() const std::vector &ret = self->getArmatureNames(); - int num_ret = olua_push_vector(L, ret, [L](std::string &arg1) { + int num_ret = olua_push_array(L, ret, [L](std::string &arg1) { olua_push_string(L, arg1); }); @@ -11527,7 +11527,7 @@ static int _dragonBones_DragonBonesData_get_armatureNames(lua_State *L) // std::vector armatureNames std::vector &ret = self->armatureNames; - int num_ret = olua_push_vector(L, ret, [L](std::string &arg1) { + int num_ret = olua_push_array(L, ret, [L](std::string &arg1) { olua_push_string(L, arg1); }); @@ -11544,7 +11544,7 @@ static int _dragonBones_DragonBonesData_set_armatureNames(lua_State *L) std::vector arg1; /** armatureNames */ olua_to_object(L, 1, &self, "db.DragonBonesData"); - olua_check_vector(L, 2, arg1, [L](std::string *arg1) { + olua_check_array(L, 2, arg1, [L](std::string *arg1) { olua_check_string(L, -1, arg1); }); @@ -11677,7 +11677,7 @@ static int _dragonBones_DragonBonesData_get_cachedFrames(lua_State *L) // std::vector cachedFrames std::vector &ret = self->cachedFrames; - int num_ret = olua_push_vector(L, ret, [L](float &arg1) { + int num_ret = olua_push_array(L, ret, [L](float &arg1) { olua_push_number(L, arg1); }); @@ -11694,7 +11694,7 @@ static int _dragonBones_DragonBonesData_set_cachedFrames(lua_State *L) std::vector arg1; /** cachedFrames */ olua_to_object(L, 1, &self, "db.DragonBonesData"); - olua_check_vector(L, 2, arg1, [L](float *arg1) { + olua_check_array(L, 2, arg1, [L](float *arg1) { olua_check_number(L, -1, arg1); }); @@ -11716,7 +11716,7 @@ static int _dragonBones_DragonBonesData_get_floatArray(lua_State *L) // const float *floatArray const float *ret = self->floatArray; - int num_ret = olua_push_array(L, ret, "olua.float"); + int num_ret = olua_push_pointer(L, ret, "olua.float"); olua_endinvoke(L); @@ -11731,7 +11731,7 @@ static int _dragonBones_DragonBonesData_set_floatArray(lua_State *L) float *arg1 = nullptr; /** floatArray */ olua_to_object(L, 1, &self, "db.DragonBonesData"); - olua_check_array(L, 2, &arg1, "olua.float"); + olua_check_pointer(L, 2, &arg1, "olua.float"); // const float *floatArray self->floatArray = arg1; @@ -11751,7 +11751,7 @@ static int _dragonBones_DragonBonesData_get_frameArray(lua_State *L) // const int16_t *frameArray const int16_t *ret = self->frameArray; - int num_ret = olua_push_array(L, ret, "olua.int16_t"); + int num_ret = olua_push_pointer(L, ret, "olua.int16_t"); olua_endinvoke(L); @@ -11766,7 +11766,7 @@ static int _dragonBones_DragonBonesData_set_frameArray(lua_State *L) int16_t *arg1 = nullptr; /** frameArray */ olua_to_object(L, 1, &self, "db.DragonBonesData"); - olua_check_array(L, 2, &arg1, "olua.int16_t"); + olua_check_pointer(L, 2, &arg1, "olua.int16_t"); // const int16_t *frameArray self->frameArray = arg1; @@ -11786,7 +11786,7 @@ static int _dragonBones_DragonBonesData_get_frameFloatArray(lua_State *L) // const float *frameFloatArray const float *ret = self->frameFloatArray; - int num_ret = olua_push_array(L, ret, "olua.float"); + int num_ret = olua_push_pointer(L, ret, "olua.float"); olua_endinvoke(L); @@ -11801,7 +11801,7 @@ static int _dragonBones_DragonBonesData_set_frameFloatArray(lua_State *L) float *arg1 = nullptr; /** frameFloatArray */ olua_to_object(L, 1, &self, "db.DragonBonesData"); - olua_check_array(L, 2, &arg1, "olua.float"); + olua_check_pointer(L, 2, &arg1, "olua.float"); // const float *frameFloatArray self->frameFloatArray = arg1; @@ -11821,7 +11821,7 @@ static int _dragonBones_DragonBonesData_get_frameIndices(lua_State *L) // std::vector frameIndices std::vector &ret = self->frameIndices; - int num_ret = olua_push_vector(L, ret, [L](unsigned int &arg1) { + int num_ret = olua_push_array(L, ret, [L](unsigned int &arg1) { olua_push_integer(L, arg1); }); @@ -11838,7 +11838,7 @@ static int _dragonBones_DragonBonesData_set_frameIndices(lua_State *L) std::vector arg1; /** frameIndices */ olua_to_object(L, 1, &self, "db.DragonBonesData"); - olua_check_vector(L, 2, arg1, [L](unsigned int *arg1) { + olua_check_array(L, 2, arg1, [L](unsigned int *arg1) { olua_check_integer(L, -1, arg1); }); @@ -11860,7 +11860,7 @@ static int _dragonBones_DragonBonesData_get_frameIntArray(lua_State *L) // const int16_t *frameIntArray const int16_t *ret = self->frameIntArray; - int num_ret = olua_push_array(L, ret, "olua.int16_t"); + int num_ret = olua_push_pointer(L, ret, "olua.int16_t"); olua_endinvoke(L); @@ -11875,7 +11875,7 @@ static int _dragonBones_DragonBonesData_set_frameIntArray(lua_State *L) int16_t *arg1 = nullptr; /** frameIntArray */ olua_to_object(L, 1, &self, "db.DragonBonesData"); - olua_check_array(L, 2, &arg1, "olua.int16_t"); + olua_check_pointer(L, 2, &arg1, "olua.int16_t"); // const int16_t *frameIntArray self->frameIntArray = arg1; @@ -11930,7 +11930,7 @@ static int _dragonBones_DragonBonesData_get_intArray(lua_State *L) // const int16_t *intArray const int16_t *ret = self->intArray; - int num_ret = olua_push_array(L, ret, "olua.int16_t"); + int num_ret = olua_push_pointer(L, ret, "olua.int16_t"); olua_endinvoke(L); @@ -11945,7 +11945,7 @@ static int _dragonBones_DragonBonesData_set_intArray(lua_State *L) int16_t *arg1 = nullptr; /** intArray */ olua_to_object(L, 1, &self, "db.DragonBonesData"); - olua_check_array(L, 2, &arg1, "olua.int16_t"); + olua_check_pointer(L, 2, &arg1, "olua.int16_t"); // const int16_t *intArray self->intArray = arg1; @@ -12000,7 +12000,7 @@ static int _dragonBones_DragonBonesData_get_timelineArray(lua_State *L) // const uint16_t *timelineArray const uint16_t *ret = self->timelineArray; - int num_ret = olua_push_array(L, ret, "olua.uint16_t"); + int num_ret = olua_push_pointer(L, ret, "olua.uint16_t"); olua_endinvoke(L); @@ -12015,7 +12015,7 @@ static int _dragonBones_DragonBonesData_set_timelineArray(lua_State *L) uint16_t *arg1 = nullptr; /** timelineArray */ olua_to_object(L, 1, &self, "db.DragonBonesData"); - olua_check_array(L, 2, &arg1, "olua.uint16_t"); + olua_check_pointer(L, 2, &arg1, "olua.uint16_t"); // const uint16_t *timelineArray self->timelineArray = arg1; @@ -13520,7 +13520,7 @@ static int _dragonBones_Armature_getBones(lua_State *L) // const std::vector &getBones() const std::vector &ret = self->getBones(); - int num_ret = olua_push_vector(L, ret, [L](dragonBones::Bone *arg1) { + int num_ret = olua_push_array(L, ret, [L](dragonBones::Bone *arg1) { olua_push_object(L, arg1, "db.Bone"); }); @@ -13747,7 +13747,7 @@ static int _dragonBones_Armature_getSlots(lua_State *L) // const std::vector &getSlots() const std::vector &ret = self->getSlots(); - int num_ret = olua_push_vector(L, ret, [L](dragonBones::Slot *arg1) { + int num_ret = olua_push_array(L, ret, [L](dragonBones::Slot *arg1) { olua_push_object(L, arg1, "db.Slot"); }); @@ -14498,7 +14498,7 @@ static int _dragonBones_Animation_getAnimationNames(lua_State *L) // const std::vector &getAnimationNames() const std::vector &ret = self->getAnimationNames(); - int num_ret = olua_push_vector(L, ret, [L](std::string &arg1) { + int num_ret = olua_push_array(L, ret, [L](std::string &arg1) { olua_push_string(L, arg1); }); @@ -14590,7 +14590,7 @@ static int _dragonBones_Animation_getStates(lua_State *L) // const std::vector &getStates() const std::vector &ret = self->getStates(); - int num_ret = olua_push_vector(L, ret, [L](dragonBones::AnimationState *arg1) { + int num_ret = olua_push_array(L, ret, [L](dragonBones::AnimationState *arg1) { olua_push_object(L, arg1, "db.AnimationState"); }); diff --git a/frameworks/cclua/src/lua-bindings/lua_fairygui.cpp b/frameworks/cclua/src/lua-bindings/lua_fairygui.cpp index 33f8ecd7..62739371 100644 --- a/frameworks/cclua/src/lua-bindings/lua_fairygui.cpp +++ b/frameworks/cclua/src/lua-bindings/lua_fairygui.cpp @@ -46,6 +46,49 @@ static int _fairygui_VectorTreeNode___gc(lua_State *L) return (int)ret; } +static int _fairygui_VectorTreeNode___index(lua_State *L) +{ + olua_startinvoke(L); + + fairygui::VectorTreeNode *self = nullptr; + unsigned int arg1 = 0; /** idx */ + + olua_to_object(L, 1, &self, "fgui.VectorTreeNode"); + olua_check_integer(L, 2, &arg1); + + // std::vector __index(unsigned int idx) + std::vector ret = self->__index(arg1); + int num_ret = olua_push_array(L, ret, [L](fairygui::GTreeNode *arg1) { + olua_push_object(L, arg1, "fgui.GTreeNode"); + }); + + olua_endinvoke(L); + + return num_ret; +} + +static int _fairygui_VectorTreeNode___newindex(lua_State *L) +{ + olua_startinvoke(L); + + fairygui::VectorTreeNode *self = nullptr; + unsigned int arg1 = 0; /** idx */ + std::vector arg2; /** v */ + + olua_to_object(L, 1, &self, "fgui.VectorTreeNode"); + olua_check_integer(L, 2, &arg1); + olua_check_array(L, 3, arg2, [L](fairygui::GTreeNode **arg1) { + olua_check_object(L, -1, arg1, "fgui.GTreeNode"); + }); + + // void __newindex(unsigned int idx, const std::vector &v) + self->__newindex(arg1, arg2); + + olua_endinvoke(L); + + return 0; +} + static int _fairygui_VectorTreeNode___olua_move(lua_State *L) { olua_startinvoke(L); @@ -58,12 +101,36 @@ static int _fairygui_VectorTreeNode___olua_move(lua_State *L) return 1; } +static int _fairygui_VectorTreeNode_assign(lua_State *L) +{ + olua_startinvoke(L); + + fairygui::VectorTreeNode *self = nullptr; + const char *arg1 = nullptr; /** data */ + size_t arg2 = 0; /** len */ + + olua_to_object(L, 1, &self, "fgui.VectorTreeNode"); + olua_check_string(L, 2, &arg1); + olua_check_integer(L, 3, &arg2); + + // void assign(const char *data, size_t len) + self->assign(arg1, arg2); + + olua_endinvoke(L); + + return 0; +} + static int _fairygui_VectorTreeNode_create$1(lua_State *L) { olua_startinvoke(L); - // @postnew @name(new) static fairygui::VectorTreeNode *create() - fairygui::VectorTreeNode *ret = fairygui::VectorTreeNode::create(); + size_t arg1 = 0; /** len */ + + olua_check_integer(L, 1, &arg1); + + // @postnew @name(new) static fairygui::VectorTreeNode *create(@optional size_t len) + fairygui::VectorTreeNode *ret = fairygui::VectorTreeNode::create(arg1); int num_ret = olua_push_object(L, ret, "fgui.VectorTreeNode"); // insert code after call @@ -78,14 +145,8 @@ static int _fairygui_VectorTreeNode_create$2(lua_State *L) { olua_startinvoke(L); - std::vector arg1; /** v */ - - olua_check_vector(L, 1, arg1, [L](fairygui::GTreeNode **arg1) { - olua_check_object(L, -1, arg1, "fgui.GTreeNode"); - }); - - // @postnew @name(new) static fairygui::VectorTreeNode *create(const std::vector &v) - fairygui::VectorTreeNode *ret = fairygui::VectorTreeNode::create(arg1); + // @postnew @name(new) static fairygui::VectorTreeNode *create(@optional size_t len) + fairygui::VectorTreeNode *ret = fairygui::VectorTreeNode::create(); int num_ret = olua_push_object(L, ret, "fgui.VectorTreeNode"); // insert code after call @@ -101,14 +162,14 @@ static int _fairygui_VectorTreeNode_create(lua_State *L) int num_args = lua_gettop(L); if (num_args == 0) { - // @postnew @name(new) static fairygui::VectorTreeNode *create() - return _fairygui_VectorTreeNode_create$1(L); + // @postnew @name(new) static fairygui::VectorTreeNode *create(@optional size_t len) + return _fairygui_VectorTreeNode_create$2(L); } if (num_args == 1) { - // if ((olua_is_vector(L, 1))) { - // @postnew @name(new) static fairygui::VectorTreeNode *create(const std::vector &v) - return _fairygui_VectorTreeNode_create$2(L); + // if ((olua_is_integer(L, 1))) { + // @postnew @name(new) static fairygui::VectorTreeNode *create(@optional size_t len) + return _fairygui_VectorTreeNode_create$1(L); // } } @@ -117,6 +178,144 @@ static int _fairygui_VectorTreeNode_create(lua_State *L) return 0; } +static int _fairygui_VectorTreeNode_slice$1(lua_State *L) +{ + olua_startinvoke(L); + + fairygui::VectorTreeNode *self = nullptr; + size_t arg1 = 0; /** from */ + size_t arg2 = 0; /** to */ + + olua_to_object(L, 1, &self, "fgui.VectorTreeNode"); + olua_check_integer(L, 2, &arg1); + olua_check_integer(L, 3, &arg2); + + // @postnew fairygui::VectorTreeNode *slice(size_t from, @optional size_t to) + fairygui::VectorTreeNode *ret = self->slice(arg1, arg2); + int num_ret = olua_push_object(L, ret, "fgui.VectorTreeNode"); + + // insert code after call + olua_postnew(L, ret); + + olua_endinvoke(L); + + return num_ret; +} + +static int _fairygui_VectorTreeNode_slice$2(lua_State *L) +{ + olua_startinvoke(L); + + fairygui::VectorTreeNode *self = nullptr; + size_t arg1 = 0; /** from */ + + olua_to_object(L, 1, &self, "fgui.VectorTreeNode"); + olua_check_integer(L, 2, &arg1); + + // @postnew fairygui::VectorTreeNode *slice(size_t from, @optional size_t to) + fairygui::VectorTreeNode *ret = self->slice(arg1); + int num_ret = olua_push_object(L, ret, "fgui.VectorTreeNode"); + + // insert code after call + olua_postnew(L, ret); + + olua_endinvoke(L); + + return num_ret; +} + +static int _fairygui_VectorTreeNode_slice(lua_State *L) +{ + int num_args = lua_gettop(L) - 1; + + if (num_args == 1) { + // if ((olua_is_integer(L, 2))) { + // @postnew fairygui::VectorTreeNode *slice(size_t from, @optional size_t to) + return _fairygui_VectorTreeNode_slice$2(L); + // } + } + + if (num_args == 2) { + // if ((olua_is_integer(L, 2)) && (olua_is_integer(L, 3))) { + // @postnew fairygui::VectorTreeNode *slice(size_t from, @optional size_t to) + return _fairygui_VectorTreeNode_slice$1(L); + // } + } + + luaL_error(L, "method 'fairygui::VectorTreeNode::slice' not support '%d' arguments", num_args); + + return 0; +} + +static int _fairygui_VectorTreeNode_sub$1(lua_State *L) +{ + olua_startinvoke(L); + + fairygui::VectorTreeNode *self = nullptr; + size_t arg1 = 0; /** from */ + size_t arg2 = 0; /** to */ + + olua_to_object(L, 1, &self, "fgui.VectorTreeNode"); + olua_check_integer(L, 2, &arg1); + olua_check_integer(L, 3, &arg2); + + // @postnew fairygui::VectorTreeNode *sub(size_t from, @optional size_t to) + fairygui::VectorTreeNode *ret = self->sub(arg1, arg2); + int num_ret = olua_push_object(L, ret, "fgui.VectorTreeNode"); + + // insert code after call + olua_postnew(L, ret); + + olua_endinvoke(L); + + return num_ret; +} + +static int _fairygui_VectorTreeNode_sub$2(lua_State *L) +{ + olua_startinvoke(L); + + fairygui::VectorTreeNode *self = nullptr; + size_t arg1 = 0; /** from */ + + olua_to_object(L, 1, &self, "fgui.VectorTreeNode"); + olua_check_integer(L, 2, &arg1); + + // @postnew fairygui::VectorTreeNode *sub(size_t from, @optional size_t to) + fairygui::VectorTreeNode *ret = self->sub(arg1); + int num_ret = olua_push_object(L, ret, "fgui.VectorTreeNode"); + + // insert code after call + olua_postnew(L, ret); + + olua_endinvoke(L); + + return num_ret; +} + +static int _fairygui_VectorTreeNode_sub(lua_State *L) +{ + int num_args = lua_gettop(L) - 1; + + if (num_args == 1) { + // if ((olua_is_integer(L, 2))) { + // @postnew fairygui::VectorTreeNode *sub(size_t from, @optional size_t to) + return _fairygui_VectorTreeNode_sub$2(L); + // } + } + + if (num_args == 2) { + // if ((olua_is_integer(L, 2)) && (olua_is_integer(L, 3))) { + // @postnew fairygui::VectorTreeNode *sub(size_t from, @optional size_t to) + return _fairygui_VectorTreeNode_sub$1(L); + // } + } + + luaL_error(L, "method 'fairygui::VectorTreeNode::sub' not support '%d' arguments", num_args); + + return 0; +} + static int _fairygui_VectorTreeNode_take(lua_State *L) { olua_startinvoke(L); @@ -134,7 +333,25 @@ static int _fairygui_VectorTreeNode_take(lua_State *L) return num_ret; } -static int _fairygui_VectorTreeNode_data(lua_State *L) +static int _fairygui_VectorTreeNode_tostring(lua_State *L) +{ + olua_startinvoke(L); + + fairygui::VectorTreeNode *self = nullptr; + size_t arg2 = 0; /** len */ + + olua_to_object(L, 1, &self, "fgui.VectorTreeNode"); + olua_check_integer(L, 2, &arg2); + + // olua_Return tostring(lua_State *L, size_t len) + olua_Return ret = self->tostring(L, arg2); + + olua_endinvoke(L); + + return (int)ret; +} + +static int _fairygui_VectorTreeNode_length(lua_State *L) { olua_startinvoke(L); @@ -142,9 +359,9 @@ static int _fairygui_VectorTreeNode_data(lua_State *L) olua_to_object(L, 1, &self, "fgui.VectorTreeNode"); - // @getter @name(data) std::vector *data() - std::vector *ret = self->data(); - int num_ret = olua_push_pointer(L, ret, "fgui.VectorTreeNode"); + // @getter @name(length) size_t length() + size_t ret = self->length(); + int num_ret = olua_push_integer(L, ret); olua_endinvoke(L); @@ -195,7 +412,7 @@ static int _fairygui_VectorTreeNode_value(lua_State *L) // @getter @name(value) const std::vector &value() const std::vector &ret = self->value(); - int num_ret = olua_push_vector(L, ret, [L](fairygui::GTreeNode *arg1) { + int num_ret = olua_push_array(L, ret, [L](fairygui::GTreeNode *arg1) { olua_push_object(L, arg1, "fgui.GTreeNode"); }); @@ -209,10 +426,16 @@ OLUA_LIB int luaopen_fairygui_VectorTreeNode(lua_State *L) { oluacls_class(L, "fgui.VectorTreeNode"); oluacls_func(L, "__gc", _fairygui_VectorTreeNode___gc); + oluacls_func(L, "__index", _fairygui_VectorTreeNode___index); + oluacls_func(L, "__newindex", _fairygui_VectorTreeNode___newindex); oluacls_func(L, "__olua_move", _fairygui_VectorTreeNode___olua_move); + oluacls_func(L, "assign", _fairygui_VectorTreeNode_assign); oluacls_func(L, "new", _fairygui_VectorTreeNode_create); + oluacls_func(L, "slice", _fairygui_VectorTreeNode_slice); + oluacls_func(L, "sub", _fairygui_VectorTreeNode_sub); oluacls_func(L, "take", _fairygui_VectorTreeNode_take); - oluacls_prop(L, "data", _fairygui_VectorTreeNode_data, nullptr); + oluacls_func(L, "tostring", _fairygui_VectorTreeNode_tostring); + oluacls_prop(L, "length", _fairygui_VectorTreeNode_length, _fairygui_VectorTreeNode_length); oluacls_prop(L, "rawdata", _fairygui_VectorTreeNode_rawdata, nullptr); oluacls_prop(L, "sizeof", _fairygui_VectorTreeNode_size, nullptr); oluacls_prop(L, "value", _fairygui_VectorTreeNode_value, _fairygui_VectorTreeNode_value); @@ -10993,7 +11216,7 @@ static int _fairygui_GComponent_getChildren(lua_State *L) // @addref(children |) const cocos2d::Vector &getChildren() const cocos2d::Vector &ret = self->getChildren(); - int num_ret = olua_push_vector(L, ret, [L](fairygui::GObject *arg1) { + int num_ret = olua_push_array(L, ret, [L](fairygui::GObject *arg1) { olua_push_object(L, arg1, "fgui.GObject"); }); @@ -11076,7 +11299,7 @@ static int _fairygui_GComponent_getControllers(lua_State *L) // @addref(controllers |) const cocos2d::Vector &getControllers() const cocos2d::Vector &ret = self->getControllers(); - int num_ret = olua_push_vector(L, ret, [L](fairygui::GController *arg1) { + int num_ret = olua_push_array(L, ret, [L](fairygui::GController *arg1) { olua_push_object(L, arg1, "fgui.GController"); }); @@ -11266,7 +11489,7 @@ static int _fairygui_GComponent_getTransitions(lua_State *L) // @addref(transitions |) const cocos2d::Vector &getTransitions() const cocos2d::Vector &ret = self->getTransitions(); - int num_ret = olua_push_vector(L, ret, [L](fairygui::Transition *arg1) { + int num_ret = olua_push_array(L, ret, [L](fairygui::Transition *arg1) { olua_push_object(L, arg1, "fgui.Transition"); }); @@ -15113,7 +15336,7 @@ static int _fairygui_GGraph_drawRegularPolygon$1(lua_State *L) olua_check_cocos2d_Color4F(L, 4, &arg3); olua_check_integer(L, 5, &arg4); olua_check_number(L, 6, &arg5); - olua_check_array(L, 7, &arg6, "olua.float"); + olua_check_pointer(L, 7, &arg6, "olua.float"); olua_check_integer(L, 8, &arg7); // void drawRegularPolygon(int lineSize, const cocos2d::Color4F &lineColor, const cocos2d::Color4F &fillColor, int sides, @optional float startAngle, @optional const float *distances, @optional int distanceCount) @@ -15192,7 +15415,7 @@ static int _fairygui_GGraph_drawRegularPolygon$4(lua_State *L) olua_check_cocos2d_Color4F(L, 4, &arg3); olua_check_integer(L, 5, &arg4); olua_check_number(L, 6, &arg5); - olua_check_array(L, 7, &arg6, "olua.float"); + olua_check_pointer(L, 7, &arg6, "olua.float"); // void drawRegularPolygon(int lineSize, const cocos2d::Color4F &lineColor, const cocos2d::Color4F &fillColor, int sides, @optional float startAngle, @optional const float *distances, @optional int distanceCount) self->drawRegularPolygon(arg1, arg2, arg3, arg4, arg5, arg6); @@ -15221,14 +15444,14 @@ static int _fairygui_GGraph_drawRegularPolygon(lua_State *L) } if (num_args == 6) { - // if ((olua_is_integer(L, 2)) && (olua_is_cocos2d_Color4F(L, 3)) && (olua_is_cocos2d_Color4F(L, 4)) && (olua_is_integer(L, 5)) && (olua_is_number(L, 6)) && (olua_is_array(L, 7, "olua.float"))) { + // if ((olua_is_integer(L, 2)) && (olua_is_cocos2d_Color4F(L, 3)) && (olua_is_cocos2d_Color4F(L, 4)) && (olua_is_integer(L, 5)) && (olua_is_number(L, 6)) && (olua_is_pointer(L, 7, "olua.float"))) { // void drawRegularPolygon(int lineSize, const cocos2d::Color4F &lineColor, const cocos2d::Color4F &fillColor, int sides, @optional float startAngle, @optional const float *distances, @optional int distanceCount) return _fairygui_GGraph_drawRegularPolygon$4(L); // } } if (num_args == 7) { - // if ((olua_is_integer(L, 2)) && (olua_is_cocos2d_Color4F(L, 3)) && (olua_is_cocos2d_Color4F(L, 4)) && (olua_is_integer(L, 5)) && (olua_is_number(L, 6)) && (olua_is_array(L, 7, "olua.float")) && (olua_is_integer(L, 8))) { + // if ((olua_is_integer(L, 2)) && (olua_is_cocos2d_Color4F(L, 3)) && (olua_is_cocos2d_Color4F(L, 4)) && (olua_is_integer(L, 5)) && (olua_is_number(L, 6)) && (olua_is_pointer(L, 7, "olua.float")) && (olua_is_integer(L, 8))) { // void drawRegularPolygon(int lineSize, const cocos2d::Color4F &lineColor, const cocos2d::Color4F &fillColor, int sides, @optional float startAngle, @optional const float *distances, @optional int distanceCount) return _fairygui_GGraph_drawRegularPolygon$1(L); // } @@ -23078,7 +23301,7 @@ static int _fairygui_UIConfig_getRealFontName$1(lua_State *L) bool *arg2 = nullptr; /** isTTF */ olua_check_string(L, 1, &arg1); - olua_check_array(L, 2, &arg2, "olua.bool"); + olua_check_pointer(L, 2, &arg2, "olua.bool"); // static const std::string &getRealFontName(const std::string &aliasName, @optional bool *isTTF) const std::string &ret = fairygui::UIConfig::getRealFontName(arg1, arg2); @@ -23118,7 +23341,7 @@ static int _fairygui_UIConfig_getRealFontName(lua_State *L) } if (num_args == 2) { - // if ((olua_is_string(L, 1)) && (olua_is_array(L, 2, "olua.bool"))) { + // if ((olua_is_string(L, 1)) && (olua_is_pointer(L, 2, "olua.bool"))) { // static const std::string &getRealFontName(const std::string &aliasName, @optional bool *isTTF) return _fairygui_UIConfig_getRealFontName$1(L); // } @@ -27243,7 +27466,7 @@ static int _fairygui_FUIRichText_getControls(lua_State *L) // const std::vector &getControls() const std::vector &ret = self->getControls(); - int num_ret = olua_push_vector(L, ret, [L](fairygui::HtmlObject *arg1) { + int num_ret = olua_push_array(L, ret, [L](fairygui::HtmlObject *arg1) { olua_push_object(L, arg1, "fgui.HtmlObject"); }); @@ -28012,7 +28235,7 @@ static int _fairygui_HtmlObject_get_loaderPool(lua_State *L) // static cocos2d::Vector loaderPool cocos2d::Vector &ret = fairygui::HtmlObject::loaderPool; - int num_ret = olua_push_vector(L, ret, [L](fairygui::GObject *arg1) { + int num_ret = olua_push_array(L, ret, [L](fairygui::GObject *arg1) { olua_push_object(L, arg1, "fgui.GObject"); }); @@ -28027,7 +28250,7 @@ static int _fairygui_HtmlObject_set_loaderPool(lua_State *L) cocos2d::Vector arg1; /** loaderPool */ - olua_check_vector(L, 1, arg1, [L](fairygui::GObject **arg1) { + olua_check_array(L, 1, arg1, [L](fairygui::GObject **arg1) { olua_check_object(L, -1, arg1, "fgui.GObject"); }); diff --git a/frameworks/cclua/src/lua-bindings/lua_spine.cpp b/frameworks/cclua/src/lua-bindings/lua_spine.cpp index a374d03f..9d5f63d1 100644 --- a/frameworks/cclua/src/lua-bindings/lua_spine.cpp +++ b/frameworks/cclua/src/lua-bindings/lua_spine.cpp @@ -1053,7 +1053,7 @@ static int _spine_AnimationState_getTracks(lua_State *L) // spine::Vector &getTracks() spine::Vector &ret = self->getTracks(); - int num_ret = olua_push_vector(L, ret, [L](spine::TrackEntry *arg1) { + int num_ret = olua_push_array(L, ret, [L](spine::TrackEntry *arg1) { olua_push_object(L, arg1, "spine.TrackEntry"); }); @@ -1547,7 +1547,7 @@ static int _spine_Animation_getTimelines(lua_State *L) // spine::Vector &getTimelines() spine::Vector &ret = self->getTimelines(); - int num_ret = olua_push_vector(L, ret, [L](spine::Timeline *arg1) { + int num_ret = olua_push_array(L, ret, [L](spine::Timeline *arg1) { olua_push_object(L, arg1, "spine.Timeline"); }); @@ -1564,7 +1564,7 @@ static int _spine_Animation_hasTimeline(lua_State *L) spine::Vector arg1; /** ids */ olua_to_object(L, 1, &self, "spine.Animation"); - olua_check_vector(L, 2, arg1, [L](spine::PropertyId *arg1) { + olua_check_array(L, 2, arg1, [L](spine::PropertyId *arg1) { olua_check_integer(L, -1, arg1); }); @@ -1586,7 +1586,7 @@ static int _spine_Animation_new(lua_State *L) float arg3 = 0; /** duration */ olua_check_string(L, 1, &arg1); - olua_check_vector(L, 2, arg2, [L](spine::Timeline **arg1) { + olua_check_array(L, 2, arg2, [L](spine::Timeline **arg1) { olua_check_object(L, -1, arg1, "spine.Timeline"); }); olua_check_number(L, 3, &arg3); @@ -1608,7 +1608,7 @@ static int _spine_Animation_search$1(lua_State *L) spine::Vector arg1; /** values */ float arg2 = 0; /** target */ - olua_check_vector(L, 1, arg1, [L](float *arg1) { + olua_check_array(L, 1, arg1, [L](float *arg1) { olua_check_number(L, -1, arg1); }); olua_check_number(L, 2, &arg2); @@ -1630,7 +1630,7 @@ static int _spine_Animation_search$2(lua_State *L) float arg2 = 0; /** target */ int arg3 = 0; /** step */ - olua_check_vector(L, 1, arg1, [L](float *arg1) { + olua_check_array(L, 1, arg1, [L](float *arg1) { olua_check_number(L, -1, arg1); }); olua_check_number(L, 2, &arg2); @@ -1650,14 +1650,14 @@ static int _spine_Animation_search(lua_State *L) int num_args = lua_gettop(L); if (num_args == 2) { - // if ((olua_is_vector(L, 1)) && (olua_is_number(L, 2))) { + // if ((olua_is_array(L, 1)) && (olua_is_number(L, 2))) { // static int search(spine::Vector &values, float target) return _spine_Animation_search$1(L); // } } if (num_args == 3) { - // if ((olua_is_vector(L, 1)) && (olua_is_number(L, 2)) && (olua_is_integer(L, 3))) { + // if ((olua_is_array(L, 1)) && (olua_is_number(L, 2)) && (olua_is_integer(L, 3))) { // static int search(spine::Vector &values, float target, int step) return _spine_Animation_search$2(L); // } @@ -1807,7 +1807,7 @@ static int _spine_Sequence_getRegions(lua_State *L) // spine::Vector &getRegions() spine::Vector &ret = self->getRegions(); - int num_ret = olua_push_vector(L, ret, [L](spine::TextureRegion *arg1) { + int num_ret = olua_push_array(L, ret, [L](spine::TextureRegion *arg1) { olua_push_object(L, arg1, "spine.TextureRegion"); }); @@ -2591,7 +2591,7 @@ static int _spine_IkConstraintData_getBones(lua_State *L) // spine::Vector &getBones() spine::Vector &ret = self->getBones(); - int num_ret = olua_push_vector(L, ret, [L](spine::BoneData *arg1) { + int num_ret = olua_push_array(L, ret, [L](spine::BoneData *arg1) { olua_push_object(L, arg1, "spine.BoneData"); }); @@ -3760,7 +3760,7 @@ static int _spine_IkConstraint_getBones(lua_State *L) // spine::Vector &getBones() spine::Vector &ret = self->getBones(); - int num_ret = olua_push_vector(L, ret, [L](spine::Bone *arg1) { + int num_ret = olua_push_array(L, ret, [L](spine::Bone *arg1) { olua_push_object(L, arg1, "spine.Bone"); }); @@ -4061,7 +4061,7 @@ static int _spine_TransformConstraint_getBones(lua_State *L) // spine::Vector &getBones() spine::Vector &ret = self->getBones(); - int num_ret = olua_push_vector(L, ret, [L](spine::Bone *arg1) { + int num_ret = olua_push_array(L, ret, [L](spine::Bone *arg1) { olua_push_object(L, arg1, "spine.Bone"); }); @@ -4416,7 +4416,7 @@ static int _spine_TransformConstraintData_getBones(lua_State *L) // spine::Vector &getBones() spine::Vector &ret = self->getBones(); - int num_ret = olua_push_vector(L, ret, [L](spine::BoneData *arg1) { + int num_ret = olua_push_array(L, ret, [L](spine::BoneData *arg1) { olua_push_object(L, arg1, "spine.BoneData"); }); @@ -5035,7 +5035,7 @@ static int _spine_PathConstraintData_getBones(lua_State *L) // spine::Vector &getBones() spine::Vector &ret = self->getBones(); - int num_ret = olua_push_vector(L, ret, [L](spine::BoneData *arg1) { + int num_ret = olua_push_array(L, ret, [L](spine::BoneData *arg1) { olua_push_object(L, arg1, "spine.BoneData"); }); @@ -5615,7 +5615,7 @@ static int _spine_SkeletonBounds_getBoundingBoxes(lua_State *L) // spine::Vector &getBoundingBoxes() spine::Vector &ret = self->getBoundingBoxes(); - int num_ret = olua_push_vector(L, ret, [L](spine::BoundingBoxAttachment *arg1) { + int num_ret = olua_push_array(L, ret, [L](spine::BoundingBoxAttachment *arg1) { olua_push_object(L, arg1, "spine.BoundingBoxAttachment"); }); @@ -5670,7 +5670,7 @@ static int _spine_SkeletonBounds_getPolygons(lua_State *L) // spine::Vector &getPolygons() spine::Vector &ret = self->getPolygons(); - int num_ret = olua_push_vector(L, ret, [L](spine::Polygon *arg1) { + int num_ret = olua_push_array(L, ret, [L](spine::Polygon *arg1) { olua_push_object(L, arg1, "spine.Polygon"); }); @@ -5901,7 +5901,7 @@ static int _spine_Timeline_getFrames(lua_State *L) // spine::Vector &getFrames() spine::Vector &ret = self->getFrames(); - int num_ret = olua_push_vector(L, ret, [L](float &arg1) { + int num_ret = olua_push_array(L, ret, [L](float &arg1) { olua_push_number(L, arg1); }); @@ -5920,7 +5920,7 @@ static int _spine_Timeline_getPropertyIds(lua_State *L) // spine::Vector &getPropertyIds() spine::Vector &ret = self->getPropertyIds(); - int num_ret = olua_push_vector(L, ret, [L](spine::PropertyId &arg1) { + int num_ret = olua_push_array(L, ret, [L](spine::PropertyId &arg1) { olua_push_integer(L, arg1); }); @@ -5983,7 +5983,7 @@ static int _spine_CurveTimeline_getCurves(lua_State *L) // spine::Vector &getCurves() spine::Vector &ret = self->getCurves(); - int num_ret = olua_push_vector(L, ret, [L](float &arg1) { + int num_ret = olua_push_array(L, ret, [L](float &arg1) { olua_push_number(L, arg1); }); @@ -6149,7 +6149,7 @@ static int _spine_AttachmentTimeline_getAttachmentNames(lua_State *L) // spine::Vector &getAttachmentNames() spine::Vector &ret = self->getAttachmentNames(); - int num_ret = olua_push_vector(L, ret, [L](spine::String &arg1) { + int num_ret = olua_push_array(L, ret, [L](spine::String &arg1) { olua_push_string(L, arg1); }); @@ -7893,7 +7893,7 @@ static int _spine_Skin_getBones(lua_State *L) // spine::Vector &getBones() spine::Vector &ret = self->getBones(); - int num_ret = olua_push_vector(L, ret, [L](spine::BoneData *arg1) { + int num_ret = olua_push_array(L, ret, [L](spine::BoneData *arg1) { olua_push_object(L, arg1, "spine.BoneData"); }); @@ -7912,7 +7912,7 @@ static int _spine_Skin_getConstraints(lua_State *L) // spine::Vector &getConstraints() spine::Vector &ret = self->getConstraints(); - int num_ret = olua_push_vector(L, ret, [L](spine::ConstraintData *arg1) { + int num_ret = olua_push_array(L, ret, [L](spine::ConstraintData *arg1) { olua_push_object(L, arg1, "spine.ConstraintData"); }); @@ -8208,7 +8208,7 @@ static int _spine_Bone_getChildren(lua_State *L) // spine::Vector &getChildren() spine::Vector &ret = self->getChildren(); - int num_ret = olua_push_vector(L, ret, [L](spine::Bone *arg1) { + int num_ret = olua_push_array(L, ret, [L](spine::Bone *arg1) { olua_push_object(L, arg1, "spine.Bone"); }); @@ -9360,7 +9360,7 @@ static int _spine_Slot_getDeform(lua_State *L) // spine::Vector &getDeform() spine::Vector &ret = self->getDeform(); - int num_ret = olua_push_vector(L, ret, [L](float &arg1) { + int num_ret = olua_push_array(L, ret, [L](float &arg1) { olua_push_number(L, arg1); }); @@ -9652,7 +9652,7 @@ static int _spine_VertexAttachment_computeWorldVertices$1(lua_State *L) olua_to_object(L, 1, &self, "spine.VertexAttachment"); olua_check_object(L, 2, &arg1, "spine.Slot"); - olua_check_array(L, 3, &arg2, "olua.float"); + olua_check_pointer(L, 3, &arg2, "olua.float"); // void computeWorldVertices(spine::Slot &slot, float *worldVertices) self->computeWorldVertices(*arg1, arg2); @@ -9672,7 +9672,7 @@ static int _spine_VertexAttachment_computeWorldVertices$2(lua_State *L) olua_to_object(L, 1, &self, "spine.VertexAttachment"); olua_check_object(L, 2, &arg1, "spine.Slot"); - olua_check_vector(L, 3, arg2, [L](float *arg1) { + olua_check_array(L, 3, arg2, [L](float *arg1) { olua_check_number(L, -1, arg1); }); @@ -9700,7 +9700,7 @@ static int _spine_VertexAttachment_computeWorldVertices$3(lua_State *L) olua_check_object(L, 2, &arg1, "spine.Slot"); olua_check_integer(L, 3, &arg2); olua_check_integer(L, 4, &arg3); - olua_check_array(L, 5, &arg4, "olua.float"); + olua_check_pointer(L, 5, &arg4, "olua.float"); olua_check_integer(L, 6, &arg5); olua_check_integer(L, 7, &arg6); @@ -9728,7 +9728,7 @@ static int _spine_VertexAttachment_computeWorldVertices$4(lua_State *L) olua_check_object(L, 2, &arg1, "spine.Slot"); olua_check_integer(L, 3, &arg2); olua_check_integer(L, 4, &arg3); - olua_check_vector(L, 5, arg4, [L](float *arg1) { + olua_check_array(L, 5, arg4, [L](float *arg1) { olua_check_number(L, -1, arg1); }); olua_check_integer(L, 6, &arg5); @@ -9757,7 +9757,7 @@ static int _spine_VertexAttachment_computeWorldVertices$5(lua_State *L) olua_check_object(L, 2, &arg1, "spine.Slot"); olua_check_integer(L, 3, &arg2); olua_check_integer(L, 4, &arg3); - olua_check_array(L, 5, &arg4, "olua.float"); + olua_check_pointer(L, 5, &arg4, "olua.float"); olua_check_integer(L, 6, &arg5); // void computeWorldVertices(spine::Slot &slot, size_t start, size_t count, float *worldVertices, size_t offset, @optional size_t stride) @@ -9783,7 +9783,7 @@ static int _spine_VertexAttachment_computeWorldVertices$6(lua_State *L) olua_check_object(L, 2, &arg1, "spine.Slot"); olua_check_integer(L, 3, &arg2); olua_check_integer(L, 4, &arg3); - olua_check_vector(L, 5, arg4, [L](float *arg1) { + olua_check_array(L, 5, arg4, [L](float *arg1) { olua_check_number(L, -1, arg1); }); olua_check_integer(L, 6, &arg5); @@ -9801,36 +9801,36 @@ static int _spine_VertexAttachment_computeWorldVertices(lua_State *L) int num_args = lua_gettop(L) - 1; if (num_args == 2) { - if ((olua_is_object(L, 2, "spine.Slot")) && (olua_is_array(L, 3, "olua.float"))) { + if ((olua_is_object(L, 2, "spine.Slot")) && (olua_is_pointer(L, 3, "olua.float"))) { // void computeWorldVertices(spine::Slot &slot, float *worldVertices) return _spine_VertexAttachment_computeWorldVertices$1(L); } - // if ((olua_is_object(L, 2, "spine.Slot")) && (olua_is_vector(L, 3))) { + // if ((olua_is_object(L, 2, "spine.Slot")) && (olua_is_array(L, 3))) { // void computeWorldVertices(spine::Slot &slot, spine::Vector &worldVertices) return _spine_VertexAttachment_computeWorldVertices$2(L); // } } if (num_args == 5) { - if ((olua_is_object(L, 2, "spine.Slot")) && (olua_is_integer(L, 3)) && (olua_is_integer(L, 4)) && (olua_is_array(L, 5, "olua.float")) && (olua_is_integer(L, 6))) { + if ((olua_is_object(L, 2, "spine.Slot")) && (olua_is_integer(L, 3)) && (olua_is_integer(L, 4)) && (olua_is_pointer(L, 5, "olua.float")) && (olua_is_integer(L, 6))) { // void computeWorldVertices(spine::Slot &slot, size_t start, size_t count, float *worldVertices, size_t offset, @optional size_t stride) return _spine_VertexAttachment_computeWorldVertices$5(L); } - // if ((olua_is_object(L, 2, "spine.Slot")) && (olua_is_integer(L, 3)) && (olua_is_integer(L, 4)) && (olua_is_vector(L, 5)) && (olua_is_integer(L, 6))) { + // if ((olua_is_object(L, 2, "spine.Slot")) && (olua_is_integer(L, 3)) && (olua_is_integer(L, 4)) && (olua_is_array(L, 5)) && (olua_is_integer(L, 6))) { // void computeWorldVertices(spine::Slot &slot, size_t start, size_t count, spine::Vector &worldVertices, size_t offset, @optional size_t stride) return _spine_VertexAttachment_computeWorldVertices$6(L); // } } if (num_args == 6) { - if ((olua_is_object(L, 2, "spine.Slot")) && (olua_is_integer(L, 3)) && (olua_is_integer(L, 4)) && (olua_is_array(L, 5, "olua.float")) && (olua_is_integer(L, 6)) && (olua_is_integer(L, 7))) { + if ((olua_is_object(L, 2, "spine.Slot")) && (olua_is_integer(L, 3)) && (olua_is_integer(L, 4)) && (olua_is_pointer(L, 5, "olua.float")) && (olua_is_integer(L, 6)) && (olua_is_integer(L, 7))) { // void computeWorldVertices(spine::Slot &slot, size_t start, size_t count, float *worldVertices, size_t offset, @optional size_t stride) return _spine_VertexAttachment_computeWorldVertices$3(L); } - // if ((olua_is_object(L, 2, "spine.Slot")) && (olua_is_integer(L, 3)) && (olua_is_integer(L, 4)) && (olua_is_vector(L, 5)) && (olua_is_integer(L, 6)) && (olua_is_integer(L, 7))) { + // if ((olua_is_object(L, 2, "spine.Slot")) && (olua_is_integer(L, 3)) && (olua_is_integer(L, 4)) && (olua_is_array(L, 5)) && (olua_is_integer(L, 6)) && (olua_is_integer(L, 7))) { // void computeWorldVertices(spine::Slot &slot, size_t start, size_t count, spine::Vector &worldVertices, size_t offset, @optional size_t stride) return _spine_VertexAttachment_computeWorldVertices$4(L); // } @@ -9869,7 +9869,7 @@ static int _spine_VertexAttachment_getBones(lua_State *L) // spine::Vector &getBones() spine::Vector &ret = self->getBones(); - int num_ret = olua_push_vector(L, ret, [L](int &arg1) { + int num_ret = olua_push_array(L, ret, [L](int &arg1) { olua_push_integer(L, arg1); }); @@ -9922,7 +9922,7 @@ static int _spine_VertexAttachment_getVertices(lua_State *L) // spine::Vector &getVertices() spine::Vector &ret = self->getVertices(); - int num_ret = olua_push_vector(L, ret, [L](float &arg1) { + int num_ret = olua_push_array(L, ret, [L](float &arg1) { olua_push_number(L, arg1); }); @@ -10166,7 +10166,7 @@ static int _spine_MeshAttachment_getEdges(lua_State *L) // spine::Vector &getEdges() spine::Vector &ret = self->getEdges(); - int num_ret = olua_push_vector(L, ret, [L](unsigned short &arg1) { + int num_ret = olua_push_array(L, ret, [L](unsigned short &arg1) { olua_push_integer(L, arg1); }); @@ -10270,7 +10270,7 @@ static int _spine_MeshAttachment_getRegionUVs(lua_State *L) // spine::Vector &getRegionUVs() spine::Vector &ret = self->getRegionUVs(); - int num_ret = olua_push_vector(L, ret, [L](float &arg1) { + int num_ret = olua_push_array(L, ret, [L](float &arg1) { olua_push_number(L, arg1); }); @@ -10306,7 +10306,7 @@ static int _spine_MeshAttachment_getTriangles(lua_State *L) // spine::Vector &getTriangles() spine::Vector &ret = self->getTriangles(); - int num_ret = olua_push_vector(L, ret, [L](unsigned short &arg1) { + int num_ret = olua_push_array(L, ret, [L](unsigned short &arg1) { olua_push_integer(L, arg1); }); @@ -10325,7 +10325,7 @@ static int _spine_MeshAttachment_getUVs(lua_State *L) // spine::Vector &getUVs() spine::Vector &ret = self->getUVs(); - int num_ret = olua_push_vector(L, ret, [L](float &arg1) { + int num_ret = olua_push_array(L, ret, [L](float &arg1) { olua_push_number(L, arg1); }); @@ -10598,7 +10598,7 @@ static int _spine_PathAttachment_getLengths(lua_State *L) // spine::Vector &getLengths() spine::Vector &ret = self->getLengths(); - int num_ret = olua_push_vector(L, ret, [L](float &arg1) { + int num_ret = olua_push_array(L, ret, [L](float &arg1) { olua_push_number(L, arg1); }); @@ -10725,7 +10725,7 @@ static int _spine_PathConstraint_getBones(lua_State *L) // spine::Vector &getBones() spine::Vector &ret = self->getBones(); - int num_ret = olua_push_vector(L, ret, [L](spine::Bone *arg1) { + int num_ret = olua_push_array(L, ret, [L](spine::Bone *arg1) { olua_push_object(L, arg1, "spine.Bone"); }); @@ -11043,8 +11043,8 @@ static int _spine_PointAttachment_computeWorldPosition(lua_State *L) olua_to_object(L, 1, &self, "spine.PointAttachment"); olua_check_object(L, 2, &arg1, "spine.Bone"); - olua_check_array(L, 3, &arg2, "olua.float"); - olua_check_array(L, 4, &arg3, "olua.float"); + olua_check_pointer(L, 3, &arg2, "olua.float"); + olua_check_pointer(L, 4, &arg3, "olua.float"); // void computeWorldPosition(spine::Bone &bone, float &ox, float &oy) self->computeWorldPosition(*arg1, *arg2, *arg3); @@ -11248,7 +11248,7 @@ static int _spine_RegionAttachment_computeWorldVertices$1(lua_State *L) olua_to_object(L, 1, &self, "spine.RegionAttachment"); olua_check_object(L, 2, &arg1, "spine.Slot"); - olua_check_array(L, 3, &arg2, "olua.float"); + olua_check_pointer(L, 3, &arg2, "olua.float"); olua_check_integer(L, 4, &arg3); olua_check_integer(L, 5, &arg4); @@ -11272,7 +11272,7 @@ static int _spine_RegionAttachment_computeWorldVertices$2(lua_State *L) olua_to_object(L, 1, &self, "spine.RegionAttachment"); olua_check_object(L, 2, &arg1, "spine.Slot"); - olua_check_vector(L, 3, arg2, [L](float *arg1) { + olua_check_array(L, 3, arg2, [L](float *arg1) { olua_check_number(L, -1, arg1); }); olua_check_integer(L, 4, &arg3); @@ -11297,7 +11297,7 @@ static int _spine_RegionAttachment_computeWorldVertices$3(lua_State *L) olua_to_object(L, 1, &self, "spine.RegionAttachment"); olua_check_object(L, 2, &arg1, "spine.Slot"); - olua_check_array(L, 3, &arg2, "olua.float"); + olua_check_pointer(L, 3, &arg2, "olua.float"); olua_check_integer(L, 4, &arg3); // void computeWorldVertices(spine::Slot &slot, float *worldVertices, size_t offset, @optional size_t stride) @@ -11319,7 +11319,7 @@ static int _spine_RegionAttachment_computeWorldVertices$4(lua_State *L) olua_to_object(L, 1, &self, "spine.RegionAttachment"); olua_check_object(L, 2, &arg1, "spine.Slot"); - olua_check_vector(L, 3, arg2, [L](float *arg1) { + olua_check_array(L, 3, arg2, [L](float *arg1) { olua_check_number(L, -1, arg1); }); olua_check_integer(L, 4, &arg3); @@ -11337,24 +11337,24 @@ static int _spine_RegionAttachment_computeWorldVertices(lua_State *L) int num_args = lua_gettop(L) - 1; if (num_args == 3) { - if ((olua_is_object(L, 2, "spine.Slot")) && (olua_is_array(L, 3, "olua.float")) && (olua_is_integer(L, 4))) { + if ((olua_is_object(L, 2, "spine.Slot")) && (olua_is_pointer(L, 3, "olua.float")) && (olua_is_integer(L, 4))) { // void computeWorldVertices(spine::Slot &slot, float *worldVertices, size_t offset, @optional size_t stride) return _spine_RegionAttachment_computeWorldVertices$3(L); } - // if ((olua_is_object(L, 2, "spine.Slot")) && (olua_is_vector(L, 3)) && (olua_is_integer(L, 4))) { + // if ((olua_is_object(L, 2, "spine.Slot")) && (olua_is_array(L, 3)) && (olua_is_integer(L, 4))) { // void computeWorldVertices(spine::Slot &slot, spine::Vector &worldVertices, size_t offset, @optional size_t stride) return _spine_RegionAttachment_computeWorldVertices$4(L); // } } if (num_args == 4) { - if ((olua_is_object(L, 2, "spine.Slot")) && (olua_is_array(L, 3, "olua.float")) && (olua_is_integer(L, 4)) && (olua_is_integer(L, 5))) { + if ((olua_is_object(L, 2, "spine.Slot")) && (olua_is_pointer(L, 3, "olua.float")) && (olua_is_integer(L, 4)) && (olua_is_integer(L, 5))) { // void computeWorldVertices(spine::Slot &slot, float *worldVertices, size_t offset, @optional size_t stride) return _spine_RegionAttachment_computeWorldVertices$1(L); } - // if ((olua_is_object(L, 2, "spine.Slot")) && (olua_is_vector(L, 3)) && (olua_is_integer(L, 4)) && (olua_is_integer(L, 5))) { + // if ((olua_is_object(L, 2, "spine.Slot")) && (olua_is_array(L, 3)) && (olua_is_integer(L, 4)) && (olua_is_integer(L, 5))) { // void computeWorldVertices(spine::Slot &slot, spine::Vector &worldVertices, size_t offset, @optional size_t stride) return _spine_RegionAttachment_computeWorldVertices$2(L); // } @@ -11409,7 +11409,7 @@ static int _spine_RegionAttachment_getOffset(lua_State *L) // spine::Vector &getOffset() spine::Vector &ret = self->getOffset(); - int num_ret = olua_push_vector(L, ret, [L](float &arg1) { + int num_ret = olua_push_array(L, ret, [L](float &arg1) { olua_push_number(L, arg1); }); @@ -11530,7 +11530,7 @@ static int _spine_RegionAttachment_getUVs(lua_State *L) // spine::Vector &getUVs() spine::Vector &ret = self->getUVs(); - int num_ret = olua_push_vector(L, ret, [L](float &arg1) { + int num_ret = olua_push_array(L, ret, [L](float &arg1) { olua_push_number(L, arg1); }); @@ -13023,7 +13023,7 @@ static int _spine_SkeletonData_getAnimations(lua_State *L) // spine::Vector &getAnimations() spine::Vector &ret = self->getAnimations(); - int num_ret = olua_push_vector(L, ret, [L](spine::Animation *arg1) { + int num_ret = olua_push_array(L, ret, [L](spine::Animation *arg1) { olua_push_object(L, arg1, "spine.Animation"); }); @@ -13059,7 +13059,7 @@ static int _spine_SkeletonData_getBones(lua_State *L) // spine::Vector &getBones() spine::Vector &ret = self->getBones(); - int num_ret = olua_push_vector(L, ret, [L](spine::BoneData *arg1) { + int num_ret = olua_push_array(L, ret, [L](spine::BoneData *arg1) { olua_push_object(L, arg1, "spine.BoneData"); }); @@ -13095,7 +13095,7 @@ static int _spine_SkeletonData_getEvents(lua_State *L) // spine::Vector &getEvents() spine::Vector &ret = self->getEvents(); - int num_ret = olua_push_vector(L, ret, [L](spine::EventData *arg1) { + int num_ret = olua_push_array(L, ret, [L](spine::EventData *arg1) { olua_push_object(L, arg1, "spine.EventData"); }); @@ -13165,7 +13165,7 @@ static int _spine_SkeletonData_getIkConstraints(lua_State *L) // spine::Vector &getIkConstraints() spine::Vector &ret = self->getIkConstraints(); - int num_ret = olua_push_vector(L, ret, [L](spine::IkConstraintData *arg1) { + int num_ret = olua_push_array(L, ret, [L](spine::IkConstraintData *arg1) { olua_push_object(L, arg1, "spine.IkConstraintData"); }); @@ -13218,7 +13218,7 @@ static int _spine_SkeletonData_getPathConstraints(lua_State *L) // spine::Vector &getPathConstraints() spine::Vector &ret = self->getPathConstraints(); - int num_ret = olua_push_vector(L, ret, [L](spine::PathConstraintData *arg1) { + int num_ret = olua_push_array(L, ret, [L](spine::PathConstraintData *arg1) { olua_push_object(L, arg1, "spine.PathConstraintData"); }); @@ -13237,7 +13237,7 @@ static int _spine_SkeletonData_getSkins(lua_State *L) // spine::Vector &getSkins() spine::Vector &ret = self->getSkins(); - int num_ret = olua_push_vector(L, ret, [L](spine::Skin *arg1) { + int num_ret = olua_push_array(L, ret, [L](spine::Skin *arg1) { olua_push_object(L, arg1, "spine.Skin"); }); @@ -13256,7 +13256,7 @@ static int _spine_SkeletonData_getSlots(lua_State *L) // spine::Vector &getSlots() spine::Vector &ret = self->getSlots(); - int num_ret = olua_push_vector(L, ret, [L](spine::SlotData *arg1) { + int num_ret = olua_push_array(L, ret, [L](spine::SlotData *arg1) { olua_push_object(L, arg1, "spine.SlotData"); }); @@ -13275,7 +13275,7 @@ static int _spine_SkeletonData_getTransformConstraints(lua_State *L) // spine::Vector &getTransformConstraints() spine::Vector &ret = self->getTransformConstraints(); - int num_ret = olua_push_vector(L, ret, [L](spine::TransformConstraintData *arg1) { + int num_ret = olua_push_array(L, ret, [L](spine::TransformConstraintData *arg1) { olua_push_object(L, arg1, "spine.TransformConstraintData"); }); @@ -13788,7 +13788,7 @@ static int _spine_Skeleton_getBones(lua_State *L) // spine::Vector &getBones() spine::Vector &ret = self->getBones(); - int num_ret = olua_push_vector(L, ret, [L](spine::Bone *arg1) { + int num_ret = olua_push_array(L, ret, [L](spine::Bone *arg1) { olua_push_object(L, arg1, "spine.Bone"); }); @@ -13841,7 +13841,7 @@ static int _spine_Skeleton_getDrawOrder(lua_State *L) // spine::Vector &getDrawOrder() spine::Vector &ret = self->getDrawOrder(); - int num_ret = olua_push_vector(L, ret, [L](spine::Slot *arg1) { + int num_ret = olua_push_array(L, ret, [L](spine::Slot *arg1) { olua_push_object(L, arg1, "spine.Slot"); }); @@ -13860,7 +13860,7 @@ static int _spine_Skeleton_getIkConstraints(lua_State *L) // spine::Vector &getIkConstraints() spine::Vector &ret = self->getIkConstraints(); - int num_ret = olua_push_vector(L, ret, [L](spine::IkConstraint *arg1) { + int num_ret = olua_push_array(L, ret, [L](spine::IkConstraint *arg1) { olua_push_object(L, arg1, "spine.IkConstraint"); }); @@ -13879,7 +13879,7 @@ static int _spine_Skeleton_getPathConstraints(lua_State *L) // spine::Vector &getPathConstraints() spine::Vector &ret = self->getPathConstraints(); - int num_ret = olua_push_vector(L, ret, [L](spine::PathConstraint *arg1) { + int num_ret = olua_push_array(L, ret, [L](spine::PathConstraint *arg1) { olua_push_object(L, arg1, "spine.PathConstraint"); }); @@ -13966,7 +13966,7 @@ static int _spine_Skeleton_getSlots(lua_State *L) // spine::Vector &getSlots() spine::Vector &ret = self->getSlots(); - int num_ret = olua_push_vector(L, ret, [L](spine::Slot *arg1) { + int num_ret = olua_push_array(L, ret, [L](spine::Slot *arg1) { olua_push_object(L, arg1, "spine.Slot"); }); @@ -13985,7 +13985,7 @@ static int _spine_Skeleton_getTransformConstraints(lua_State *L) // spine::Vector &getTransformConstraints() spine::Vector &ret = self->getTransformConstraints(); - int num_ret = olua_push_vector(L, ret, [L](spine::TransformConstraint *arg1) { + int num_ret = olua_push_array(L, ret, [L](spine::TransformConstraint *arg1) { olua_push_object(L, arg1, "spine.TransformConstraint"); }); @@ -14004,7 +14004,7 @@ static int _spine_Skeleton_getUpdateCacheList(lua_State *L) // spine::Vector &getUpdateCacheList() spine::Vector &ret = self->getUpdateCacheList(); - int num_ret = olua_push_vector(L, ret, [L](spine::Updatable *arg1) { + int num_ret = olua_push_array(L, ret, [L](spine::Updatable *arg1) { olua_push_object(L, arg1, "spine.Updatable"); }); diff --git a/frameworks/cclua/src/lua-bindings/lua_types.cpp b/frameworks/cclua/src/lua-bindings/lua_types.cpp index c5f86a9e..a13a113a 100644 --- a/frameworks/cclua/src/lua-bindings/lua_types.cpp +++ b/frameworks/cclua/src/lua-bindings/lua_types.cpp @@ -71,6 +71,26 @@ static int _olua_bool___olua_move(lua_State *L) return 1; } +static int _olua_bool_assign(lua_State *L) +{ + olua_startinvoke(L); + + olua_bool *self = nullptr; + const char *arg1 = nullptr; /** data */ + size_t arg2 = 0; /** len */ + + olua_to_object(L, 1, &self, "olua.bool"); + olua_check_string(L, 2, &arg1); + olua_check_integer(L, 3, &arg2); + + // void assign(const char *data, size_t len) + self->assign(arg1, arg2); + + olua_endinvoke(L); + + return 0; +} + static int _olua_bool_create$1(lua_State *L) { olua_startinvoke(L); @@ -128,23 +148,72 @@ static int _olua_bool_create(lua_State *L) return 0; } -static int _olua_bool_setstring(lua_State *L) +static int _olua_bool_slice$1(lua_State *L) { olua_startinvoke(L); olua_bool *self = nullptr; - const char *arg1 = nullptr; /** data */ - size_t arg2 = 0; /** len */ + size_t arg1 = 0; /** from */ + size_t arg2 = 0; /** to */ olua_to_object(L, 1, &self, "olua.bool"); - olua_check_string(L, 2, &arg1); + olua_check_integer(L, 2, &arg1); olua_check_integer(L, 3, &arg2); - // void setstring(const char *data, size_t len) - self->setstring(arg1, arg2); + // @postnew olua_bool *slice(size_t from, @optional size_t to) + olua_bool *ret = self->slice(arg1, arg2); + int num_ret = olua_push_object(L, ret, "olua.bool"); + + // insert code after call + olua_postnew(L, ret); olua_endinvoke(L); + return num_ret; +} + +static int _olua_bool_slice$2(lua_State *L) +{ + olua_startinvoke(L); + + olua_bool *self = nullptr; + size_t arg1 = 0; /** from */ + + olua_to_object(L, 1, &self, "olua.bool"); + olua_check_integer(L, 2, &arg1); + + // @postnew olua_bool *slice(size_t from, @optional size_t to) + olua_bool *ret = self->slice(arg1); + int num_ret = olua_push_object(L, ret, "olua.bool"); + + // insert code after call + olua_postnew(L, ret); + + olua_endinvoke(L); + + return num_ret; +} + +static int _olua_bool_slice(lua_State *L) +{ + int num_args = lua_gettop(L) - 1; + + if (num_args == 1) { + // if ((olua_is_integer(L, 2))) { + // @postnew olua_bool *slice(size_t from, @optional size_t to) + return _olua_bool_slice$2(L); + // } + } + + if (num_args == 2) { + // if ((olua_is_integer(L, 2)) && (olua_is_integer(L, 3))) { + // @postnew olua_bool *slice(size_t from, @optional size_t to) + return _olua_bool_slice$1(L); + // } + } + + luaL_error(L, "method 'olua_bool::slice' not support '%d' arguments", num_args); + return 0; } @@ -252,23 +321,6 @@ static int _olua_bool_tostring(lua_State *L) return (int)ret; } -static int _olua_bool_data(lua_State *L) -{ - olua_startinvoke(L); - - olua_bool *self = nullptr; - - olua_to_object(L, 1, &self, "olua.bool"); - - // @getter @name(data) bool *data() - bool *ret = self->data(); - int num_ret = olua_push_array(L, ret, "olua.bool"); - - olua_endinvoke(L); - - return num_ret; -} - static int _olua_bool_length(lua_State *L) { olua_startinvoke(L); @@ -345,12 +397,12 @@ OLUA_LIB int luaopen_olua_bool(lua_State *L) oluacls_func(L, "__index", _olua_bool___index); oluacls_func(L, "__newindex", _olua_bool___newindex); oluacls_func(L, "__olua_move", _olua_bool___olua_move); + oluacls_func(L, "assign", _olua_bool_assign); oluacls_func(L, "new", _olua_bool_create); - oluacls_func(L, "setstring", _olua_bool_setstring); + oluacls_func(L, "slice", _olua_bool_slice); oluacls_func(L, "sub", _olua_bool_sub); oluacls_func(L, "take", _olua_bool_take); oluacls_func(L, "tostring", _olua_bool_tostring); - oluacls_prop(L, "data", _olua_bool_data, nullptr); oluacls_prop(L, "length", _olua_bool_length, _olua_bool_length); oluacls_prop(L, "rawdata", _olua_bool_rawdata, nullptr); oluacls_prop(L, "sizeof", _olua_bool_size, nullptr); @@ -376,6 +428,45 @@ static int _olua_string___gc(lua_State *L) return (int)ret; } +static int _olua_string___index(lua_State *L) +{ + olua_startinvoke(L); + + olua_string *self = nullptr; + unsigned int arg1 = 0; /** idx */ + + olua_to_object(L, 1, &self, "olua.string"); + olua_check_integer(L, 2, &arg1); + + // std::string __index(unsigned int idx) + std::string ret = self->__index(arg1); + int num_ret = olua_push_string(L, ret); + + olua_endinvoke(L); + + return num_ret; +} + +static int _olua_string___newindex(lua_State *L) +{ + olua_startinvoke(L); + + olua_string *self = nullptr; + unsigned int arg1 = 0; /** idx */ + std::string arg2; /** v */ + + olua_to_object(L, 1, &self, "olua.string"); + olua_check_integer(L, 2, &arg1); + olua_check_string(L, 3, &arg2); + + // void __newindex(unsigned int idx, const std::string &v) + self->__newindex(arg1, arg2); + + olua_endinvoke(L); + + return 0; +} + static int _olua_string___olua_move(lua_State *L) { olua_startinvoke(L); @@ -388,12 +479,36 @@ static int _olua_string___olua_move(lua_State *L) return 1; } +static int _olua_string_assign(lua_State *L) +{ + olua_startinvoke(L); + + olua_string *self = nullptr; + const char *arg1 = nullptr; /** data */ + size_t arg2 = 0; /** len */ + + olua_to_object(L, 1, &self, "olua.string"); + olua_check_string(L, 2, &arg1); + olua_check_integer(L, 3, &arg2); + + // void assign(const char *data, size_t len) + self->assign(arg1, arg2); + + olua_endinvoke(L); + + return 0; +} + static int _olua_string_create$1(lua_State *L) { olua_startinvoke(L); - // @postnew @name(new) static olua_string *create() - olua_string *ret = olua_string::create(); + size_t arg1 = 0; /** len */ + + olua_check_integer(L, 1, &arg1); + + // @postnew @name(new) static olua_string *create(@optional size_t len) + olua_string *ret = olua_string::create(arg1); int num_ret = olua_push_object(L, ret, "olua.string"); // insert code after call @@ -408,12 +523,8 @@ static int _olua_string_create$2(lua_State *L) { olua_startinvoke(L); - std::string arg1; /** v */ - - olua_check_string(L, 1, &arg1); - - // @postnew @name(new) static olua_string *create(const std::string &v) - olua_string *ret = olua_string::create(arg1); + // @postnew @name(new) static olua_string *create(@optional size_t len) + olua_string *ret = olua_string::create(); int num_ret = olua_push_object(L, ret, "olua.string"); // insert code after call @@ -429,14 +540,14 @@ static int _olua_string_create(lua_State *L) int num_args = lua_gettop(L); if (num_args == 0) { - // @postnew @name(new) static olua_string *create() - return _olua_string_create$1(L); + // @postnew @name(new) static olua_string *create(@optional size_t len) + return _olua_string_create$2(L); } if (num_args == 1) { - // if ((olua_is_string(L, 1))) { - // @postnew @name(new) static olua_string *create(const std::string &v) - return _olua_string_create$2(L); + // if ((olua_is_integer(L, 1))) { + // @postnew @name(new) static olua_string *create(@optional size_t len) + return _olua_string_create$1(L); // } } @@ -445,6 +556,144 @@ static int _olua_string_create(lua_State *L) return 0; } +static int _olua_string_slice$1(lua_State *L) +{ + olua_startinvoke(L); + + olua_string *self = nullptr; + size_t arg1 = 0; /** from */ + size_t arg2 = 0; /** to */ + + olua_to_object(L, 1, &self, "olua.string"); + olua_check_integer(L, 2, &arg1); + olua_check_integer(L, 3, &arg2); + + // @postnew olua_string *slice(size_t from, @optional size_t to) + olua_string *ret = self->slice(arg1, arg2); + int num_ret = olua_push_object(L, ret, "olua.string"); + + // insert code after call + olua_postnew(L, ret); + + olua_endinvoke(L); + + return num_ret; +} + +static int _olua_string_slice$2(lua_State *L) +{ + olua_startinvoke(L); + + olua_string *self = nullptr; + size_t arg1 = 0; /** from */ + + olua_to_object(L, 1, &self, "olua.string"); + olua_check_integer(L, 2, &arg1); + + // @postnew olua_string *slice(size_t from, @optional size_t to) + olua_string *ret = self->slice(arg1); + int num_ret = olua_push_object(L, ret, "olua.string"); + + // insert code after call + olua_postnew(L, ret); + + olua_endinvoke(L); + + return num_ret; +} + +static int _olua_string_slice(lua_State *L) +{ + int num_args = lua_gettop(L) - 1; + + if (num_args == 1) { + // if ((olua_is_integer(L, 2))) { + // @postnew olua_string *slice(size_t from, @optional size_t to) + return _olua_string_slice$2(L); + // } + } + + if (num_args == 2) { + // if ((olua_is_integer(L, 2)) && (olua_is_integer(L, 3))) { + // @postnew olua_string *slice(size_t from, @optional size_t to) + return _olua_string_slice$1(L); + // } + } + + luaL_error(L, "method 'olua_string::slice' not support '%d' arguments", num_args); + + return 0; +} + +static int _olua_string_sub$1(lua_State *L) +{ + olua_startinvoke(L); + + olua_string *self = nullptr; + size_t arg1 = 0; /** from */ + size_t arg2 = 0; /** to */ + + olua_to_object(L, 1, &self, "olua.string"); + olua_check_integer(L, 2, &arg1); + olua_check_integer(L, 3, &arg2); + + // @postnew olua_string *sub(size_t from, @optional size_t to) + olua_string *ret = self->sub(arg1, arg2); + int num_ret = olua_push_object(L, ret, "olua.string"); + + // insert code after call + olua_postnew(L, ret); + + olua_endinvoke(L); + + return num_ret; +} + +static int _olua_string_sub$2(lua_State *L) +{ + olua_startinvoke(L); + + olua_string *self = nullptr; + size_t arg1 = 0; /** from */ + + olua_to_object(L, 1, &self, "olua.string"); + olua_check_integer(L, 2, &arg1); + + // @postnew olua_string *sub(size_t from, @optional size_t to) + olua_string *ret = self->sub(arg1); + int num_ret = olua_push_object(L, ret, "olua.string"); + + // insert code after call + olua_postnew(L, ret); + + olua_endinvoke(L); + + return num_ret; +} + +static int _olua_string_sub(lua_State *L) +{ + int num_args = lua_gettop(L) - 1; + + if (num_args == 1) { + // if ((olua_is_integer(L, 2))) { + // @postnew olua_string *sub(size_t from, @optional size_t to) + return _olua_string_sub$2(L); + // } + } + + if (num_args == 2) { + // if ((olua_is_integer(L, 2)) && (olua_is_integer(L, 3))) { + // @postnew olua_string *sub(size_t from, @optional size_t to) + return _olua_string_sub$1(L); + // } + } + + luaL_error(L, "method 'olua_string::sub' not support '%d' arguments", num_args); + + return 0; +} + static int _olua_string_take(lua_State *L) { olua_startinvoke(L); @@ -462,17 +711,35 @@ static int _olua_string_take(lua_State *L) return num_ret; } -static int _olua_string_data(lua_State *L) +static int _olua_string_tostring(lua_State *L) { olua_startinvoke(L); olua_string *self = nullptr; + size_t arg2 = 0; /** len */ olua_to_object(L, 1, &self, "olua.string"); + olua_check_integer(L, 2, &arg2); - // @getter @name(data) std::string *data() - std::string *ret = self->data(); - int num_ret = olua_push_pointer(L, ret, "olua.string"); + // olua_Return tostring(lua_State *L, size_t len) + olua_Return ret = self->tostring(L, arg2); + + olua_endinvoke(L); + + return (int)ret; +} + +static int _olua_string_length(lua_State *L) +{ + olua_startinvoke(L); + + olua_string *self = nullptr; + + olua_to_object(L, 1, &self, "olua.string"); + + // @getter @name(length) size_t length() + size_t ret = self->length(); + int num_ret = olua_push_integer(L, ret); olua_endinvoke(L); @@ -535,10 +802,16 @@ OLUA_LIB int luaopen_olua_string(lua_State *L) { oluacls_class(L, "olua.string"); oluacls_func(L, "__gc", _olua_string___gc); + oluacls_func(L, "__index", _olua_string___index); + oluacls_func(L, "__newindex", _olua_string___newindex); oluacls_func(L, "__olua_move", _olua_string___olua_move); + oluacls_func(L, "assign", _olua_string_assign); oluacls_func(L, "new", _olua_string_create); + oluacls_func(L, "slice", _olua_string_slice); + oluacls_func(L, "sub", _olua_string_sub); oluacls_func(L, "take", _olua_string_take); - oluacls_prop(L, "data", _olua_string_data, nullptr); + oluacls_func(L, "tostring", _olua_string_tostring); + oluacls_prop(L, "length", _olua_string_length, _olua_string_length); oluacls_prop(L, "rawdata", _olua_string_rawdata, nullptr); oluacls_prop(L, "sizeof", _olua_string_size, nullptr); oluacls_prop(L, "value", _olua_string_value, _olua_string_value); @@ -614,6 +887,26 @@ static int _olua_int8_t___olua_move(lua_State *L) return 1; } +static int _olua_int8_t_assign(lua_State *L) +{ + olua_startinvoke(L); + + olua_int8_t *self = nullptr; + const char *arg1 = nullptr; /** data */ + size_t arg2 = 0; /** len */ + + olua_to_object(L, 1, &self, "olua.int8_t"); + olua_check_string(L, 2, &arg1); + olua_check_integer(L, 3, &arg2); + + // void assign(const char *data, size_t len) + self->assign(arg1, arg2); + + olua_endinvoke(L); + + return 0; +} + static int _olua_int8_t_create$1(lua_State *L) { olua_startinvoke(L); @@ -671,23 +964,72 @@ static int _olua_int8_t_create(lua_State *L) return 0; } -static int _olua_int8_t_setstring(lua_State *L) +static int _olua_int8_t_slice$1(lua_State *L) { olua_startinvoke(L); olua_int8_t *self = nullptr; - const char *arg1 = nullptr; /** data */ - size_t arg2 = 0; /** len */ + size_t arg1 = 0; /** from */ + size_t arg2 = 0; /** to */ olua_to_object(L, 1, &self, "olua.int8_t"); - olua_check_string(L, 2, &arg1); + olua_check_integer(L, 2, &arg1); olua_check_integer(L, 3, &arg2); - // void setstring(const char *data, size_t len) - self->setstring(arg1, arg2); + // @postnew olua_int8_t *slice(size_t from, @optional size_t to) + olua_int8_t *ret = self->slice(arg1, arg2); + int num_ret = olua_push_object(L, ret, "olua.int8_t"); + + // insert code after call + olua_postnew(L, ret); olua_endinvoke(L); + return num_ret; +} + +static int _olua_int8_t_slice$2(lua_State *L) +{ + olua_startinvoke(L); + + olua_int8_t *self = nullptr; + size_t arg1 = 0; /** from */ + + olua_to_object(L, 1, &self, "olua.int8_t"); + olua_check_integer(L, 2, &arg1); + + // @postnew olua_int8_t *slice(size_t from, @optional size_t to) + olua_int8_t *ret = self->slice(arg1); + int num_ret = olua_push_object(L, ret, "olua.int8_t"); + + // insert code after call + olua_postnew(L, ret); + + olua_endinvoke(L); + + return num_ret; +} + +static int _olua_int8_t_slice(lua_State *L) +{ + int num_args = lua_gettop(L) - 1; + + if (num_args == 1) { + // if ((olua_is_integer(L, 2))) { + // @postnew olua_int8_t *slice(size_t from, @optional size_t to) + return _olua_int8_t_slice$2(L); + // } + } + + if (num_args == 2) { + // if ((olua_is_integer(L, 2)) && (olua_is_integer(L, 3))) { + // @postnew olua_int8_t *slice(size_t from, @optional size_t to) + return _olua_int8_t_slice$1(L); + // } + } + + luaL_error(L, "method 'olua_int8_t::slice' not support '%d' arguments", num_args); + return 0; } @@ -795,23 +1137,6 @@ static int _olua_int8_t_tostring(lua_State *L) return (int)ret; } -static int _olua_int8_t_data(lua_State *L) -{ - olua_startinvoke(L); - - olua_int8_t *self = nullptr; - - olua_to_object(L, 1, &self, "olua.int8_t"); - - // @getter @name(data) int8_t *data() - int8_t *ret = self->data(); - int num_ret = olua_push_array(L, ret, "olua.int8_t"); - - olua_endinvoke(L); - - return num_ret; -} - static int _olua_int8_t_length(lua_State *L) { olua_startinvoke(L); @@ -888,12 +1213,12 @@ OLUA_LIB int luaopen_olua_int8_t(lua_State *L) oluacls_func(L, "__index", _olua_int8_t___index); oluacls_func(L, "__newindex", _olua_int8_t___newindex); oluacls_func(L, "__olua_move", _olua_int8_t___olua_move); + oluacls_func(L, "assign", _olua_int8_t_assign); oluacls_func(L, "new", _olua_int8_t_create); - oluacls_func(L, "setstring", _olua_int8_t_setstring); + oluacls_func(L, "slice", _olua_int8_t_slice); oluacls_func(L, "sub", _olua_int8_t_sub); oluacls_func(L, "take", _olua_int8_t_take); oluacls_func(L, "tostring", _olua_int8_t_tostring); - oluacls_prop(L, "data", _olua_int8_t_data, nullptr); oluacls_prop(L, "length", _olua_int8_t_length, _olua_int8_t_length); oluacls_prop(L, "rawdata", _olua_int8_t_rawdata, nullptr); oluacls_prop(L, "sizeof", _olua_int8_t_size, nullptr); @@ -970,6 +1295,26 @@ static int _olua_int16_t___olua_move(lua_State *L) return 1; } +static int _olua_int16_t_assign(lua_State *L) +{ + olua_startinvoke(L); + + olua_int16_t *self = nullptr; + const char *arg1 = nullptr; /** data */ + size_t arg2 = 0; /** len */ + + olua_to_object(L, 1, &self, "olua.int16_t"); + olua_check_string(L, 2, &arg1); + olua_check_integer(L, 3, &arg2); + + // void assign(const char *data, size_t len) + self->assign(arg1, arg2); + + olua_endinvoke(L); + + return 0; +} + static int _olua_int16_t_create$1(lua_State *L) { olua_startinvoke(L); @@ -1027,22 +1372,71 @@ static int _olua_int16_t_create(lua_State *L) return 0; } -static int _olua_int16_t_setstring(lua_State *L) +static int _olua_int16_t_slice$1(lua_State *L) { olua_startinvoke(L); olua_int16_t *self = nullptr; - const char *arg1 = nullptr; /** data */ - size_t arg2 = 0; /** len */ + size_t arg1 = 0; /** from */ + size_t arg2 = 0; /** to */ + + olua_to_object(L, 1, &self, "olua.int16_t"); + olua_check_integer(L, 2, &arg1); + olua_check_integer(L, 3, &arg2); + + // @postnew olua_int16_t *slice(size_t from, @optional size_t to) + olua_int16_t *ret = self->slice(arg1, arg2); + int num_ret = olua_push_object(L, ret, "olua.int16_t"); + + // insert code after call + olua_postnew(L, ret); + + olua_endinvoke(L); + + return num_ret; +} + +static int _olua_int16_t_slice$2(lua_State *L) +{ + olua_startinvoke(L); + + olua_int16_t *self = nullptr; + size_t arg1 = 0; /** from */ + + olua_to_object(L, 1, &self, "olua.int16_t"); + olua_check_integer(L, 2, &arg1); + + // @postnew olua_int16_t *slice(size_t from, @optional size_t to) + olua_int16_t *ret = self->slice(arg1); + int num_ret = olua_push_object(L, ret, "olua.int16_t"); + + // insert code after call + olua_postnew(L, ret); + + olua_endinvoke(L); + + return num_ret; +} + +static int _olua_int16_t_slice(lua_State *L) +{ + int num_args = lua_gettop(L) - 1; - olua_to_object(L, 1, &self, "olua.int16_t"); - olua_check_string(L, 2, &arg1); - olua_check_integer(L, 3, &arg2); + if (num_args == 1) { + // if ((olua_is_integer(L, 2))) { + // @postnew olua_int16_t *slice(size_t from, @optional size_t to) + return _olua_int16_t_slice$2(L); + // } + } - // void setstring(const char *data, size_t len) - self->setstring(arg1, arg2); + if (num_args == 2) { + // if ((olua_is_integer(L, 2)) && (olua_is_integer(L, 3))) { + // @postnew olua_int16_t *slice(size_t from, @optional size_t to) + return _olua_int16_t_slice$1(L); + // } + } - olua_endinvoke(L); + luaL_error(L, "method 'olua_int16_t::slice' not support '%d' arguments", num_args); return 0; } @@ -1151,23 +1545,6 @@ static int _olua_int16_t_tostring(lua_State *L) return (int)ret; } -static int _olua_int16_t_data(lua_State *L) -{ - olua_startinvoke(L); - - olua_int16_t *self = nullptr; - - olua_to_object(L, 1, &self, "olua.int16_t"); - - // @getter @name(data) int16_t *data() - int16_t *ret = self->data(); - int num_ret = olua_push_array(L, ret, "olua.int16_t"); - - olua_endinvoke(L); - - return num_ret; -} - static int _olua_int16_t_length(lua_State *L) { olua_startinvoke(L); @@ -1244,12 +1621,12 @@ OLUA_LIB int luaopen_olua_int16_t(lua_State *L) oluacls_func(L, "__index", _olua_int16_t___index); oluacls_func(L, "__newindex", _olua_int16_t___newindex); oluacls_func(L, "__olua_move", _olua_int16_t___olua_move); + oluacls_func(L, "assign", _olua_int16_t_assign); oluacls_func(L, "new", _olua_int16_t_create); - oluacls_func(L, "setstring", _olua_int16_t_setstring); + oluacls_func(L, "slice", _olua_int16_t_slice); oluacls_func(L, "sub", _olua_int16_t_sub); oluacls_func(L, "take", _olua_int16_t_take); oluacls_func(L, "tostring", _olua_int16_t_tostring); - oluacls_prop(L, "data", _olua_int16_t_data, nullptr); oluacls_prop(L, "length", _olua_int16_t_length, _olua_int16_t_length); oluacls_prop(L, "rawdata", _olua_int16_t_rawdata, nullptr); oluacls_prop(L, "sizeof", _olua_int16_t_size, nullptr); @@ -1326,6 +1703,26 @@ static int _olua_int32_t___olua_move(lua_State *L) return 1; } +static int _olua_int32_t_assign(lua_State *L) +{ + olua_startinvoke(L); + + olua_int32_t *self = nullptr; + const char *arg1 = nullptr; /** data */ + size_t arg2 = 0; /** len */ + + olua_to_object(L, 1, &self, "olua.int32_t"); + olua_check_string(L, 2, &arg1); + olua_check_integer(L, 3, &arg2); + + // void assign(const char *data, size_t len) + self->assign(arg1, arg2); + + olua_endinvoke(L); + + return 0; +} + static int _olua_int32_t_create$1(lua_State *L) { olua_startinvoke(L); @@ -1383,23 +1780,72 @@ static int _olua_int32_t_create(lua_State *L) return 0; } -static int _olua_int32_t_setstring(lua_State *L) +static int _olua_int32_t_slice$1(lua_State *L) { olua_startinvoke(L); olua_int32_t *self = nullptr; - const char *arg1 = nullptr; /** data */ - size_t arg2 = 0; /** len */ + size_t arg1 = 0; /** from */ + size_t arg2 = 0; /** to */ olua_to_object(L, 1, &self, "olua.int32_t"); - olua_check_string(L, 2, &arg1); + olua_check_integer(L, 2, &arg1); olua_check_integer(L, 3, &arg2); - // void setstring(const char *data, size_t len) - self->setstring(arg1, arg2); + // @postnew olua_int32_t *slice(size_t from, @optional size_t to) + olua_int32_t *ret = self->slice(arg1, arg2); + int num_ret = olua_push_object(L, ret, "olua.int32_t"); + + // insert code after call + olua_postnew(L, ret); + + olua_endinvoke(L); + + return num_ret; +} + +static int _olua_int32_t_slice$2(lua_State *L) +{ + olua_startinvoke(L); + + olua_int32_t *self = nullptr; + size_t arg1 = 0; /** from */ + + olua_to_object(L, 1, &self, "olua.int32_t"); + olua_check_integer(L, 2, &arg1); + + // @postnew olua_int32_t *slice(size_t from, @optional size_t to) + olua_int32_t *ret = self->slice(arg1); + int num_ret = olua_push_object(L, ret, "olua.int32_t"); + + // insert code after call + olua_postnew(L, ret); olua_endinvoke(L); + return num_ret; +} + +static int _olua_int32_t_slice(lua_State *L) +{ + int num_args = lua_gettop(L) - 1; + + if (num_args == 1) { + // if ((olua_is_integer(L, 2))) { + // @postnew olua_int32_t *slice(size_t from, @optional size_t to) + return _olua_int32_t_slice$2(L); + // } + } + + if (num_args == 2) { + // if ((olua_is_integer(L, 2)) && (olua_is_integer(L, 3))) { + // @postnew olua_int32_t *slice(size_t from, @optional size_t to) + return _olua_int32_t_slice$1(L); + // } + } + + luaL_error(L, "method 'olua_int32_t::slice' not support '%d' arguments", num_args); + return 0; } @@ -1507,23 +1953,6 @@ static int _olua_int32_t_tostring(lua_State *L) return (int)ret; } -static int _olua_int32_t_data(lua_State *L) -{ - olua_startinvoke(L); - - olua_int32_t *self = nullptr; - - olua_to_object(L, 1, &self, "olua.int32_t"); - - // @getter @name(data) int32_t *data() - int32_t *ret = self->data(); - int num_ret = olua_push_array(L, ret, "olua.int32_t"); - - olua_endinvoke(L); - - return num_ret; -} - static int _olua_int32_t_length(lua_State *L) { olua_startinvoke(L); @@ -1600,12 +2029,12 @@ OLUA_LIB int luaopen_olua_int32_t(lua_State *L) oluacls_func(L, "__index", _olua_int32_t___index); oluacls_func(L, "__newindex", _olua_int32_t___newindex); oluacls_func(L, "__olua_move", _olua_int32_t___olua_move); + oluacls_func(L, "assign", _olua_int32_t_assign); oluacls_func(L, "new", _olua_int32_t_create); - oluacls_func(L, "setstring", _olua_int32_t_setstring); + oluacls_func(L, "slice", _olua_int32_t_slice); oluacls_func(L, "sub", _olua_int32_t_sub); oluacls_func(L, "take", _olua_int32_t_take); oluacls_func(L, "tostring", _olua_int32_t_tostring); - oluacls_prop(L, "data", _olua_int32_t_data, nullptr); oluacls_prop(L, "length", _olua_int32_t_length, _olua_int32_t_length); oluacls_prop(L, "rawdata", _olua_int32_t_rawdata, nullptr); oluacls_prop(L, "sizeof", _olua_int32_t_size, nullptr); @@ -1682,6 +2111,26 @@ static int _olua_int64_t___olua_move(lua_State *L) return 1; } +static int _olua_int64_t_assign(lua_State *L) +{ + olua_startinvoke(L); + + olua_int64_t *self = nullptr; + const char *arg1 = nullptr; /** data */ + size_t arg2 = 0; /** len */ + + olua_to_object(L, 1, &self, "olua.int64_t"); + olua_check_string(L, 2, &arg1); + olua_check_integer(L, 3, &arg2); + + // void assign(const char *data, size_t len) + self->assign(arg1, arg2); + + olua_endinvoke(L); + + return 0; +} + static int _olua_int64_t_create$1(lua_State *L) { olua_startinvoke(L); @@ -1739,23 +2188,72 @@ static int _olua_int64_t_create(lua_State *L) return 0; } -static int _olua_int64_t_setstring(lua_State *L) +static int _olua_int64_t_slice$1(lua_State *L) { olua_startinvoke(L); olua_int64_t *self = nullptr; - const char *arg1 = nullptr; /** data */ - size_t arg2 = 0; /** len */ + size_t arg1 = 0; /** from */ + size_t arg2 = 0; /** to */ olua_to_object(L, 1, &self, "olua.int64_t"); - olua_check_string(L, 2, &arg1); + olua_check_integer(L, 2, &arg1); olua_check_integer(L, 3, &arg2); - // void setstring(const char *data, size_t len) - self->setstring(arg1, arg2); + // @postnew olua_int64_t *slice(size_t from, @optional size_t to) + olua_int64_t *ret = self->slice(arg1, arg2); + int num_ret = olua_push_object(L, ret, "olua.int64_t"); + + // insert code after call + olua_postnew(L, ret); + + olua_endinvoke(L); + + return num_ret; +} + +static int _olua_int64_t_slice$2(lua_State *L) +{ + olua_startinvoke(L); + + olua_int64_t *self = nullptr; + size_t arg1 = 0; /** from */ + + olua_to_object(L, 1, &self, "olua.int64_t"); + olua_check_integer(L, 2, &arg1); + + // @postnew olua_int64_t *slice(size_t from, @optional size_t to) + olua_int64_t *ret = self->slice(arg1); + int num_ret = olua_push_object(L, ret, "olua.int64_t"); + + // insert code after call + olua_postnew(L, ret); olua_endinvoke(L); + return num_ret; +} + +static int _olua_int64_t_slice(lua_State *L) +{ + int num_args = lua_gettop(L) - 1; + + if (num_args == 1) { + // if ((olua_is_integer(L, 2))) { + // @postnew olua_int64_t *slice(size_t from, @optional size_t to) + return _olua_int64_t_slice$2(L); + // } + } + + if (num_args == 2) { + // if ((olua_is_integer(L, 2)) && (olua_is_integer(L, 3))) { + // @postnew olua_int64_t *slice(size_t from, @optional size_t to) + return _olua_int64_t_slice$1(L); + // } + } + + luaL_error(L, "method 'olua_int64_t::slice' not support '%d' arguments", num_args); + return 0; } @@ -1863,23 +2361,6 @@ static int _olua_int64_t_tostring(lua_State *L) return (int)ret; } -static int _olua_int64_t_data(lua_State *L) -{ - olua_startinvoke(L); - - olua_int64_t *self = nullptr; - - olua_to_object(L, 1, &self, "olua.int64_t"); - - // @getter @name(data) int64_t *data() - int64_t *ret = self->data(); - int num_ret = olua_push_array(L, ret, "olua.int64_t"); - - olua_endinvoke(L); - - return num_ret; -} - static int _olua_int64_t_length(lua_State *L) { olua_startinvoke(L); @@ -1956,12 +2437,12 @@ OLUA_LIB int luaopen_olua_int64_t(lua_State *L) oluacls_func(L, "__index", _olua_int64_t___index); oluacls_func(L, "__newindex", _olua_int64_t___newindex); oluacls_func(L, "__olua_move", _olua_int64_t___olua_move); + oluacls_func(L, "assign", _olua_int64_t_assign); oluacls_func(L, "new", _olua_int64_t_create); - oluacls_func(L, "setstring", _olua_int64_t_setstring); + oluacls_func(L, "slice", _olua_int64_t_slice); oluacls_func(L, "sub", _olua_int64_t_sub); oluacls_func(L, "take", _olua_int64_t_take); oluacls_func(L, "tostring", _olua_int64_t_tostring); - oluacls_prop(L, "data", _olua_int64_t_data, nullptr); oluacls_prop(L, "length", _olua_int64_t_length, _olua_int64_t_length); oluacls_prop(L, "rawdata", _olua_int64_t_rawdata, nullptr); oluacls_prop(L, "sizeof", _olua_int64_t_size, nullptr); @@ -2038,6 +2519,26 @@ static int _olua_uint8_t___olua_move(lua_State *L) return 1; } +static int _olua_uint8_t_assign(lua_State *L) +{ + olua_startinvoke(L); + + olua_uint8_t *self = nullptr; + const char *arg1 = nullptr; /** data */ + size_t arg2 = 0; /** len */ + + olua_to_object(L, 1, &self, "olua.uint8_t"); + olua_check_string(L, 2, &arg1); + olua_check_integer(L, 3, &arg2); + + // void assign(const char *data, size_t len) + self->assign(arg1, arg2); + + olua_endinvoke(L); + + return 0; +} + static int _olua_uint8_t_create$1(lua_State *L) { olua_startinvoke(L); @@ -2062,8 +2563,75 @@ static int _olua_uint8_t_create$2(lua_State *L) { olua_startinvoke(L); - // @postnew @name(new) static olua_uint8_t *create(@optional size_t len) - olua_uint8_t *ret = olua_uint8_t::create(); + // @postnew @name(new) static olua_uint8_t *create(@optional size_t len) + olua_uint8_t *ret = olua_uint8_t::create(); + int num_ret = olua_push_object(L, ret, "olua.uint8_t"); + + // insert code after call + olua_postnew(L, ret); + + olua_endinvoke(L); + + return num_ret; +} + +static int _olua_uint8_t_create(lua_State *L) +{ + int num_args = lua_gettop(L); + + if (num_args == 0) { + // @postnew @name(new) static olua_uint8_t *create(@optional size_t len) + return _olua_uint8_t_create$2(L); + } + + if (num_args == 1) { + // if ((olua_is_integer(L, 1))) { + // @postnew @name(new) static olua_uint8_t *create(@optional size_t len) + return _olua_uint8_t_create$1(L); + // } + } + + luaL_error(L, "method 'olua_uint8_t::create' not support '%d' arguments", num_args); + + return 0; +} + +static int _olua_uint8_t_slice$1(lua_State *L) +{ + olua_startinvoke(L); + + olua_uint8_t *self = nullptr; + size_t arg1 = 0; /** from */ + size_t arg2 = 0; /** to */ + + olua_to_object(L, 1, &self, "olua.uint8_t"); + olua_check_integer(L, 2, &arg1); + olua_check_integer(L, 3, &arg2); + + // @postnew olua_uint8_t *slice(size_t from, @optional size_t to) + olua_uint8_t *ret = self->slice(arg1, arg2); + int num_ret = olua_push_object(L, ret, "olua.uint8_t"); + + // insert code after call + olua_postnew(L, ret); + + olua_endinvoke(L); + + return num_ret; +} + +static int _olua_uint8_t_slice$2(lua_State *L) +{ + olua_startinvoke(L); + + olua_uint8_t *self = nullptr; + size_t arg1 = 0; /** from */ + + olua_to_object(L, 1, &self, "olua.uint8_t"); + olua_check_integer(L, 2, &arg1); + + // @postnew olua_uint8_t *slice(size_t from, @optional size_t to) + olua_uint8_t *ret = self->slice(arg1); int num_ret = olua_push_object(L, ret, "olua.uint8_t"); // insert code after call @@ -2074,43 +2642,25 @@ static int _olua_uint8_t_create$2(lua_State *L) return num_ret; } -static int _olua_uint8_t_create(lua_State *L) +static int _olua_uint8_t_slice(lua_State *L) { - int num_args = lua_gettop(L); - - if (num_args == 0) { - // @postnew @name(new) static olua_uint8_t *create(@optional size_t len) - return _olua_uint8_t_create$2(L); - } + int num_args = lua_gettop(L) - 1; if (num_args == 1) { - // if ((olua_is_integer(L, 1))) { - // @postnew @name(new) static olua_uint8_t *create(@optional size_t len) - return _olua_uint8_t_create$1(L); + // if ((olua_is_integer(L, 2))) { + // @postnew olua_uint8_t *slice(size_t from, @optional size_t to) + return _olua_uint8_t_slice$2(L); // } } - luaL_error(L, "method 'olua_uint8_t::create' not support '%d' arguments", num_args); - - return 0; -} - -static int _olua_uint8_t_setstring(lua_State *L) -{ - olua_startinvoke(L); - - olua_uint8_t *self = nullptr; - const char *arg1 = nullptr; /** data */ - size_t arg2 = 0; /** len */ - - olua_to_object(L, 1, &self, "olua.uint8_t"); - olua_check_string(L, 2, &arg1); - olua_check_integer(L, 3, &arg2); - - // void setstring(const char *data, size_t len) - self->setstring(arg1, arg2); + if (num_args == 2) { + // if ((olua_is_integer(L, 2)) && (olua_is_integer(L, 3))) { + // @postnew olua_uint8_t *slice(size_t from, @optional size_t to) + return _olua_uint8_t_slice$1(L); + // } + } - olua_endinvoke(L); + luaL_error(L, "method 'olua_uint8_t::slice' not support '%d' arguments", num_args); return 0; } @@ -2219,23 +2769,6 @@ static int _olua_uint8_t_tostring(lua_State *L) return (int)ret; } -static int _olua_uint8_t_data(lua_State *L) -{ - olua_startinvoke(L); - - olua_uint8_t *self = nullptr; - - olua_to_object(L, 1, &self, "olua.uint8_t"); - - // @getter @name(data) uint8_t *data() - uint8_t *ret = self->data(); - int num_ret = olua_push_array(L, ret, "olua.uint8_t"); - - olua_endinvoke(L); - - return num_ret; -} - static int _olua_uint8_t_length(lua_State *L) { olua_startinvoke(L); @@ -2312,12 +2845,12 @@ OLUA_LIB int luaopen_olua_uint8_t(lua_State *L) oluacls_func(L, "__index", _olua_uint8_t___index); oluacls_func(L, "__newindex", _olua_uint8_t___newindex); oluacls_func(L, "__olua_move", _olua_uint8_t___olua_move); + oluacls_func(L, "assign", _olua_uint8_t_assign); oluacls_func(L, "new", _olua_uint8_t_create); - oluacls_func(L, "setstring", _olua_uint8_t_setstring); + oluacls_func(L, "slice", _olua_uint8_t_slice); oluacls_func(L, "sub", _olua_uint8_t_sub); oluacls_func(L, "take", _olua_uint8_t_take); oluacls_func(L, "tostring", _olua_uint8_t_tostring); - oluacls_prop(L, "data", _olua_uint8_t_data, nullptr); oluacls_prop(L, "length", _olua_uint8_t_length, _olua_uint8_t_length); oluacls_prop(L, "rawdata", _olua_uint8_t_rawdata, nullptr); oluacls_prop(L, "sizeof", _olua_uint8_t_size, nullptr); @@ -2394,6 +2927,26 @@ static int _olua_uint16_t___olua_move(lua_State *L) return 1; } +static int _olua_uint16_t_assign(lua_State *L) +{ + olua_startinvoke(L); + + olua_uint16_t *self = nullptr; + const char *arg1 = nullptr; /** data */ + size_t arg2 = 0; /** len */ + + olua_to_object(L, 1, &self, "olua.uint16_t"); + olua_check_string(L, 2, &arg1); + olua_check_integer(L, 3, &arg2); + + // void assign(const char *data, size_t len) + self->assign(arg1, arg2); + + olua_endinvoke(L); + + return 0; +} + static int _olua_uint16_t_create$1(lua_State *L) { olua_startinvoke(L); @@ -2451,23 +3004,72 @@ static int _olua_uint16_t_create(lua_State *L) return 0; } -static int _olua_uint16_t_setstring(lua_State *L) +static int _olua_uint16_t_slice$1(lua_State *L) { olua_startinvoke(L); olua_uint16_t *self = nullptr; - const char *arg1 = nullptr; /** data */ - size_t arg2 = 0; /** len */ + size_t arg1 = 0; /** from */ + size_t arg2 = 0; /** to */ olua_to_object(L, 1, &self, "olua.uint16_t"); - olua_check_string(L, 2, &arg1); + olua_check_integer(L, 2, &arg1); olua_check_integer(L, 3, &arg2); - // void setstring(const char *data, size_t len) - self->setstring(arg1, arg2); + // @postnew olua_uint16_t *slice(size_t from, @optional size_t to) + olua_uint16_t *ret = self->slice(arg1, arg2); + int num_ret = olua_push_object(L, ret, "olua.uint16_t"); + + // insert code after call + olua_postnew(L, ret); + + olua_endinvoke(L); + + return num_ret; +} + +static int _olua_uint16_t_slice$2(lua_State *L) +{ + olua_startinvoke(L); + + olua_uint16_t *self = nullptr; + size_t arg1 = 0; /** from */ + + olua_to_object(L, 1, &self, "olua.uint16_t"); + olua_check_integer(L, 2, &arg1); + + // @postnew olua_uint16_t *slice(size_t from, @optional size_t to) + olua_uint16_t *ret = self->slice(arg1); + int num_ret = olua_push_object(L, ret, "olua.uint16_t"); + + // insert code after call + olua_postnew(L, ret); olua_endinvoke(L); + return num_ret; +} + +static int _olua_uint16_t_slice(lua_State *L) +{ + int num_args = lua_gettop(L) - 1; + + if (num_args == 1) { + // if ((olua_is_integer(L, 2))) { + // @postnew olua_uint16_t *slice(size_t from, @optional size_t to) + return _olua_uint16_t_slice$2(L); + // } + } + + if (num_args == 2) { + // if ((olua_is_integer(L, 2)) && (olua_is_integer(L, 3))) { + // @postnew olua_uint16_t *slice(size_t from, @optional size_t to) + return _olua_uint16_t_slice$1(L); + // } + } + + luaL_error(L, "method 'olua_uint16_t::slice' not support '%d' arguments", num_args); + return 0; } @@ -2575,23 +3177,6 @@ static int _olua_uint16_t_tostring(lua_State *L) return (int)ret; } -static int _olua_uint16_t_data(lua_State *L) -{ - olua_startinvoke(L); - - olua_uint16_t *self = nullptr; - - olua_to_object(L, 1, &self, "olua.uint16_t"); - - // @getter @name(data) uint16_t *data() - uint16_t *ret = self->data(); - int num_ret = olua_push_array(L, ret, "olua.uint16_t"); - - olua_endinvoke(L); - - return num_ret; -} - static int _olua_uint16_t_length(lua_State *L) { olua_startinvoke(L); @@ -2668,12 +3253,12 @@ OLUA_LIB int luaopen_olua_uint16_t(lua_State *L) oluacls_func(L, "__index", _olua_uint16_t___index); oluacls_func(L, "__newindex", _olua_uint16_t___newindex); oluacls_func(L, "__olua_move", _olua_uint16_t___olua_move); + oluacls_func(L, "assign", _olua_uint16_t_assign); oluacls_func(L, "new", _olua_uint16_t_create); - oluacls_func(L, "setstring", _olua_uint16_t_setstring); + oluacls_func(L, "slice", _olua_uint16_t_slice); oluacls_func(L, "sub", _olua_uint16_t_sub); oluacls_func(L, "take", _olua_uint16_t_take); oluacls_func(L, "tostring", _olua_uint16_t_tostring); - oluacls_prop(L, "data", _olua_uint16_t_data, nullptr); oluacls_prop(L, "length", _olua_uint16_t_length, _olua_uint16_t_length); oluacls_prop(L, "rawdata", _olua_uint16_t_rawdata, nullptr); oluacls_prop(L, "sizeof", _olua_uint16_t_size, nullptr); @@ -2750,6 +3335,26 @@ static int _olua_uint32_t___olua_move(lua_State *L) return 1; } +static int _olua_uint32_t_assign(lua_State *L) +{ + olua_startinvoke(L); + + olua_uint32_t *self = nullptr; + const char *arg1 = nullptr; /** data */ + size_t arg2 = 0; /** len */ + + olua_to_object(L, 1, &self, "olua.uint32_t"); + olua_check_string(L, 2, &arg1); + olua_check_integer(L, 3, &arg2); + + // void assign(const char *data, size_t len) + self->assign(arg1, arg2); + + olua_endinvoke(L); + + return 0; +} + static int _olua_uint32_t_create$1(lua_State *L) { olua_startinvoke(L); @@ -2807,23 +3412,72 @@ static int _olua_uint32_t_create(lua_State *L) return 0; } -static int _olua_uint32_t_setstring(lua_State *L) +static int _olua_uint32_t_slice$1(lua_State *L) { olua_startinvoke(L); olua_uint32_t *self = nullptr; - const char *arg1 = nullptr; /** data */ - size_t arg2 = 0; /** len */ + size_t arg1 = 0; /** from */ + size_t arg2 = 0; /** to */ olua_to_object(L, 1, &self, "olua.uint32_t"); - olua_check_string(L, 2, &arg1); + olua_check_integer(L, 2, &arg1); olua_check_integer(L, 3, &arg2); - // void setstring(const char *data, size_t len) - self->setstring(arg1, arg2); + // @postnew olua_uint32_t *slice(size_t from, @optional size_t to) + olua_uint32_t *ret = self->slice(arg1, arg2); + int num_ret = olua_push_object(L, ret, "olua.uint32_t"); + + // insert code after call + olua_postnew(L, ret); + + olua_endinvoke(L); + + return num_ret; +} + +static int _olua_uint32_t_slice$2(lua_State *L) +{ + olua_startinvoke(L); + + olua_uint32_t *self = nullptr; + size_t arg1 = 0; /** from */ + + olua_to_object(L, 1, &self, "olua.uint32_t"); + olua_check_integer(L, 2, &arg1); + + // @postnew olua_uint32_t *slice(size_t from, @optional size_t to) + olua_uint32_t *ret = self->slice(arg1); + int num_ret = olua_push_object(L, ret, "olua.uint32_t"); + + // insert code after call + olua_postnew(L, ret); olua_endinvoke(L); + return num_ret; +} + +static int _olua_uint32_t_slice(lua_State *L) +{ + int num_args = lua_gettop(L) - 1; + + if (num_args == 1) { + // if ((olua_is_integer(L, 2))) { + // @postnew olua_uint32_t *slice(size_t from, @optional size_t to) + return _olua_uint32_t_slice$2(L); + // } + } + + if (num_args == 2) { + // if ((olua_is_integer(L, 2)) && (olua_is_integer(L, 3))) { + // @postnew olua_uint32_t *slice(size_t from, @optional size_t to) + return _olua_uint32_t_slice$1(L); + // } + } + + luaL_error(L, "method 'olua_uint32_t::slice' not support '%d' arguments", num_args); + return 0; } @@ -2931,23 +3585,6 @@ static int _olua_uint32_t_tostring(lua_State *L) return (int)ret; } -static int _olua_uint32_t_data(lua_State *L) -{ - olua_startinvoke(L); - - olua_uint32_t *self = nullptr; - - olua_to_object(L, 1, &self, "olua.uint32_t"); - - // @getter @name(data) uint32_t *data() - uint32_t *ret = self->data(); - int num_ret = olua_push_array(L, ret, "olua.uint32_t"); - - olua_endinvoke(L); - - return num_ret; -} - static int _olua_uint32_t_length(lua_State *L) { olua_startinvoke(L); @@ -3024,12 +3661,12 @@ OLUA_LIB int luaopen_olua_uint32_t(lua_State *L) oluacls_func(L, "__index", _olua_uint32_t___index); oluacls_func(L, "__newindex", _olua_uint32_t___newindex); oluacls_func(L, "__olua_move", _olua_uint32_t___olua_move); + oluacls_func(L, "assign", _olua_uint32_t_assign); oluacls_func(L, "new", _olua_uint32_t_create); - oluacls_func(L, "setstring", _olua_uint32_t_setstring); + oluacls_func(L, "slice", _olua_uint32_t_slice); oluacls_func(L, "sub", _olua_uint32_t_sub); oluacls_func(L, "take", _olua_uint32_t_take); oluacls_func(L, "tostring", _olua_uint32_t_tostring); - oluacls_prop(L, "data", _olua_uint32_t_data, nullptr); oluacls_prop(L, "length", _olua_uint32_t_length, _olua_uint32_t_length); oluacls_prop(L, "rawdata", _olua_uint32_t_rawdata, nullptr); oluacls_prop(L, "sizeof", _olua_uint32_t_size, nullptr); @@ -3106,6 +3743,26 @@ static int _olua_uint64_t___olua_move(lua_State *L) return 1; } +static int _olua_uint64_t_assign(lua_State *L) +{ + olua_startinvoke(L); + + olua_uint64_t *self = nullptr; + const char *arg1 = nullptr; /** data */ + size_t arg2 = 0; /** len */ + + olua_to_object(L, 1, &self, "olua.uint64_t"); + olua_check_string(L, 2, &arg1); + olua_check_integer(L, 3, &arg2); + + // void assign(const char *data, size_t len) + self->assign(arg1, arg2); + + olua_endinvoke(L); + + return 0; +} + static int _olua_uint64_t_create$1(lua_State *L) { olua_startinvoke(L); @@ -3163,22 +3820,71 @@ static int _olua_uint64_t_create(lua_State *L) return 0; } -static int _olua_uint64_t_setstring(lua_State *L) +static int _olua_uint64_t_slice$1(lua_State *L) { olua_startinvoke(L); olua_uint64_t *self = nullptr; - const char *arg1 = nullptr; /** data */ - size_t arg2 = 0; /** len */ + size_t arg1 = 0; /** from */ + size_t arg2 = 0; /** to */ olua_to_object(L, 1, &self, "olua.uint64_t"); - olua_check_string(L, 2, &arg1); + olua_check_integer(L, 2, &arg1); olua_check_integer(L, 3, &arg2); - // void setstring(const char *data, size_t len) - self->setstring(arg1, arg2); + // @postnew olua_uint64_t *slice(size_t from, @optional size_t to) + olua_uint64_t *ret = self->slice(arg1, arg2); + int num_ret = olua_push_object(L, ret, "olua.uint64_t"); + + // insert code after call + olua_postnew(L, ret); + + olua_endinvoke(L); + + return num_ret; +} + +static int _olua_uint64_t_slice$2(lua_State *L) +{ + olua_startinvoke(L); + + olua_uint64_t *self = nullptr; + size_t arg1 = 0; /** from */ + + olua_to_object(L, 1, &self, "olua.uint64_t"); + olua_check_integer(L, 2, &arg1); + + // @postnew olua_uint64_t *slice(size_t from, @optional size_t to) + olua_uint64_t *ret = self->slice(arg1); + int num_ret = olua_push_object(L, ret, "olua.uint64_t"); + + // insert code after call + olua_postnew(L, ret); + + olua_endinvoke(L); + + return num_ret; +} + +static int _olua_uint64_t_slice(lua_State *L) +{ + int num_args = lua_gettop(L) - 1; + + if (num_args == 1) { + // if ((olua_is_integer(L, 2))) { + // @postnew olua_uint64_t *slice(size_t from, @optional size_t to) + return _olua_uint64_t_slice$2(L); + // } + } - olua_endinvoke(L); + if (num_args == 2) { + // if ((olua_is_integer(L, 2)) && (olua_is_integer(L, 3))) { + // @postnew olua_uint64_t *slice(size_t from, @optional size_t to) + return _olua_uint64_t_slice$1(L); + // } + } + + luaL_error(L, "method 'olua_uint64_t::slice' not support '%d' arguments", num_args); return 0; } @@ -3287,23 +3993,6 @@ static int _olua_uint64_t_tostring(lua_State *L) return (int)ret; } -static int _olua_uint64_t_data(lua_State *L) -{ - olua_startinvoke(L); - - olua_uint64_t *self = nullptr; - - olua_to_object(L, 1, &self, "olua.uint64_t"); - - // @getter @name(data) uint64_t *data() - uint64_t *ret = self->data(); - int num_ret = olua_push_array(L, ret, "olua.uint64_t"); - - olua_endinvoke(L); - - return num_ret; -} - static int _olua_uint64_t_length(lua_State *L) { olua_startinvoke(L); @@ -3380,12 +4069,12 @@ OLUA_LIB int luaopen_olua_uint64_t(lua_State *L) oluacls_func(L, "__index", _olua_uint64_t___index); oluacls_func(L, "__newindex", _olua_uint64_t___newindex); oluacls_func(L, "__olua_move", _olua_uint64_t___olua_move); + oluacls_func(L, "assign", _olua_uint64_t_assign); oluacls_func(L, "new", _olua_uint64_t_create); - oluacls_func(L, "setstring", _olua_uint64_t_setstring); + oluacls_func(L, "slice", _olua_uint64_t_slice); oluacls_func(L, "sub", _olua_uint64_t_sub); oluacls_func(L, "take", _olua_uint64_t_take); oluacls_func(L, "tostring", _olua_uint64_t_tostring); - oluacls_prop(L, "data", _olua_uint64_t_data, nullptr); oluacls_prop(L, "length", _olua_uint64_t_length, _olua_uint64_t_length); oluacls_prop(L, "rawdata", _olua_uint64_t_rawdata, nullptr); oluacls_prop(L, "sizeof", _olua_uint64_t_size, nullptr); @@ -3462,6 +4151,26 @@ static int _olua_char___olua_move(lua_State *L) return 1; } +static int _olua_char_assign(lua_State *L) +{ + olua_startinvoke(L); + + olua_char *self = nullptr; + const char *arg1 = nullptr; /** data */ + size_t arg2 = 0; /** len */ + + olua_to_object(L, 1, &self, "olua.char"); + olua_check_string(L, 2, &arg1); + olua_check_integer(L, 3, &arg2); + + // void assign(const char *data, size_t len) + self->assign(arg1, arg2); + + olua_endinvoke(L); + + return 0; +} + static int _olua_char_create$1(lua_State *L) { olua_startinvoke(L); @@ -3519,23 +4228,72 @@ static int _olua_char_create(lua_State *L) return 0; } -static int _olua_char_setstring(lua_State *L) +static int _olua_char_slice$1(lua_State *L) { olua_startinvoke(L); olua_char *self = nullptr; - const char *arg1 = nullptr; /** data */ - size_t arg2 = 0; /** len */ + size_t arg1 = 0; /** from */ + size_t arg2 = 0; /** to */ olua_to_object(L, 1, &self, "olua.char"); - olua_check_string(L, 2, &arg1); + olua_check_integer(L, 2, &arg1); olua_check_integer(L, 3, &arg2); - // void setstring(const char *data, size_t len) - self->setstring(arg1, arg2); + // @postnew olua_char *slice(size_t from, @optional size_t to) + olua_char *ret = self->slice(arg1, arg2); + int num_ret = olua_push_object(L, ret, "olua.char"); + + // insert code after call + olua_postnew(L, ret); + + olua_endinvoke(L); + + return num_ret; +} + +static int _olua_char_slice$2(lua_State *L) +{ + olua_startinvoke(L); + + olua_char *self = nullptr; + size_t arg1 = 0; /** from */ + + olua_to_object(L, 1, &self, "olua.char"); + olua_check_integer(L, 2, &arg1); + + // @postnew olua_char *slice(size_t from, @optional size_t to) + olua_char *ret = self->slice(arg1); + int num_ret = olua_push_object(L, ret, "olua.char"); + + // insert code after call + olua_postnew(L, ret); olua_endinvoke(L); + return num_ret; +} + +static int _olua_char_slice(lua_State *L) +{ + int num_args = lua_gettop(L) - 1; + + if (num_args == 1) { + // if ((olua_is_integer(L, 2))) { + // @postnew olua_char *slice(size_t from, @optional size_t to) + return _olua_char_slice$2(L); + // } + } + + if (num_args == 2) { + // if ((olua_is_integer(L, 2)) && (olua_is_integer(L, 3))) { + // @postnew olua_char *slice(size_t from, @optional size_t to) + return _olua_char_slice$1(L); + // } + } + + luaL_error(L, "method 'olua_char::slice' not support '%d' arguments", num_args); + return 0; } @@ -3643,23 +4401,6 @@ static int _olua_char_tostring(lua_State *L) return (int)ret; } -static int _olua_char_data(lua_State *L) -{ - olua_startinvoke(L); - - olua_char *self = nullptr; - - olua_to_object(L, 1, &self, "olua.char"); - - // @getter @name(data) olua_char_t *data() - olua_char_t *ret = self->data(); - int num_ret = olua_push_array(L, ret, "olua.char"); - - olua_endinvoke(L); - - return num_ret; -} - static int _olua_char_length(lua_State *L) { olua_startinvoke(L); @@ -3736,12 +4477,12 @@ OLUA_LIB int luaopen_olua_char(lua_State *L) oluacls_func(L, "__index", _olua_char___index); oluacls_func(L, "__newindex", _olua_char___newindex); oluacls_func(L, "__olua_move", _olua_char___olua_move); + oluacls_func(L, "assign", _olua_char_assign); oluacls_func(L, "new", _olua_char_create); - oluacls_func(L, "setstring", _olua_char_setstring); + oluacls_func(L, "slice", _olua_char_slice); oluacls_func(L, "sub", _olua_char_sub); oluacls_func(L, "take", _olua_char_take); oluacls_func(L, "tostring", _olua_char_tostring); - oluacls_prop(L, "data", _olua_char_data, nullptr); oluacls_prop(L, "length", _olua_char_length, _olua_char_length); oluacls_prop(L, "rawdata", _olua_char_rawdata, nullptr); oluacls_prop(L, "sizeof", _olua_char_size, nullptr); @@ -3818,6 +4559,26 @@ static int _olua_short___olua_move(lua_State *L) return 1; } +static int _olua_short_assign(lua_State *L) +{ + olua_startinvoke(L); + + olua_short *self = nullptr; + const char *arg1 = nullptr; /** data */ + size_t arg2 = 0; /** len */ + + olua_to_object(L, 1, &self, "olua.short"); + olua_check_string(L, 2, &arg1); + olua_check_integer(L, 3, &arg2); + + // void assign(const char *data, size_t len) + self->assign(arg1, arg2); + + olua_endinvoke(L); + + return 0; +} + static int _olua_short_create$1(lua_State *L) { olua_startinvoke(L); @@ -3875,23 +4636,72 @@ static int _olua_short_create(lua_State *L) return 0; } -static int _olua_short_setstring(lua_State *L) +static int _olua_short_slice$1(lua_State *L) { olua_startinvoke(L); olua_short *self = nullptr; - const char *arg1 = nullptr; /** data */ - size_t arg2 = 0; /** len */ + size_t arg1 = 0; /** from */ + size_t arg2 = 0; /** to */ olua_to_object(L, 1, &self, "olua.short"); - olua_check_string(L, 2, &arg1); + olua_check_integer(L, 2, &arg1); olua_check_integer(L, 3, &arg2); - // void setstring(const char *data, size_t len) - self->setstring(arg1, arg2); + // @postnew olua_short *slice(size_t from, @optional size_t to) + olua_short *ret = self->slice(arg1, arg2); + int num_ret = olua_push_object(L, ret, "olua.short"); + + // insert code after call + olua_postnew(L, ret); + + olua_endinvoke(L); + + return num_ret; +} + +static int _olua_short_slice$2(lua_State *L) +{ + olua_startinvoke(L); + + olua_short *self = nullptr; + size_t arg1 = 0; /** from */ + + olua_to_object(L, 1, &self, "olua.short"); + olua_check_integer(L, 2, &arg1); + + // @postnew olua_short *slice(size_t from, @optional size_t to) + olua_short *ret = self->slice(arg1); + int num_ret = olua_push_object(L, ret, "olua.short"); + + // insert code after call + olua_postnew(L, ret); olua_endinvoke(L); + return num_ret; +} + +static int _olua_short_slice(lua_State *L) +{ + int num_args = lua_gettop(L) - 1; + + if (num_args == 1) { + // if ((olua_is_integer(L, 2))) { + // @postnew olua_short *slice(size_t from, @optional size_t to) + return _olua_short_slice$2(L); + // } + } + + if (num_args == 2) { + // if ((olua_is_integer(L, 2)) && (olua_is_integer(L, 3))) { + // @postnew olua_short *slice(size_t from, @optional size_t to) + return _olua_short_slice$1(L); + // } + } + + luaL_error(L, "method 'olua_short::slice' not support '%d' arguments", num_args); + return 0; } @@ -3999,23 +4809,6 @@ static int _olua_short_tostring(lua_State *L) return (int)ret; } -static int _olua_short_data(lua_State *L) -{ - olua_startinvoke(L); - - olua_short *self = nullptr; - - olua_to_object(L, 1, &self, "olua.short"); - - // @getter @name(data) olua_short_t *data() - olua_short_t *ret = self->data(); - int num_ret = olua_push_array(L, ret, "olua.short"); - - olua_endinvoke(L); - - return num_ret; -} - static int _olua_short_length(lua_State *L) { olua_startinvoke(L); @@ -4092,12 +4885,12 @@ OLUA_LIB int luaopen_olua_short(lua_State *L) oluacls_func(L, "__index", _olua_short___index); oluacls_func(L, "__newindex", _olua_short___newindex); oluacls_func(L, "__olua_move", _olua_short___olua_move); + oluacls_func(L, "assign", _olua_short_assign); oluacls_func(L, "new", _olua_short_create); - oluacls_func(L, "setstring", _olua_short_setstring); + oluacls_func(L, "slice", _olua_short_slice); oluacls_func(L, "sub", _olua_short_sub); oluacls_func(L, "take", _olua_short_take); oluacls_func(L, "tostring", _olua_short_tostring); - oluacls_prop(L, "data", _olua_short_data, nullptr); oluacls_prop(L, "length", _olua_short_length, _olua_short_length); oluacls_prop(L, "rawdata", _olua_short_rawdata, nullptr); oluacls_prop(L, "sizeof", _olua_short_size, nullptr); @@ -4174,6 +4967,26 @@ static int _olua_int___olua_move(lua_State *L) return 1; } +static int _olua_int_assign(lua_State *L) +{ + olua_startinvoke(L); + + olua_int *self = nullptr; + const char *arg1 = nullptr; /** data */ + size_t arg2 = 0; /** len */ + + olua_to_object(L, 1, &self, "olua.int"); + olua_check_string(L, 2, &arg1); + olua_check_integer(L, 3, &arg2); + + // void assign(const char *data, size_t len) + self->assign(arg1, arg2); + + olua_endinvoke(L); + + return 0; +} + static int _olua_int_create$1(lua_State *L) { olua_startinvoke(L); @@ -4198,8 +5011,75 @@ static int _olua_int_create$2(lua_State *L) { olua_startinvoke(L); - // @postnew @name(new) static olua_int *create(@optional size_t len) - olua_int *ret = olua_int::create(); + // @postnew @name(new) static olua_int *create(@optional size_t len) + olua_int *ret = olua_int::create(); + int num_ret = olua_push_object(L, ret, "olua.int"); + + // insert code after call + olua_postnew(L, ret); + + olua_endinvoke(L); + + return num_ret; +} + +static int _olua_int_create(lua_State *L) +{ + int num_args = lua_gettop(L); + + if (num_args == 0) { + // @postnew @name(new) static olua_int *create(@optional size_t len) + return _olua_int_create$2(L); + } + + if (num_args == 1) { + // if ((olua_is_integer(L, 1))) { + // @postnew @name(new) static olua_int *create(@optional size_t len) + return _olua_int_create$1(L); + // } + } + + luaL_error(L, "method 'olua_int::create' not support '%d' arguments", num_args); + + return 0; +} + +static int _olua_int_slice$1(lua_State *L) +{ + olua_startinvoke(L); + + olua_int *self = nullptr; + size_t arg1 = 0; /** from */ + size_t arg2 = 0; /** to */ + + olua_to_object(L, 1, &self, "olua.int"); + olua_check_integer(L, 2, &arg1); + olua_check_integer(L, 3, &arg2); + + // @postnew olua_int *slice(size_t from, @optional size_t to) + olua_int *ret = self->slice(arg1, arg2); + int num_ret = olua_push_object(L, ret, "olua.int"); + + // insert code after call + olua_postnew(L, ret); + + olua_endinvoke(L); + + return num_ret; +} + +static int _olua_int_slice$2(lua_State *L) +{ + olua_startinvoke(L); + + olua_int *self = nullptr; + size_t arg1 = 0; /** from */ + + olua_to_object(L, 1, &self, "olua.int"); + olua_check_integer(L, 2, &arg1); + + // @postnew olua_int *slice(size_t from, @optional size_t to) + olua_int *ret = self->slice(arg1); int num_ret = olua_push_object(L, ret, "olua.int"); // insert code after call @@ -4210,43 +5090,25 @@ static int _olua_int_create$2(lua_State *L) return num_ret; } -static int _olua_int_create(lua_State *L) +static int _olua_int_slice(lua_State *L) { - int num_args = lua_gettop(L); - - if (num_args == 0) { - // @postnew @name(new) static olua_int *create(@optional size_t len) - return _olua_int_create$2(L); - } + int num_args = lua_gettop(L) - 1; if (num_args == 1) { - // if ((olua_is_integer(L, 1))) { - // @postnew @name(new) static olua_int *create(@optional size_t len) - return _olua_int_create$1(L); + // if ((olua_is_integer(L, 2))) { + // @postnew olua_int *slice(size_t from, @optional size_t to) + return _olua_int_slice$2(L); // } } - luaL_error(L, "method 'olua_int::create' not support '%d' arguments", num_args); - - return 0; -} - -static int _olua_int_setstring(lua_State *L) -{ - olua_startinvoke(L); - - olua_int *self = nullptr; - const char *arg1 = nullptr; /** data */ - size_t arg2 = 0; /** len */ - - olua_to_object(L, 1, &self, "olua.int"); - olua_check_string(L, 2, &arg1); - olua_check_integer(L, 3, &arg2); - - // void setstring(const char *data, size_t len) - self->setstring(arg1, arg2); + if (num_args == 2) { + // if ((olua_is_integer(L, 2)) && (olua_is_integer(L, 3))) { + // @postnew olua_int *slice(size_t from, @optional size_t to) + return _olua_int_slice$1(L); + // } + } - olua_endinvoke(L); + luaL_error(L, "method 'olua_int::slice' not support '%d' arguments", num_args); return 0; } @@ -4355,23 +5217,6 @@ static int _olua_int_tostring(lua_State *L) return (int)ret; } -static int _olua_int_data(lua_State *L) -{ - olua_startinvoke(L); - - olua_int *self = nullptr; - - olua_to_object(L, 1, &self, "olua.int"); - - // @getter @name(data) olua_int_t *data() - olua_int_t *ret = self->data(); - int num_ret = olua_push_array(L, ret, "olua.int"); - - olua_endinvoke(L); - - return num_ret; -} - static int _olua_int_length(lua_State *L) { olua_startinvoke(L); @@ -4448,12 +5293,12 @@ OLUA_LIB int luaopen_olua_int(lua_State *L) oluacls_func(L, "__index", _olua_int___index); oluacls_func(L, "__newindex", _olua_int___newindex); oluacls_func(L, "__olua_move", _olua_int___olua_move); + oluacls_func(L, "assign", _olua_int_assign); oluacls_func(L, "new", _olua_int_create); - oluacls_func(L, "setstring", _olua_int_setstring); + oluacls_func(L, "slice", _olua_int_slice); oluacls_func(L, "sub", _olua_int_sub); oluacls_func(L, "take", _olua_int_take); oluacls_func(L, "tostring", _olua_int_tostring); - oluacls_prop(L, "data", _olua_int_data, nullptr); oluacls_prop(L, "length", _olua_int_length, _olua_int_length); oluacls_prop(L, "rawdata", _olua_int_rawdata, nullptr); oluacls_prop(L, "sizeof", _olua_int_size, nullptr); @@ -4530,6 +5375,26 @@ static int _olua_long___olua_move(lua_State *L) return 1; } +static int _olua_long_assign(lua_State *L) +{ + olua_startinvoke(L); + + olua_long *self = nullptr; + const char *arg1 = nullptr; /** data */ + size_t arg2 = 0; /** len */ + + olua_to_object(L, 1, &self, "olua.long"); + olua_check_string(L, 2, &arg1); + olua_check_integer(L, 3, &arg2); + + // void assign(const char *data, size_t len) + self->assign(arg1, arg2); + + olua_endinvoke(L); + + return 0; +} + static int _olua_long_create$1(lua_State *L) { olua_startinvoke(L); @@ -4587,23 +5452,72 @@ static int _olua_long_create(lua_State *L) return 0; } -static int _olua_long_setstring(lua_State *L) +static int _olua_long_slice$1(lua_State *L) { olua_startinvoke(L); olua_long *self = nullptr; - const char *arg1 = nullptr; /** data */ - size_t arg2 = 0; /** len */ + size_t arg1 = 0; /** from */ + size_t arg2 = 0; /** to */ olua_to_object(L, 1, &self, "olua.long"); - olua_check_string(L, 2, &arg1); + olua_check_integer(L, 2, &arg1); olua_check_integer(L, 3, &arg2); - // void setstring(const char *data, size_t len) - self->setstring(arg1, arg2); + // @postnew olua_long *slice(size_t from, @optional size_t to) + olua_long *ret = self->slice(arg1, arg2); + int num_ret = olua_push_object(L, ret, "olua.long"); + + // insert code after call + olua_postnew(L, ret); + + olua_endinvoke(L); + + return num_ret; +} + +static int _olua_long_slice$2(lua_State *L) +{ + olua_startinvoke(L); + + olua_long *self = nullptr; + size_t arg1 = 0; /** from */ + + olua_to_object(L, 1, &self, "olua.long"); + olua_check_integer(L, 2, &arg1); + + // @postnew olua_long *slice(size_t from, @optional size_t to) + olua_long *ret = self->slice(arg1); + int num_ret = olua_push_object(L, ret, "olua.long"); + + // insert code after call + olua_postnew(L, ret); olua_endinvoke(L); + return num_ret; +} + +static int _olua_long_slice(lua_State *L) +{ + int num_args = lua_gettop(L) - 1; + + if (num_args == 1) { + // if ((olua_is_integer(L, 2))) { + // @postnew olua_long *slice(size_t from, @optional size_t to) + return _olua_long_slice$2(L); + // } + } + + if (num_args == 2) { + // if ((olua_is_integer(L, 2)) && (olua_is_integer(L, 3))) { + // @postnew olua_long *slice(size_t from, @optional size_t to) + return _olua_long_slice$1(L); + // } + } + + luaL_error(L, "method 'olua_long::slice' not support '%d' arguments", num_args); + return 0; } @@ -4711,23 +5625,6 @@ static int _olua_long_tostring(lua_State *L) return (int)ret; } -static int _olua_long_data(lua_State *L) -{ - olua_startinvoke(L); - - olua_long *self = nullptr; - - olua_to_object(L, 1, &self, "olua.long"); - - // @getter @name(data) olua_long_t *data() - olua_long_t *ret = self->data(); - int num_ret = olua_push_array(L, ret, "olua.long"); - - olua_endinvoke(L); - - return num_ret; -} - static int _olua_long_length(lua_State *L) { olua_startinvoke(L); @@ -4804,12 +5701,12 @@ OLUA_LIB int luaopen_olua_long(lua_State *L) oluacls_func(L, "__index", _olua_long___index); oluacls_func(L, "__newindex", _olua_long___newindex); oluacls_func(L, "__olua_move", _olua_long___olua_move); + oluacls_func(L, "assign", _olua_long_assign); oluacls_func(L, "new", _olua_long_create); - oluacls_func(L, "setstring", _olua_long_setstring); + oluacls_func(L, "slice", _olua_long_slice); oluacls_func(L, "sub", _olua_long_sub); oluacls_func(L, "take", _olua_long_take); oluacls_func(L, "tostring", _olua_long_tostring); - oluacls_prop(L, "data", _olua_long_data, nullptr); oluacls_prop(L, "length", _olua_long_length, _olua_long_length); oluacls_prop(L, "rawdata", _olua_long_rawdata, nullptr); oluacls_prop(L, "sizeof", _olua_long_size, nullptr); @@ -4886,6 +5783,26 @@ static int _olua_llong___olua_move(lua_State *L) return 1; } +static int _olua_llong_assign(lua_State *L) +{ + olua_startinvoke(L); + + olua_llong *self = nullptr; + const char *arg1 = nullptr; /** data */ + size_t arg2 = 0; /** len */ + + olua_to_object(L, 1, &self, "olua.llong"); + olua_check_string(L, 2, &arg1); + olua_check_integer(L, 3, &arg2); + + // void assign(const char *data, size_t len) + self->assign(arg1, arg2); + + olua_endinvoke(L); + + return 0; +} + static int _olua_llong_create$1(lua_State *L) { olua_startinvoke(L); @@ -4943,23 +5860,72 @@ static int _olua_llong_create(lua_State *L) return 0; } -static int _olua_llong_setstring(lua_State *L) +static int _olua_llong_slice$1(lua_State *L) { olua_startinvoke(L); olua_llong *self = nullptr; - const char *arg1 = nullptr; /** data */ - size_t arg2 = 0; /** len */ + size_t arg1 = 0; /** from */ + size_t arg2 = 0; /** to */ olua_to_object(L, 1, &self, "olua.llong"); - olua_check_string(L, 2, &arg1); + olua_check_integer(L, 2, &arg1); olua_check_integer(L, 3, &arg2); - // void setstring(const char *data, size_t len) - self->setstring(arg1, arg2); + // @postnew olua_llong *slice(size_t from, @optional size_t to) + olua_llong *ret = self->slice(arg1, arg2); + int num_ret = olua_push_object(L, ret, "olua.llong"); + + // insert code after call + olua_postnew(L, ret); + + olua_endinvoke(L); + + return num_ret; +} + +static int _olua_llong_slice$2(lua_State *L) +{ + olua_startinvoke(L); + + olua_llong *self = nullptr; + size_t arg1 = 0; /** from */ + + olua_to_object(L, 1, &self, "olua.llong"); + olua_check_integer(L, 2, &arg1); + + // @postnew olua_llong *slice(size_t from, @optional size_t to) + olua_llong *ret = self->slice(arg1); + int num_ret = olua_push_object(L, ret, "olua.llong"); + + // insert code after call + olua_postnew(L, ret); olua_endinvoke(L); + return num_ret; +} + +static int _olua_llong_slice(lua_State *L) +{ + int num_args = lua_gettop(L) - 1; + + if (num_args == 1) { + // if ((olua_is_integer(L, 2))) { + // @postnew olua_llong *slice(size_t from, @optional size_t to) + return _olua_llong_slice$2(L); + // } + } + + if (num_args == 2) { + // if ((olua_is_integer(L, 2)) && (olua_is_integer(L, 3))) { + // @postnew olua_llong *slice(size_t from, @optional size_t to) + return _olua_llong_slice$1(L); + // } + } + + luaL_error(L, "method 'olua_llong::slice' not support '%d' arguments", num_args); + return 0; } @@ -5067,23 +6033,6 @@ static int _olua_llong_tostring(lua_State *L) return (int)ret; } -static int _olua_llong_data(lua_State *L) -{ - olua_startinvoke(L); - - olua_llong *self = nullptr; - - olua_to_object(L, 1, &self, "olua.llong"); - - // @getter @name(data) olua_llong_t *data() - olua_llong_t *ret = self->data(); - int num_ret = olua_push_array(L, ret, "olua.llong"); - - olua_endinvoke(L); - - return num_ret; -} - static int _olua_llong_length(lua_State *L) { olua_startinvoke(L); @@ -5160,12 +6109,12 @@ OLUA_LIB int luaopen_olua_llong(lua_State *L) oluacls_func(L, "__index", _olua_llong___index); oluacls_func(L, "__newindex", _olua_llong___newindex); oluacls_func(L, "__olua_move", _olua_llong___olua_move); + oluacls_func(L, "assign", _olua_llong_assign); oluacls_func(L, "new", _olua_llong_create); - oluacls_func(L, "setstring", _olua_llong_setstring); + oluacls_func(L, "slice", _olua_llong_slice); oluacls_func(L, "sub", _olua_llong_sub); oluacls_func(L, "take", _olua_llong_take); oluacls_func(L, "tostring", _olua_llong_tostring); - oluacls_prop(L, "data", _olua_llong_data, nullptr); oluacls_prop(L, "length", _olua_llong_length, _olua_llong_length); oluacls_prop(L, "rawdata", _olua_llong_rawdata, nullptr); oluacls_prop(L, "sizeof", _olua_llong_size, nullptr); @@ -5242,6 +6191,26 @@ static int _olua_uchar___olua_move(lua_State *L) return 1; } +static int _olua_uchar_assign(lua_State *L) +{ + olua_startinvoke(L); + + olua_uchar *self = nullptr; + const char *arg1 = nullptr; /** data */ + size_t arg2 = 0; /** len */ + + olua_to_object(L, 1, &self, "olua.uchar"); + olua_check_string(L, 2, &arg1); + olua_check_integer(L, 3, &arg2); + + // void assign(const char *data, size_t len) + self->assign(arg1, arg2); + + olua_endinvoke(L); + + return 0; +} + static int _olua_uchar_create$1(lua_State *L) { olua_startinvoke(L); @@ -5299,22 +6268,71 @@ static int _olua_uchar_create(lua_State *L) return 0; } -static int _olua_uchar_setstring(lua_State *L) +static int _olua_uchar_slice$1(lua_State *L) { olua_startinvoke(L); olua_uchar *self = nullptr; - const char *arg1 = nullptr; /** data */ - size_t arg2 = 0; /** len */ + size_t arg1 = 0; /** from */ + size_t arg2 = 0; /** to */ + + olua_to_object(L, 1, &self, "olua.uchar"); + olua_check_integer(L, 2, &arg1); + olua_check_integer(L, 3, &arg2); + + // @postnew olua_uchar *slice(size_t from, @optional size_t to) + olua_uchar *ret = self->slice(arg1, arg2); + int num_ret = olua_push_object(L, ret, "olua.uchar"); + + // insert code after call + olua_postnew(L, ret); + + olua_endinvoke(L); + + return num_ret; +} + +static int _olua_uchar_slice$2(lua_State *L) +{ + olua_startinvoke(L); + + olua_uchar *self = nullptr; + size_t arg1 = 0; /** from */ + + olua_to_object(L, 1, &self, "olua.uchar"); + olua_check_integer(L, 2, &arg1); + + // @postnew olua_uchar *slice(size_t from, @optional size_t to) + olua_uchar *ret = self->slice(arg1); + int num_ret = olua_push_object(L, ret, "olua.uchar"); + + // insert code after call + olua_postnew(L, ret); + + olua_endinvoke(L); + + return num_ret; +} + +static int _olua_uchar_slice(lua_State *L) +{ + int num_args = lua_gettop(L) - 1; - olua_to_object(L, 1, &self, "olua.uchar"); - olua_check_string(L, 2, &arg1); - olua_check_integer(L, 3, &arg2); + if (num_args == 1) { + // if ((olua_is_integer(L, 2))) { + // @postnew olua_uchar *slice(size_t from, @optional size_t to) + return _olua_uchar_slice$2(L); + // } + } - // void setstring(const char *data, size_t len) - self->setstring(arg1, arg2); + if (num_args == 2) { + // if ((olua_is_integer(L, 2)) && (olua_is_integer(L, 3))) { + // @postnew olua_uchar *slice(size_t from, @optional size_t to) + return _olua_uchar_slice$1(L); + // } + } - olua_endinvoke(L); + luaL_error(L, "method 'olua_uchar::slice' not support '%d' arguments", num_args); return 0; } @@ -5423,23 +6441,6 @@ static int _olua_uchar_tostring(lua_State *L) return (int)ret; } -static int _olua_uchar_data(lua_State *L) -{ - olua_startinvoke(L); - - olua_uchar *self = nullptr; - - olua_to_object(L, 1, &self, "olua.uchar"); - - // @getter @name(data) olua_uchar_t *data() - olua_uchar_t *ret = self->data(); - int num_ret = olua_push_array(L, ret, "olua.uchar"); - - olua_endinvoke(L); - - return num_ret; -} - static int _olua_uchar_length(lua_State *L) { olua_startinvoke(L); @@ -5516,12 +6517,12 @@ OLUA_LIB int luaopen_olua_uchar(lua_State *L) oluacls_func(L, "__index", _olua_uchar___index); oluacls_func(L, "__newindex", _olua_uchar___newindex); oluacls_func(L, "__olua_move", _olua_uchar___olua_move); + oluacls_func(L, "assign", _olua_uchar_assign); oluacls_func(L, "new", _olua_uchar_create); - oluacls_func(L, "setstring", _olua_uchar_setstring); + oluacls_func(L, "slice", _olua_uchar_slice); oluacls_func(L, "sub", _olua_uchar_sub); oluacls_func(L, "take", _olua_uchar_take); oluacls_func(L, "tostring", _olua_uchar_tostring); - oluacls_prop(L, "data", _olua_uchar_data, nullptr); oluacls_prop(L, "length", _olua_uchar_length, _olua_uchar_length); oluacls_prop(L, "rawdata", _olua_uchar_rawdata, nullptr); oluacls_prop(L, "sizeof", _olua_uchar_size, nullptr); @@ -5598,6 +6599,26 @@ static int _olua_ushort___olua_move(lua_State *L) return 1; } +static int _olua_ushort_assign(lua_State *L) +{ + olua_startinvoke(L); + + olua_ushort *self = nullptr; + const char *arg1 = nullptr; /** data */ + size_t arg2 = 0; /** len */ + + olua_to_object(L, 1, &self, "olua.ushort"); + olua_check_string(L, 2, &arg1); + olua_check_integer(L, 3, &arg2); + + // void assign(const char *data, size_t len) + self->assign(arg1, arg2); + + olua_endinvoke(L); + + return 0; +} + static int _olua_ushort_create$1(lua_State *L) { olua_startinvoke(L); @@ -5655,23 +6676,72 @@ static int _olua_ushort_create(lua_State *L) return 0; } -static int _olua_ushort_setstring(lua_State *L) +static int _olua_ushort_slice$1(lua_State *L) { olua_startinvoke(L); olua_ushort *self = nullptr; - const char *arg1 = nullptr; /** data */ - size_t arg2 = 0; /** len */ + size_t arg1 = 0; /** from */ + size_t arg2 = 0; /** to */ olua_to_object(L, 1, &self, "olua.ushort"); - olua_check_string(L, 2, &arg1); + olua_check_integer(L, 2, &arg1); olua_check_integer(L, 3, &arg2); - // void setstring(const char *data, size_t len) - self->setstring(arg1, arg2); + // @postnew olua_ushort *slice(size_t from, @optional size_t to) + olua_ushort *ret = self->slice(arg1, arg2); + int num_ret = olua_push_object(L, ret, "olua.ushort"); + + // insert code after call + olua_postnew(L, ret); + + olua_endinvoke(L); + + return num_ret; +} + +static int _olua_ushort_slice$2(lua_State *L) +{ + olua_startinvoke(L); + + olua_ushort *self = nullptr; + size_t arg1 = 0; /** from */ + + olua_to_object(L, 1, &self, "olua.ushort"); + olua_check_integer(L, 2, &arg1); + + // @postnew olua_ushort *slice(size_t from, @optional size_t to) + olua_ushort *ret = self->slice(arg1); + int num_ret = olua_push_object(L, ret, "olua.ushort"); + + // insert code after call + olua_postnew(L, ret); olua_endinvoke(L); + return num_ret; +} + +static int _olua_ushort_slice(lua_State *L) +{ + int num_args = lua_gettop(L) - 1; + + if (num_args == 1) { + // if ((olua_is_integer(L, 2))) { + // @postnew olua_ushort *slice(size_t from, @optional size_t to) + return _olua_ushort_slice$2(L); + // } + } + + if (num_args == 2) { + // if ((olua_is_integer(L, 2)) && (olua_is_integer(L, 3))) { + // @postnew olua_ushort *slice(size_t from, @optional size_t to) + return _olua_ushort_slice$1(L); + // } + } + + luaL_error(L, "method 'olua_ushort::slice' not support '%d' arguments", num_args); + return 0; } @@ -5779,23 +6849,6 @@ static int _olua_ushort_tostring(lua_State *L) return (int)ret; } -static int _olua_ushort_data(lua_State *L) -{ - olua_startinvoke(L); - - olua_ushort *self = nullptr; - - olua_to_object(L, 1, &self, "olua.ushort"); - - // @getter @name(data) olua_ushort_t *data() - olua_ushort_t *ret = self->data(); - int num_ret = olua_push_array(L, ret, "olua.ushort"); - - olua_endinvoke(L); - - return num_ret; -} - static int _olua_ushort_length(lua_State *L) { olua_startinvoke(L); @@ -5872,12 +6925,12 @@ OLUA_LIB int luaopen_olua_ushort(lua_State *L) oluacls_func(L, "__index", _olua_ushort___index); oluacls_func(L, "__newindex", _olua_ushort___newindex); oluacls_func(L, "__olua_move", _olua_ushort___olua_move); + oluacls_func(L, "assign", _olua_ushort_assign); oluacls_func(L, "new", _olua_ushort_create); - oluacls_func(L, "setstring", _olua_ushort_setstring); + oluacls_func(L, "slice", _olua_ushort_slice); oluacls_func(L, "sub", _olua_ushort_sub); oluacls_func(L, "take", _olua_ushort_take); oluacls_func(L, "tostring", _olua_ushort_tostring); - oluacls_prop(L, "data", _olua_ushort_data, nullptr); oluacls_prop(L, "length", _olua_ushort_length, _olua_ushort_length); oluacls_prop(L, "rawdata", _olua_ushort_rawdata, nullptr); oluacls_prop(L, "sizeof", _olua_ushort_size, nullptr); @@ -5954,6 +7007,26 @@ static int _olua_uint___olua_move(lua_State *L) return 1; } +static int _olua_uint_assign(lua_State *L) +{ + olua_startinvoke(L); + + olua_uint *self = nullptr; + const char *arg1 = nullptr; /** data */ + size_t arg2 = 0; /** len */ + + olua_to_object(L, 1, &self, "olua.uint"); + olua_check_string(L, 2, &arg1); + olua_check_integer(L, 3, &arg2); + + // void assign(const char *data, size_t len) + self->assign(arg1, arg2); + + olua_endinvoke(L); + + return 0; +} + static int _olua_uint_create$1(lua_State *L) { olua_startinvoke(L); @@ -6011,23 +7084,72 @@ static int _olua_uint_create(lua_State *L) return 0; } -static int _olua_uint_setstring(lua_State *L) +static int _olua_uint_slice$1(lua_State *L) { olua_startinvoke(L); olua_uint *self = nullptr; - const char *arg1 = nullptr; /** data */ - size_t arg2 = 0; /** len */ + size_t arg1 = 0; /** from */ + size_t arg2 = 0; /** to */ olua_to_object(L, 1, &self, "olua.uint"); - olua_check_string(L, 2, &arg1); + olua_check_integer(L, 2, &arg1); olua_check_integer(L, 3, &arg2); - // void setstring(const char *data, size_t len) - self->setstring(arg1, arg2); + // @postnew olua_uint *slice(size_t from, @optional size_t to) + olua_uint *ret = self->slice(arg1, arg2); + int num_ret = olua_push_object(L, ret, "olua.uint"); + + // insert code after call + olua_postnew(L, ret); + + olua_endinvoke(L); + + return num_ret; +} + +static int _olua_uint_slice$2(lua_State *L) +{ + olua_startinvoke(L); + + olua_uint *self = nullptr; + size_t arg1 = 0; /** from */ + + olua_to_object(L, 1, &self, "olua.uint"); + olua_check_integer(L, 2, &arg1); + + // @postnew olua_uint *slice(size_t from, @optional size_t to) + olua_uint *ret = self->slice(arg1); + int num_ret = olua_push_object(L, ret, "olua.uint"); + + // insert code after call + olua_postnew(L, ret); olua_endinvoke(L); + return num_ret; +} + +static int _olua_uint_slice(lua_State *L) +{ + int num_args = lua_gettop(L) - 1; + + if (num_args == 1) { + // if ((olua_is_integer(L, 2))) { + // @postnew olua_uint *slice(size_t from, @optional size_t to) + return _olua_uint_slice$2(L); + // } + } + + if (num_args == 2) { + // if ((olua_is_integer(L, 2)) && (olua_is_integer(L, 3))) { + // @postnew olua_uint *slice(size_t from, @optional size_t to) + return _olua_uint_slice$1(L); + // } + } + + luaL_error(L, "method 'olua_uint::slice' not support '%d' arguments", num_args); + return 0; } @@ -6135,23 +7257,6 @@ static int _olua_uint_tostring(lua_State *L) return (int)ret; } -static int _olua_uint_data(lua_State *L) -{ - olua_startinvoke(L); - - olua_uint *self = nullptr; - - olua_to_object(L, 1, &self, "olua.uint"); - - // @getter @name(data) olua_uint_t *data() - olua_uint_t *ret = self->data(); - int num_ret = olua_push_array(L, ret, "olua.uint"); - - olua_endinvoke(L); - - return num_ret; -} - static int _olua_uint_length(lua_State *L) { olua_startinvoke(L); @@ -6228,12 +7333,12 @@ OLUA_LIB int luaopen_olua_uint(lua_State *L) oluacls_func(L, "__index", _olua_uint___index); oluacls_func(L, "__newindex", _olua_uint___newindex); oluacls_func(L, "__olua_move", _olua_uint___olua_move); + oluacls_func(L, "assign", _olua_uint_assign); oluacls_func(L, "new", _olua_uint_create); - oluacls_func(L, "setstring", _olua_uint_setstring); + oluacls_func(L, "slice", _olua_uint_slice); oluacls_func(L, "sub", _olua_uint_sub); oluacls_func(L, "take", _olua_uint_take); oluacls_func(L, "tostring", _olua_uint_tostring); - oluacls_prop(L, "data", _olua_uint_data, nullptr); oluacls_prop(L, "length", _olua_uint_length, _olua_uint_length); oluacls_prop(L, "rawdata", _olua_uint_rawdata, nullptr); oluacls_prop(L, "sizeof", _olua_uint_size, nullptr); @@ -6310,6 +7415,26 @@ static int _olua_ulong___olua_move(lua_State *L) return 1; } +static int _olua_ulong_assign(lua_State *L) +{ + olua_startinvoke(L); + + olua_ulong *self = nullptr; + const char *arg1 = nullptr; /** data */ + size_t arg2 = 0; /** len */ + + olua_to_object(L, 1, &self, "olua.ulong"); + olua_check_string(L, 2, &arg1); + olua_check_integer(L, 3, &arg2); + + // void assign(const char *data, size_t len) + self->assign(arg1, arg2); + + olua_endinvoke(L); + + return 0; +} + static int _olua_ulong_create$1(lua_State *L) { olua_startinvoke(L); @@ -6334,8 +7459,75 @@ static int _olua_ulong_create$2(lua_State *L) { olua_startinvoke(L); - // @postnew @name(new) static olua_ulong *create(@optional size_t len) - olua_ulong *ret = olua_ulong::create(); + // @postnew @name(new) static olua_ulong *create(@optional size_t len) + olua_ulong *ret = olua_ulong::create(); + int num_ret = olua_push_object(L, ret, "olua.ulong"); + + // insert code after call + olua_postnew(L, ret); + + olua_endinvoke(L); + + return num_ret; +} + +static int _olua_ulong_create(lua_State *L) +{ + int num_args = lua_gettop(L); + + if (num_args == 0) { + // @postnew @name(new) static olua_ulong *create(@optional size_t len) + return _olua_ulong_create$2(L); + } + + if (num_args == 1) { + // if ((olua_is_integer(L, 1))) { + // @postnew @name(new) static olua_ulong *create(@optional size_t len) + return _olua_ulong_create$1(L); + // } + } + + luaL_error(L, "method 'olua_ulong::create' not support '%d' arguments", num_args); + + return 0; +} + +static int _olua_ulong_slice$1(lua_State *L) +{ + olua_startinvoke(L); + + olua_ulong *self = nullptr; + size_t arg1 = 0; /** from */ + size_t arg2 = 0; /** to */ + + olua_to_object(L, 1, &self, "olua.ulong"); + olua_check_integer(L, 2, &arg1); + olua_check_integer(L, 3, &arg2); + + // @postnew olua_ulong *slice(size_t from, @optional size_t to) + olua_ulong *ret = self->slice(arg1, arg2); + int num_ret = olua_push_object(L, ret, "olua.ulong"); + + // insert code after call + olua_postnew(L, ret); + + olua_endinvoke(L); + + return num_ret; +} + +static int _olua_ulong_slice$2(lua_State *L) +{ + olua_startinvoke(L); + + olua_ulong *self = nullptr; + size_t arg1 = 0; /** from */ + + olua_to_object(L, 1, &self, "olua.ulong"); + olua_check_integer(L, 2, &arg1); + + // @postnew olua_ulong *slice(size_t from, @optional size_t to) + olua_ulong *ret = self->slice(arg1); int num_ret = olua_push_object(L, ret, "olua.ulong"); // insert code after call @@ -6346,43 +7538,25 @@ static int _olua_ulong_create$2(lua_State *L) return num_ret; } -static int _olua_ulong_create(lua_State *L) +static int _olua_ulong_slice(lua_State *L) { - int num_args = lua_gettop(L); - - if (num_args == 0) { - // @postnew @name(new) static olua_ulong *create(@optional size_t len) - return _olua_ulong_create$2(L); - } + int num_args = lua_gettop(L) - 1; if (num_args == 1) { - // if ((olua_is_integer(L, 1))) { - // @postnew @name(new) static olua_ulong *create(@optional size_t len) - return _olua_ulong_create$1(L); + // if ((olua_is_integer(L, 2))) { + // @postnew olua_ulong *slice(size_t from, @optional size_t to) + return _olua_ulong_slice$2(L); // } } - luaL_error(L, "method 'olua_ulong::create' not support '%d' arguments", num_args); - - return 0; -} - -static int _olua_ulong_setstring(lua_State *L) -{ - olua_startinvoke(L); - - olua_ulong *self = nullptr; - const char *arg1 = nullptr; /** data */ - size_t arg2 = 0; /** len */ - - olua_to_object(L, 1, &self, "olua.ulong"); - olua_check_string(L, 2, &arg1); - olua_check_integer(L, 3, &arg2); - - // void setstring(const char *data, size_t len) - self->setstring(arg1, arg2); + if (num_args == 2) { + // if ((olua_is_integer(L, 2)) && (olua_is_integer(L, 3))) { + // @postnew olua_ulong *slice(size_t from, @optional size_t to) + return _olua_ulong_slice$1(L); + // } + } - olua_endinvoke(L); + luaL_error(L, "method 'olua_ulong::slice' not support '%d' arguments", num_args); return 0; } @@ -6491,23 +7665,6 @@ static int _olua_ulong_tostring(lua_State *L) return (int)ret; } -static int _olua_ulong_data(lua_State *L) -{ - olua_startinvoke(L); - - olua_ulong *self = nullptr; - - olua_to_object(L, 1, &self, "olua.ulong"); - - // @getter @name(data) olua_ulong_t *data() - olua_ulong_t *ret = self->data(); - int num_ret = olua_push_array(L, ret, "olua.ulong"); - - olua_endinvoke(L); - - return num_ret; -} - static int _olua_ulong_length(lua_State *L) { olua_startinvoke(L); @@ -6584,12 +7741,12 @@ OLUA_LIB int luaopen_olua_ulong(lua_State *L) oluacls_func(L, "__index", _olua_ulong___index); oluacls_func(L, "__newindex", _olua_ulong___newindex); oluacls_func(L, "__olua_move", _olua_ulong___olua_move); + oluacls_func(L, "assign", _olua_ulong_assign); oluacls_func(L, "new", _olua_ulong_create); - oluacls_func(L, "setstring", _olua_ulong_setstring); + oluacls_func(L, "slice", _olua_ulong_slice); oluacls_func(L, "sub", _olua_ulong_sub); oluacls_func(L, "take", _olua_ulong_take); oluacls_func(L, "tostring", _olua_ulong_tostring); - oluacls_prop(L, "data", _olua_ulong_data, nullptr); oluacls_prop(L, "length", _olua_ulong_length, _olua_ulong_length); oluacls_prop(L, "rawdata", _olua_ulong_rawdata, nullptr); oluacls_prop(L, "sizeof", _olua_ulong_size, nullptr); @@ -6666,6 +7823,26 @@ static int _olua_ullong___olua_move(lua_State *L) return 1; } +static int _olua_ullong_assign(lua_State *L) +{ + olua_startinvoke(L); + + olua_ullong *self = nullptr; + const char *arg1 = nullptr; /** data */ + size_t arg2 = 0; /** len */ + + olua_to_object(L, 1, &self, "olua.ullong"); + olua_check_string(L, 2, &arg1); + olua_check_integer(L, 3, &arg2); + + // void assign(const char *data, size_t len) + self->assign(arg1, arg2); + + olua_endinvoke(L); + + return 0; +} + static int _olua_ullong_create$1(lua_State *L) { olua_startinvoke(L); @@ -6723,23 +7900,72 @@ static int _olua_ullong_create(lua_State *L) return 0; } -static int _olua_ullong_setstring(lua_State *L) +static int _olua_ullong_slice$1(lua_State *L) { olua_startinvoke(L); olua_ullong *self = nullptr; - const char *arg1 = nullptr; /** data */ - size_t arg2 = 0; /** len */ + size_t arg1 = 0; /** from */ + size_t arg2 = 0; /** to */ olua_to_object(L, 1, &self, "olua.ullong"); - olua_check_string(L, 2, &arg1); + olua_check_integer(L, 2, &arg1); olua_check_integer(L, 3, &arg2); - // void setstring(const char *data, size_t len) - self->setstring(arg1, arg2); + // @postnew olua_ullong *slice(size_t from, @optional size_t to) + olua_ullong *ret = self->slice(arg1, arg2); + int num_ret = olua_push_object(L, ret, "olua.ullong"); + + // insert code after call + olua_postnew(L, ret); + + olua_endinvoke(L); + + return num_ret; +} + +static int _olua_ullong_slice$2(lua_State *L) +{ + olua_startinvoke(L); + + olua_ullong *self = nullptr; + size_t arg1 = 0; /** from */ + + olua_to_object(L, 1, &self, "olua.ullong"); + olua_check_integer(L, 2, &arg1); + + // @postnew olua_ullong *slice(size_t from, @optional size_t to) + olua_ullong *ret = self->slice(arg1); + int num_ret = olua_push_object(L, ret, "olua.ullong"); + + // insert code after call + olua_postnew(L, ret); olua_endinvoke(L); + return num_ret; +} + +static int _olua_ullong_slice(lua_State *L) +{ + int num_args = lua_gettop(L) - 1; + + if (num_args == 1) { + // if ((olua_is_integer(L, 2))) { + // @postnew olua_ullong *slice(size_t from, @optional size_t to) + return _olua_ullong_slice$2(L); + // } + } + + if (num_args == 2) { + // if ((olua_is_integer(L, 2)) && (olua_is_integer(L, 3))) { + // @postnew olua_ullong *slice(size_t from, @optional size_t to) + return _olua_ullong_slice$1(L); + // } + } + + luaL_error(L, "method 'olua_ullong::slice' not support '%d' arguments", num_args); + return 0; } @@ -6847,23 +8073,6 @@ static int _olua_ullong_tostring(lua_State *L) return (int)ret; } -static int _olua_ullong_data(lua_State *L) -{ - olua_startinvoke(L); - - olua_ullong *self = nullptr; - - olua_to_object(L, 1, &self, "olua.ullong"); - - // @getter @name(data) olua_ullong_t *data() - olua_ullong_t *ret = self->data(); - int num_ret = olua_push_array(L, ret, "olua.ullong"); - - olua_endinvoke(L); - - return num_ret; -} - static int _olua_ullong_length(lua_State *L) { olua_startinvoke(L); @@ -6940,12 +8149,12 @@ OLUA_LIB int luaopen_olua_ullong(lua_State *L) oluacls_func(L, "__index", _olua_ullong___index); oluacls_func(L, "__newindex", _olua_ullong___newindex); oluacls_func(L, "__olua_move", _olua_ullong___olua_move); + oluacls_func(L, "assign", _olua_ullong_assign); oluacls_func(L, "new", _olua_ullong_create); - oluacls_func(L, "setstring", _olua_ullong_setstring); + oluacls_func(L, "slice", _olua_ullong_slice); oluacls_func(L, "sub", _olua_ullong_sub); oluacls_func(L, "take", _olua_ullong_take); oluacls_func(L, "tostring", _olua_ullong_tostring); - oluacls_prop(L, "data", _olua_ullong_data, nullptr); oluacls_prop(L, "length", _olua_ullong_length, _olua_ullong_length); oluacls_prop(L, "rawdata", _olua_ullong_rawdata, nullptr); oluacls_prop(L, "sizeof", _olua_ullong_size, nullptr); @@ -7022,6 +8231,26 @@ static int _olua_float___olua_move(lua_State *L) return 1; } +static int _olua_float_assign(lua_State *L) +{ + olua_startinvoke(L); + + olua_float *self = nullptr; + const char *arg1 = nullptr; /** data */ + size_t arg2 = 0; /** len */ + + olua_to_object(L, 1, &self, "olua.float"); + olua_check_string(L, 2, &arg1); + olua_check_integer(L, 3, &arg2); + + // void assign(const char *data, size_t len) + self->assign(arg1, arg2); + + olua_endinvoke(L); + + return 0; +} + static int _olua_float_create$1(lua_State *L) { olua_startinvoke(L); @@ -7079,23 +8308,72 @@ static int _olua_float_create(lua_State *L) return 0; } -static int _olua_float_setstring(lua_State *L) +static int _olua_float_slice$1(lua_State *L) { olua_startinvoke(L); olua_float *self = nullptr; - const char *arg1 = nullptr; /** data */ - size_t arg2 = 0; /** len */ + size_t arg1 = 0; /** from */ + size_t arg2 = 0; /** to */ olua_to_object(L, 1, &self, "olua.float"); - olua_check_string(L, 2, &arg1); + olua_check_integer(L, 2, &arg1); olua_check_integer(L, 3, &arg2); - // void setstring(const char *data, size_t len) - self->setstring(arg1, arg2); + // @postnew olua_float *slice(size_t from, @optional size_t to) + olua_float *ret = self->slice(arg1, arg2); + int num_ret = olua_push_object(L, ret, "olua.float"); + + // insert code after call + olua_postnew(L, ret); + + olua_endinvoke(L); + + return num_ret; +} + +static int _olua_float_slice$2(lua_State *L) +{ + olua_startinvoke(L); + + olua_float *self = nullptr; + size_t arg1 = 0; /** from */ + + olua_to_object(L, 1, &self, "olua.float"); + olua_check_integer(L, 2, &arg1); + + // @postnew olua_float *slice(size_t from, @optional size_t to) + olua_float *ret = self->slice(arg1); + int num_ret = olua_push_object(L, ret, "olua.float"); + + // insert code after call + olua_postnew(L, ret); olua_endinvoke(L); + return num_ret; +} + +static int _olua_float_slice(lua_State *L) +{ + int num_args = lua_gettop(L) - 1; + + if (num_args == 1) { + // if ((olua_is_integer(L, 2))) { + // @postnew olua_float *slice(size_t from, @optional size_t to) + return _olua_float_slice$2(L); + // } + } + + if (num_args == 2) { + // if ((olua_is_integer(L, 2)) && (olua_is_integer(L, 3))) { + // @postnew olua_float *slice(size_t from, @optional size_t to) + return _olua_float_slice$1(L); + // } + } + + luaL_error(L, "method 'olua_float::slice' not support '%d' arguments", num_args); + return 0; } @@ -7203,23 +8481,6 @@ static int _olua_float_tostring(lua_State *L) return (int)ret; } -static int _olua_float_data(lua_State *L) -{ - olua_startinvoke(L); - - olua_float *self = nullptr; - - olua_to_object(L, 1, &self, "olua.float"); - - // @getter @name(data) olua_float_t *data() - olua_float_t *ret = self->data(); - int num_ret = olua_push_array(L, ret, "olua.float"); - - olua_endinvoke(L); - - return num_ret; -} - static int _olua_float_length(lua_State *L) { olua_startinvoke(L); @@ -7296,12 +8557,12 @@ OLUA_LIB int luaopen_olua_float(lua_State *L) oluacls_func(L, "__index", _olua_float___index); oluacls_func(L, "__newindex", _olua_float___newindex); oluacls_func(L, "__olua_move", _olua_float___olua_move); + oluacls_func(L, "assign", _olua_float_assign); oluacls_func(L, "new", _olua_float_create); - oluacls_func(L, "setstring", _olua_float_setstring); + oluacls_func(L, "slice", _olua_float_slice); oluacls_func(L, "sub", _olua_float_sub); oluacls_func(L, "take", _olua_float_take); oluacls_func(L, "tostring", _olua_float_tostring); - oluacls_prop(L, "data", _olua_float_data, nullptr); oluacls_prop(L, "length", _olua_float_length, _olua_float_length); oluacls_prop(L, "rawdata", _olua_float_rawdata, nullptr); oluacls_prop(L, "sizeof", _olua_float_size, nullptr); @@ -7378,6 +8639,26 @@ static int _olua_double___olua_move(lua_State *L) return 1; } +static int _olua_double_assign(lua_State *L) +{ + olua_startinvoke(L); + + olua_double *self = nullptr; + const char *arg1 = nullptr; /** data */ + size_t arg2 = 0; /** len */ + + olua_to_object(L, 1, &self, "olua.double"); + olua_check_string(L, 2, &arg1); + olua_check_integer(L, 3, &arg2); + + // void assign(const char *data, size_t len) + self->assign(arg1, arg2); + + olua_endinvoke(L); + + return 0; +} + static int _olua_double_create$1(lua_State *L) { olua_startinvoke(L); @@ -7435,22 +8716,71 @@ static int _olua_double_create(lua_State *L) return 0; } -static int _olua_double_setstring(lua_State *L) +static int _olua_double_slice$1(lua_State *L) { olua_startinvoke(L); olua_double *self = nullptr; - const char *arg1 = nullptr; /** data */ - size_t arg2 = 0; /** len */ + size_t arg1 = 0; /** from */ + size_t arg2 = 0; /** to */ + + olua_to_object(L, 1, &self, "olua.double"); + olua_check_integer(L, 2, &arg1); + olua_check_integer(L, 3, &arg2); + + // @postnew olua_double *slice(size_t from, @optional size_t to) + olua_double *ret = self->slice(arg1, arg2); + int num_ret = olua_push_object(L, ret, "olua.double"); + + // insert code after call + olua_postnew(L, ret); + + olua_endinvoke(L); + + return num_ret; +} + +static int _olua_double_slice$2(lua_State *L) +{ + olua_startinvoke(L); + + olua_double *self = nullptr; + size_t arg1 = 0; /** from */ + + olua_to_object(L, 1, &self, "olua.double"); + olua_check_integer(L, 2, &arg1); + + // @postnew olua_double *slice(size_t from, @optional size_t to) + olua_double *ret = self->slice(arg1); + int num_ret = olua_push_object(L, ret, "olua.double"); + + // insert code after call + olua_postnew(L, ret); + + olua_endinvoke(L); + + return num_ret; +} - olua_to_object(L, 1, &self, "olua.double"); - olua_check_string(L, 2, &arg1); - olua_check_integer(L, 3, &arg2); +static int _olua_double_slice(lua_State *L) +{ + int num_args = lua_gettop(L) - 1; + + if (num_args == 1) { + // if ((olua_is_integer(L, 2))) { + // @postnew olua_double *slice(size_t from, @optional size_t to) + return _olua_double_slice$2(L); + // } + } - // void setstring(const char *data, size_t len) - self->setstring(arg1, arg2); + if (num_args == 2) { + // if ((olua_is_integer(L, 2)) && (olua_is_integer(L, 3))) { + // @postnew olua_double *slice(size_t from, @optional size_t to) + return _olua_double_slice$1(L); + // } + } - olua_endinvoke(L); + luaL_error(L, "method 'olua_double::slice' not support '%d' arguments", num_args); return 0; } @@ -7559,23 +8889,6 @@ static int _olua_double_tostring(lua_State *L) return (int)ret; } -static int _olua_double_data(lua_State *L) -{ - olua_startinvoke(L); - - olua_double *self = nullptr; - - olua_to_object(L, 1, &self, "olua.double"); - - // @getter @name(data) olua_double_t *data() - olua_double_t *ret = self->data(); - int num_ret = olua_push_array(L, ret, "olua.double"); - - olua_endinvoke(L); - - return num_ret; -} - static int _olua_double_length(lua_State *L) { olua_startinvoke(L); @@ -7652,12 +8965,12 @@ OLUA_LIB int luaopen_olua_double(lua_State *L) oluacls_func(L, "__index", _olua_double___index); oluacls_func(L, "__newindex", _olua_double___newindex); oluacls_func(L, "__olua_move", _olua_double___olua_move); + oluacls_func(L, "assign", _olua_double_assign); oluacls_func(L, "new", _olua_double_create); - oluacls_func(L, "setstring", _olua_double_setstring); + oluacls_func(L, "slice", _olua_double_slice); oluacls_func(L, "sub", _olua_double_sub); oluacls_func(L, "take", _olua_double_take); oluacls_func(L, "tostring", _olua_double_tostring); - oluacls_prop(L, "data", _olua_double_data, nullptr); oluacls_prop(L, "length", _olua_double_length, _olua_double_length); oluacls_prop(L, "rawdata", _olua_double_rawdata, nullptr); oluacls_prop(L, "sizeof", _olua_double_size, nullptr); @@ -7734,6 +9047,26 @@ static int _olua_ldouble___olua_move(lua_State *L) return 1; } +static int _olua_ldouble_assign(lua_State *L) +{ + olua_startinvoke(L); + + olua_ldouble *self = nullptr; + const char *arg1 = nullptr; /** data */ + size_t arg2 = 0; /** len */ + + olua_to_object(L, 1, &self, "olua.ldouble"); + olua_check_string(L, 2, &arg1); + olua_check_integer(L, 3, &arg2); + + // void assign(const char *data, size_t len) + self->assign(arg1, arg2); + + olua_endinvoke(L); + + return 0; +} + static int _olua_ldouble_create$1(lua_State *L) { olua_startinvoke(L); @@ -7791,23 +9124,72 @@ static int _olua_ldouble_create(lua_State *L) return 0; } -static int _olua_ldouble_setstring(lua_State *L) +static int _olua_ldouble_slice$1(lua_State *L) { olua_startinvoke(L); olua_ldouble *self = nullptr; - const char *arg1 = nullptr; /** data */ - size_t arg2 = 0; /** len */ + size_t arg1 = 0; /** from */ + size_t arg2 = 0; /** to */ olua_to_object(L, 1, &self, "olua.ldouble"); - olua_check_string(L, 2, &arg1); + olua_check_integer(L, 2, &arg1); olua_check_integer(L, 3, &arg2); - // void setstring(const char *data, size_t len) - self->setstring(arg1, arg2); + // @postnew olua_ldouble *slice(size_t from, @optional size_t to) + olua_ldouble *ret = self->slice(arg1, arg2); + int num_ret = olua_push_object(L, ret, "olua.ldouble"); + + // insert code after call + olua_postnew(L, ret); + + olua_endinvoke(L); + + return num_ret; +} + +static int _olua_ldouble_slice$2(lua_State *L) +{ + olua_startinvoke(L); + + olua_ldouble *self = nullptr; + size_t arg1 = 0; /** from */ + + olua_to_object(L, 1, &self, "olua.ldouble"); + olua_check_integer(L, 2, &arg1); + + // @postnew olua_ldouble *slice(size_t from, @optional size_t to) + olua_ldouble *ret = self->slice(arg1); + int num_ret = olua_push_object(L, ret, "olua.ldouble"); + + // insert code after call + olua_postnew(L, ret); olua_endinvoke(L); + return num_ret; +} + +static int _olua_ldouble_slice(lua_State *L) +{ + int num_args = lua_gettop(L) - 1; + + if (num_args == 1) { + // if ((olua_is_integer(L, 2))) { + // @postnew olua_ldouble *slice(size_t from, @optional size_t to) + return _olua_ldouble_slice$2(L); + // } + } + + if (num_args == 2) { + // if ((olua_is_integer(L, 2)) && (olua_is_integer(L, 3))) { + // @postnew olua_ldouble *slice(size_t from, @optional size_t to) + return _olua_ldouble_slice$1(L); + // } + } + + luaL_error(L, "method 'olua_ldouble::slice' not support '%d' arguments", num_args); + return 0; } @@ -7915,23 +9297,6 @@ static int _olua_ldouble_tostring(lua_State *L) return (int)ret; } -static int _olua_ldouble_data(lua_State *L) -{ - olua_startinvoke(L); - - olua_ldouble *self = nullptr; - - olua_to_object(L, 1, &self, "olua.ldouble"); - - // @getter @name(data) olua_ldouble_t *data() - olua_ldouble_t *ret = self->data(); - int num_ret = olua_push_array(L, ret, "olua.ldouble"); - - olua_endinvoke(L); - - return num_ret; -} - static int _olua_ldouble_length(lua_State *L) { olua_startinvoke(L); @@ -8008,12 +9373,12 @@ OLUA_LIB int luaopen_olua_ldouble(lua_State *L) oluacls_func(L, "__index", _olua_ldouble___index); oluacls_func(L, "__newindex", _olua_ldouble___newindex); oluacls_func(L, "__olua_move", _olua_ldouble___olua_move); + oluacls_func(L, "assign", _olua_ldouble_assign); oluacls_func(L, "new", _olua_ldouble_create); - oluacls_func(L, "setstring", _olua_ldouble_setstring); + oluacls_func(L, "slice", _olua_ldouble_slice); oluacls_func(L, "sub", _olua_ldouble_sub); oluacls_func(L, "take", _olua_ldouble_take); oluacls_func(L, "tostring", _olua_ldouble_tostring); - oluacls_prop(L, "data", _olua_ldouble_data, nullptr); oluacls_prop(L, "length", _olua_ldouble_length, _olua_ldouble_length); oluacls_prop(L, "rawdata", _olua_ldouble_rawdata, nullptr); oluacls_prop(L, "sizeof", _olua_ldouble_size, nullptr); @@ -8090,6 +9455,26 @@ static int _olua_size_t___olua_move(lua_State *L) return 1; } +static int _olua_size_t_assign(lua_State *L) +{ + olua_startinvoke(L); + + olua_size_t *self = nullptr; + const char *arg1 = nullptr; /** data */ + size_t arg2 = 0; /** len */ + + olua_to_object(L, 1, &self, "olua.size_t"); + olua_check_string(L, 2, &arg1); + olua_check_integer(L, 3, &arg2); + + // void assign(const char *data, size_t len) + self->assign(arg1, arg2); + + olua_endinvoke(L); + + return 0; +} + static int _olua_size_t_create$1(lua_State *L) { olua_startinvoke(L); @@ -8147,23 +9532,72 @@ static int _olua_size_t_create(lua_State *L) return 0; } -static int _olua_size_t_setstring(lua_State *L) +static int _olua_size_t_slice$1(lua_State *L) { olua_startinvoke(L); olua_size_t *self = nullptr; - const char *arg1 = nullptr; /** data */ - size_t arg2 = 0; /** len */ + size_t arg1 = 0; /** from */ + size_t arg2 = 0; /** to */ olua_to_object(L, 1, &self, "olua.size_t"); - olua_check_string(L, 2, &arg1); + olua_check_integer(L, 2, &arg1); olua_check_integer(L, 3, &arg2); - // void setstring(const char *data, size_t len) - self->setstring(arg1, arg2); + // @postnew olua_size_t *slice(size_t from, @optional size_t to) + olua_size_t *ret = self->slice(arg1, arg2); + int num_ret = olua_push_object(L, ret, "olua.size_t"); + + // insert code after call + olua_postnew(L, ret); + + olua_endinvoke(L); + + return num_ret; +} + +static int _olua_size_t_slice$2(lua_State *L) +{ + olua_startinvoke(L); + + olua_size_t *self = nullptr; + size_t arg1 = 0; /** from */ + + olua_to_object(L, 1, &self, "olua.size_t"); + olua_check_integer(L, 2, &arg1); + + // @postnew olua_size_t *slice(size_t from, @optional size_t to) + olua_size_t *ret = self->slice(arg1); + int num_ret = olua_push_object(L, ret, "olua.size_t"); + + // insert code after call + olua_postnew(L, ret); olua_endinvoke(L); + return num_ret; +} + +static int _olua_size_t_slice(lua_State *L) +{ + int num_args = lua_gettop(L) - 1; + + if (num_args == 1) { + // if ((olua_is_integer(L, 2))) { + // @postnew olua_size_t *slice(size_t from, @optional size_t to) + return _olua_size_t_slice$2(L); + // } + } + + if (num_args == 2) { + // if ((olua_is_integer(L, 2)) && (olua_is_integer(L, 3))) { + // @postnew olua_size_t *slice(size_t from, @optional size_t to) + return _olua_size_t_slice$1(L); + // } + } + + luaL_error(L, "method 'olua_size_t::slice' not support '%d' arguments", num_args); + return 0; } @@ -8271,23 +9705,6 @@ static int _olua_size_t_tostring(lua_State *L) return (int)ret; } -static int _olua_size_t_data(lua_State *L) -{ - olua_startinvoke(L); - - olua_size_t *self = nullptr; - - olua_to_object(L, 1, &self, "olua.size_t"); - - // @getter @name(data) size_t *data() - size_t *ret = self->data(); - int num_ret = olua_push_array(L, ret, "olua.size_t"); - - olua_endinvoke(L); - - return num_ret; -} - static int _olua_size_t_length(lua_State *L) { olua_startinvoke(L); @@ -8364,12 +9781,12 @@ OLUA_LIB int luaopen_olua_size_t(lua_State *L) oluacls_func(L, "__index", _olua_size_t___index); oluacls_func(L, "__newindex", _olua_size_t___newindex); oluacls_func(L, "__olua_move", _olua_size_t___olua_move); + oluacls_func(L, "assign", _olua_size_t_assign); oluacls_func(L, "new", _olua_size_t_create); - oluacls_func(L, "setstring", _olua_size_t_setstring); + oluacls_func(L, "slice", _olua_size_t_slice); oluacls_func(L, "sub", _olua_size_t_sub); oluacls_func(L, "take", _olua_size_t_take); oluacls_func(L, "tostring", _olua_size_t_tostring); - oluacls_prop(L, "data", _olua_size_t_data, nullptr); oluacls_prop(L, "length", _olua_size_t_length, _olua_size_t_length); oluacls_prop(L, "rawdata", _olua_size_t_rawdata, nullptr); oluacls_prop(L, "sizeof", _olua_size_t_size, nullptr); @@ -8446,6 +9863,26 @@ static int _olua_ssize_t___olua_move(lua_State *L) return 1; } +static int _olua_ssize_t_assign(lua_State *L) +{ + olua_startinvoke(L); + + olua_ssize_t *self = nullptr; + const char *arg1 = nullptr; /** data */ + size_t arg2 = 0; /** len */ + + olua_to_object(L, 1, &self, "olua.ssize_t"); + olua_check_string(L, 2, &arg1); + olua_check_integer(L, 3, &arg2); + + // void assign(const char *data, size_t len) + self->assign(arg1, arg2); + + olua_endinvoke(L); + + return 0; +} + static int _olua_ssize_t_create$1(lua_State *L) { olua_startinvoke(L); @@ -8503,23 +9940,72 @@ static int _olua_ssize_t_create(lua_State *L) return 0; } -static int _olua_ssize_t_setstring(lua_State *L) +static int _olua_ssize_t_slice$1(lua_State *L) { olua_startinvoke(L); olua_ssize_t *self = nullptr; - const char *arg1 = nullptr; /** data */ - size_t arg2 = 0; /** len */ + size_t arg1 = 0; /** from */ + size_t arg2 = 0; /** to */ olua_to_object(L, 1, &self, "olua.ssize_t"); - olua_check_string(L, 2, &arg1); + olua_check_integer(L, 2, &arg1); olua_check_integer(L, 3, &arg2); - // void setstring(const char *data, size_t len) - self->setstring(arg1, arg2); + // @postnew olua_ssize_t *slice(size_t from, @optional size_t to) + olua_ssize_t *ret = self->slice(arg1, arg2); + int num_ret = olua_push_object(L, ret, "olua.ssize_t"); + + // insert code after call + olua_postnew(L, ret); + + olua_endinvoke(L); + + return num_ret; +} + +static int _olua_ssize_t_slice$2(lua_State *L) +{ + olua_startinvoke(L); + + olua_ssize_t *self = nullptr; + size_t arg1 = 0; /** from */ + + olua_to_object(L, 1, &self, "olua.ssize_t"); + olua_check_integer(L, 2, &arg1); + + // @postnew olua_ssize_t *slice(size_t from, @optional size_t to) + olua_ssize_t *ret = self->slice(arg1); + int num_ret = olua_push_object(L, ret, "olua.ssize_t"); + + // insert code after call + olua_postnew(L, ret); olua_endinvoke(L); + return num_ret; +} + +static int _olua_ssize_t_slice(lua_State *L) +{ + int num_args = lua_gettop(L) - 1; + + if (num_args == 1) { + // if ((olua_is_integer(L, 2))) { + // @postnew olua_ssize_t *slice(size_t from, @optional size_t to) + return _olua_ssize_t_slice$2(L); + // } + } + + if (num_args == 2) { + // if ((olua_is_integer(L, 2)) && (olua_is_integer(L, 3))) { + // @postnew olua_ssize_t *slice(size_t from, @optional size_t to) + return _olua_ssize_t_slice$1(L); + // } + } + + luaL_error(L, "method 'olua_ssize_t::slice' not support '%d' arguments", num_args); + return 0; } @@ -8627,23 +10113,6 @@ static int _olua_ssize_t_tostring(lua_State *L) return (int)ret; } -static int _olua_ssize_t_data(lua_State *L) -{ - olua_startinvoke(L); - - olua_ssize_t *self = nullptr; - - olua_to_object(L, 1, &self, "olua.ssize_t"); - - // @getter @name(data) ssize_t *data() - ssize_t *ret = self->data(); - int num_ret = olua_push_array(L, ret, "olua.ssize_t"); - - olua_endinvoke(L); - - return num_ret; -} - static int _olua_ssize_t_length(lua_State *L) { olua_startinvoke(L); @@ -8720,12 +10189,12 @@ OLUA_LIB int luaopen_olua_ssize_t(lua_State *L) oluacls_func(L, "__index", _olua_ssize_t___index); oluacls_func(L, "__newindex", _olua_ssize_t___newindex); oluacls_func(L, "__olua_move", _olua_ssize_t___olua_move); + oluacls_func(L, "assign", _olua_ssize_t_assign); oluacls_func(L, "new", _olua_ssize_t_create); - oluacls_func(L, "setstring", _olua_ssize_t_setstring); + oluacls_func(L, "slice", _olua_ssize_t_slice); oluacls_func(L, "sub", _olua_ssize_t_sub); oluacls_func(L, "take", _olua_ssize_t_take); oluacls_func(L, "tostring", _olua_ssize_t_tostring); - oluacls_prop(L, "data", _olua_ssize_t_data, nullptr); oluacls_prop(L, "length", _olua_ssize_t_length, _olua_ssize_t_length); oluacls_prop(L, "rawdata", _olua_ssize_t_rawdata, nullptr); oluacls_prop(L, "sizeof", _olua_ssize_t_size, nullptr); diff --git a/frameworks/cclua/src/olua/olua.c b/frameworks/cclua/src/olua/olua.c index 1588d819..744e63d6 100644 --- a/frameworks/cclua/src/olua/olua.c +++ b/frameworks/cclua/src/olua/olua.c @@ -280,9 +280,11 @@ static void olua_pushobjtable(lua_State *L) OLUA_API void *olua_newobjstub(lua_State *L, const char *cls) { void *ptr; + olua_VMEnv *env = olua_getvmenv(L); olua_pushobjtable(L); olua_newrawobj(L, NULL, 0); // create obj stub ptr = (void *)lua_topointer(L, -1); + env->objcount++; lua_pushvalue(L, -1); olua_rawsetp(L, -3, ptr); // objtable[ptr] = stub lua_replace(L, -2); // pop objtable @@ -459,7 +461,7 @@ OLUA_API void olua_setobjflag(lua_State *L, int idx, int flag) OLUA_API bool olua_hasobjflag(lua_State *L, int idx, int flag) { olua_Object *luaobj = olua_toluaobj(L, idx); - return luaobj->flags & flag; + return (luaobj->flags & flag) == flag; } static void *aux_toobj(lua_State *L, int idx, const char *cls, bool checked) diff --git a/frameworks/cclua/src/olua/olua.hpp b/frameworks/cclua/src/olua/olua.hpp index 723eb314..b36d7bb6 100644 --- a/frameworks/cclua/src/olua/olua.hpp +++ b/frameworks/cclua/src/olua/olua.hpp @@ -1,7 +1,7 @@ /** * The MIT License (MIT) * - * Copyright (c) 2019-2022 codetypes@gmail.com + * Copyright (c) 2019-2023 codetypes@gmail.com * * https://github.com/zhongfq/olua * @@ -167,7 +167,7 @@ void olua_postpush(lua_State *L, T* obj, int status) {} * if (std::is_base_of::value) { * ((Object *)obj)->autorelease(); * } else if (olua_getrawobj(L, obj)) { - * olua_setownership(L, -1, OLUA_OWNERSHIP_VM); + * olua_setobjflag(L, -1, OLUA_FLAG_IN_HEAP); * lua_pop(L, 1); * } * } @@ -180,7 +180,7 @@ template void olua_postnew(lua_State *L, T *obj) { if (olua_getrawobj(L, obj)) { - olua_setownership(L, -1, OLUA_OWNERSHIP_VM); + olua_setobjflag(L, -1, OLUA_FLAG_IN_HEAP); lua_pop(L, 1); } } @@ -626,8 +626,12 @@ template class SmartPtr, class T> int olua_smartptr_gc(lua_State *L) { SmartPtr *obj = olua_checkobj>(L, 1); + if (olua_hasobjflag(L, -1, OLUA_FLAG_IN_USERDATA)) { + obj->~SmartPtr(); + } else { + delete obj; + } olua_setrawobj(L, 1, nullptr); - delete obj; return 0; } @@ -688,7 +692,11 @@ int olua_push_object(lua_State *L, const std::shared_ptr *value, const char * olua_setobjflag(L, -2, OLUA_FLAG_SKIP_GC); // skip gc, managed by smart ptr olua_setobjflag(L, -2, OLUA_FLAG_IN_SMARTPRT); - olua_pushobj>(L, new std::shared_ptr(*value)); + + void *ptr = olua_newrawobj(L, nullptr, sizeof(*value)); + std::shared_ptr *obj = new (ptr) std::shared_ptr(*value); + olua_pushobj>(L, obj); + olua_setobjflag(L, -1, OLUA_FLAG_IN_USERDATA); olua_addref(L, -3, OLUA_SMART_PRT, -1, OLUA_REF_ALONE); lua_pop(L, 2); // pop nil and smartptr return 1; @@ -707,7 +715,7 @@ template int olua_push_object(lua_State *L, const std::weak_ptr *value, const char *cls) { std::shared_ptr sp = value->lock(); - return olua_push_obj(L, &sp, cls); + return olua_push_object(L, &sp, cls); } // map @@ -759,19 +767,19 @@ void olua_check_map(lua_State *L, int idx, Map &map, const std::fun // array template -void olua_insert_vector(std::vector &array, const T &value) +void olua_insert_array(std::vector &array, const T &value) { array.push_back(value); } template -void olua_insert_vector(std::set &array, const T &value) +void olua_insert_array(std::set &array, const T &value) { array.insert(value); } template class Vector, class ...Ts> -void olua_foreach_vector(const Vector &array, const std::function &callback) +void olua_foreach_array(const Vector &array, const std::function &callback) { for (auto &itor : array) { callback(const_cast(itor)); @@ -779,7 +787,7 @@ void olua_foreach_vector(const Vector &array, const std::function inline -void olua_foreach_vector(const std::vector &array, const std::function &callback) +void olua_foreach_array(const std::vector &array, const std::function &callback) { for (auto itor : array) { bool v = itor; @@ -788,17 +796,17 @@ void olua_foreach_vector(const std::vector &array, const std::functi } static inline -bool olua_is_vector(lua_State *L, int idx) +bool olua_is_array(lua_State *L, int idx) { return olua_istable(L, idx); } template class Vector, class ...Ts> -int olua_push_vector(lua_State *L, const Vector &array, const std::function &push) +int olua_push_array(lua_State *L, const Vector &array, const std::function &push) { int idx = 0; lua_newtable(L); - olua_foreach_vector(array, [=](T &value) mutable { + olua_foreach_array(array, [=](T &value) mutable { push(value); lua_rawseti(L, -2, ++idx); }); @@ -806,7 +814,7 @@ int olua_push_vector(lua_State *L, const Vector &array, const std::fun } template class Vector, class ...Ts> -void olua_check_vector(lua_State *L, int idx, Vector &array, const std::function &check) +void olua_check_array(lua_State *L, int idx, Vector &array, const std::function &check) { idx = lua_absindex(L, idx); luaL_checktype(L, idx, LUA_TTABLE); @@ -815,13 +823,13 @@ void olua_check_vector(lua_State *L, int idx, Vector &array, const std T obj; lua_rawgeti(L, idx, i); check(&obj); - olua_insert_vector(array, obj); + olua_insert_array(array, obj); lua_pop(L, 1); } } template class Vector, class ...Ts> -void olua_pack_vector(lua_State *L, int idx, Vector &array, const std::function &check) +void olua_pack_array(lua_State *L, int idx, Vector &array, const std::function &check) { idx = lua_absindex(L, idx); int total = (int)(lua_gettop(L) - (idx - 1)); @@ -829,7 +837,7 @@ void olua_pack_vector(lua_State *L, int idx, Vector &array, const std: T obj; lua_pushvalue(L, idx + i); check(&obj); - olua_insert_vector(array, obj); + olua_insert_array(array, obj); lua_pop(L, 1); } } @@ -861,28 +869,28 @@ typedef SSIZE_T ssize_t; namespace olua { template -class array { +class pointer { public: - array(const array &) = delete; - array &operator=(const array &) = delete; + pointer(const pointer &) = delete; + pointer &operator=(const pointer &) = delete; - array() {} - ~array() + pointer() {} + ~pointer() { if (_owner) { delete[] _data; } } - array(T *v) + pointer(T *v) :_len(0) ,_owner(false) ,_data(v) {} - - OLUA_POSTNEW OLUA_NAME(new) static array *create(size_t len = 1) + + OLUA_POSTNEW OLUA_NAME(new) static pointer *create(size_t len = 1) { - array *ret = new array(); + pointer *ret = new pointer(); ret->_len = len; ret->_data = new T[len](); return ret; @@ -890,8 +898,8 @@ class array { T __index(unsigned idx) { - olua_assert(idx >= 1 && idx <= _len, "index out of range"); - return _data[idx - 1]; + olua_assert(idx >= 1 && idx <= _len, "index out of range"); + return _data[idx - 1]; } void __newindex(unsigned idx, const T &v) @@ -899,48 +907,64 @@ class array { olua_assert(idx >= 1 && idx <= _len, "newindex out of range"); _data[idx - 1] = v; } - + olua_Return __gc(lua_State *L) { - olua_postgc>(L, this); + pointer *self = (pointer *)olua_toobj(L, 1, OLUA_VOIDCLS); + if (self) { + olua_setrawobj(L, 1, nullptr); + delete self; + } return 0; } - + olua_Return tostring(lua_State *L, size_t len) { olua_assert(_len > 0 && len <= _len, "invalid length"); lua_pushlstring(L, (const char*)_data, len * sizeof(T)); return 1; } - - void setstring(const char *data, size_t len) + + void assign(const char *data, size_t len) { olua_assert(sizeof(T) == sizeof(char), "expect char type"); olua_assert(len <= _len, "data too long"); strncpy((char *)_data, data, len); } - - array *take() + + pointer *take() { + olua_assert(_owner, "take only allow when owner is true "); _owner = false; return this; } - - OLUA_POSTNEW array *sub(size_t from, size_t to = -1) + + OLUA_POSTNEW pointer *sub(size_t from, size_t to = -1) { if (to == -1) { to = _len; } olua_assert(from <= _len && from <= to, "invalid 'from' position"); olua_assert(to <= _len, "invalid 'to' position"); - array *ret = create(to - from + 1); + pointer *ret = create(to - from + 1); for (size_t i = 0; i < ret->_len; i++) { ret->_data[i] = _data[from + i - 1]; } return ret; } - OLUA_GETTER OLUA_NAME(data) T *data() {return _data;} + OLUA_POSTNEW pointer *slice(size_t from, size_t to = -1) + { + if (to == -1) { + to = _len; + } + pointer *ret = new pointer(&_data[from - 1]); + ret->_len = to - from + 1; + ret->_owner = false; + return ret; + } + + OLUA_EXCLUDE T *data() {return _data;} OLUA_GETTER OLUA_NAME(rawdata) void *rawdata() {return _data;} OLUA_GETTER OLUA_NAME(sizeof) size_t size() {return sizeof(T);} OLUA_GETTER OLUA_NAME(value) const T &value() {return *_data;} @@ -956,63 +980,6 @@ class array { size_t _len = 0; bool _owner = true; }; - -template -class pointer { -public: - pointer(const pointer &) = delete; - pointer &operator=(const pointer &) = delete; - - pointer() {} - - pointer(T *v) - :_owner(false) - ,_data(v) - {} - - ~pointer() - { - if (_owner) { - delete _data; - } - } - - OLUA_POSTNEW OLUA_NAME(new) static pointer *create() - { - pointer *ret = new pointer(); - ret->_owner = true; - ret->_data = new T(); - return ret; - } - - OLUA_POSTNEW OLUA_NAME(new) static pointer *create(const T &v) - { - pointer *ret = create(); - *ret->_data = v; - return ret; - } - - olua_Return __gc(lua_State *L) - { - olua_postgc>(L, this); - return 0; - } - - pointer *take() - { - _owner = false; - return this; - } - - OLUA_GETTER OLUA_NAME(data) T *data() {return _data;} - OLUA_GETTER OLUA_NAME(rawdata) void *rawdata() {return _data;} - OLUA_GETTER OLUA_NAME(sizeof) size_t size() {return sizeof(T);} - OLUA_GETTER OLUA_NAME(value) const T &value() {return *_data;} - OLUA_SETTER OLUA_NAME(value) void value(const T &v) {*_data = v;} -private: - T *_data = nullptr; - bool _owner = true; -}; } typedef char olua_char_t; @@ -1029,80 +996,32 @@ typedef float olua_float_t; typedef double olua_double_t; typedef long double olua_ldouble_t; -typedef olua::array olua_bool; -typedef olua::array olua_int8_t; -typedef olua::array olua_uint8_t; -typedef olua::array olua_int16_t; -typedef olua::array olua_uint16_t; -typedef olua::array olua_int32_t; -typedef olua::array olua_uint32_t; -typedef olua::array olua_int64_t; -typedef olua::array olua_uint64_t; -typedef olua::array olua_char; -typedef olua::array olua_short; -typedef olua::array olua_int; -typedef olua::array olua_long; -typedef olua::array olua_llong; -typedef olua::array olua_uchar; -typedef olua::array olua_ushort; -typedef olua::array olua_uint; -typedef olua::array olua_ulong; -typedef olua::array olua_ullong; -typedef olua::array olua_float; -typedef olua::array olua_double; -typedef olua::array olua_ldouble; -typedef olua::array olua_size_t; -typedef olua::array olua_ssize_t; +typedef olua::pointer olua_bool; +typedef olua::pointer olua_int8_t; +typedef olua::pointer olua_uint8_t; +typedef olua::pointer olua_int16_t; +typedef olua::pointer olua_uint16_t; +typedef olua::pointer olua_int32_t; +typedef olua::pointer olua_uint32_t; +typedef olua::pointer olua_int64_t; +typedef olua::pointer olua_uint64_t; +typedef olua::pointer olua_char; +typedef olua::pointer olua_short; +typedef olua::pointer olua_int; +typedef olua::pointer olua_long; +typedef olua::pointer olua_llong; +typedef olua::pointer olua_uchar; +typedef olua::pointer olua_ushort; +typedef olua::pointer olua_uint; +typedef olua::pointer olua_ulong; +typedef olua::pointer olua_ullong; +typedef olua::pointer olua_float; +typedef olua::pointer olua_double; +typedef olua::pointer olua_ldouble; +typedef olua::pointer olua_size_t; +typedef olua::pointer olua_ssize_t; typedef olua::pointer olua_string; -template inline -int olua_pushobj(lua_State *L, const olua::array *value, const char *cls) -{ - olua_postpush(L, (olua::array *)value, olua_pushobj(L, (void *)value, cls)); - return 1; -} - -template inline -int olua_pushobj(lua_State *L, const olua::array *value) -{ - static_assert(sizeof(T) == 0, "push olua::array object must specify the lua class"); - return 0; -} - -template inline -int olua_push_object(lua_State *L, const olua::array *value, const char *cls) -{ - return olua_pushobj(L, value, cls); -} - -// array -static inline -int olua_is_array(lua_State *L, int idx, const char *cls) -{ - return olua_isa(L, idx, cls); -} - -template inline -void olua_check_array(lua_State *L, int idx, T **value, const char *cls) -{ - olua::array *obj = (olua::array *)olua_checkobj(L, idx, cls); - *value = obj->data(); -} - -template -int olua_push_array(lua_State *L, T *value, const char *cls) -{ - if (value) { - olua::array *obj = new olua::array(value); - olua_pushobj>(L, obj, cls); - olua_postnew(L, obj); - } else { - lua_pushnil(L); - } - return 1; -} - -// pointer template inline int olua_pushobj(lua_State *L, const olua::pointer *value, const char *cls) { @@ -1123,6 +1042,7 @@ int olua_push_object(lua_State *L, const olua::pointer *value, const char *cl return olua_pushobj(L, value, cls); } +// pointer static inline int olua_is_pointer(lua_State *L, int idx, const char *cls) { diff --git a/frameworks/cocos2d-x/cocos/audio/apple/AudioCache.h b/frameworks/cocos2d-x/cocos/audio/apple/AudioCache.h index 3052e8ba..1cdf69fd 100755 --- a/frameworks/cocos2d-x/cocos/audio/apple/AudioCache.h +++ b/frameworks/cocos2d-x/cocos/audio/apple/AudioCache.h @@ -30,6 +30,7 @@ #include #include #include +#include #include "platform/CCPlatformMacros.h" #include "audio/apple/AudioMacros.h" diff --git a/frameworks/plugins/apple/lua_apple.cpp b/frameworks/plugins/apple/lua_apple.cpp index 64eefbe3..895a06e7 100644 --- a/frameworks/plugins/apple/lua_apple.cpp +++ b/frameworks/plugins/apple/lua_apple.cpp @@ -179,7 +179,7 @@ static int _cclua_plugin_apple_requestProducts(lua_State *L) std::set arg1; /** products */ - olua_check_vector(L, 1, arg1, [L](std::string *arg1) { + olua_check_array(L, 1, arg1, [L](std::string *arg1) { olua_check_string(L, -1, arg1); }); diff --git a/frameworks/plugins/jpush/lua_jpush.cpp b/frameworks/plugins/jpush/lua_jpush.cpp index 3af405c1..30229744 100644 --- a/frameworks/plugins/jpush/lua_jpush.cpp +++ b/frameworks/plugins/jpush/lua_jpush.cpp @@ -37,7 +37,7 @@ static int _cclua_plugin_jpush_addTags(lua_State *L) std::set arg1; /** tags */ - olua_check_vector(L, 1, arg1, [L](std::string *arg1) { + olua_check_array(L, 1, arg1, [L](std::string *arg1) { olua_check_string(L, -1, arg1); }); @@ -79,7 +79,7 @@ static int _cclua_plugin_jpush_deleteTags(lua_State *L) std::set arg1; /** tags */ - olua_check_vector(L, 1, arg1, [L](std::string *arg1) { + olua_check_array(L, 1, arg1, [L](std::string *arg1) { olua_check_string(L, -1, arg1); }); @@ -213,7 +213,7 @@ static int _cclua_plugin_jpush_setTags(lua_State *L) std::set arg1; /** tags */ - olua_check_vector(L, 1, arg1, [L](std::string *arg1) { + olua_check_array(L, 1, arg1, [L](std::string *arg1) { olua_check_string(L, -1, arg1); }); diff --git a/tools/lua-bindings/conf/lua-cocos2d-types.lua b/tools/lua-bindings/conf/lua-cocos2d-types.lua index 6ee6daf6..3e328cb4 100644 --- a/tools/lua-bindings/conf/lua-cocos2d-types.lua +++ b/tools/lua-bindings/conf/lua-cocos2d-types.lua @@ -23,7 +23,7 @@ end) typedef 'cocos2d::Data' typedef 'cocos2d::Vector' - .conv 'olua_$$_vector' + .conv 'olua_$$_array' typedef 'cocos2d::Color3B' typedef 'cocos2d::Color4B' typedef 'cocos2d::Color4F' diff --git a/tools/lua-bindings/conf/lua-spine.lua b/tools/lua-bindings/conf/lua-spine.lua index 3c5a6dc3..a94fc844 100644 --- a/tools/lua-bindings/conf/lua-spine.lua +++ b/tools/lua-bindings/conf/lua-spine.lua @@ -30,7 +30,7 @@ typedef 'spine::String' .conv 'olua_$$_string' typedef 'spine::Color' typedef 'spine::Vector' - .conv 'olua_$$_vector' + .conv 'olua_$$_array' typeenum 'spine::EventType' typeenum 'spine::AttachmentType' diff --git a/tools/lua-bindings/olua b/tools/lua-bindings/olua index 6e0e0c17..af65e69a 160000 --- a/tools/lua-bindings/olua +++ b/tools/lua-bindings/olua @@ -1 +1 @@ -Subproject commit 6e0e0c17ed73deb010200f403ac67af68f2a66c4 +Subproject commit af65e69a97e5a3cfc02cf6cc58bd69728a033017