@@ -795,14 +795,122 @@ static int tolua_cocos2d_CCBReader_load(lua_State* tolua_S)
795795#endif
796796}
797797
798+ static int tolua_cocos2d_CCBReader_getSubReaders (lua_State* tolua_S)
799+ {
800+ if (nullptr == tolua_S)
801+ return 0 ;
802+
803+ int argc = 0 ;
804+ CCBReader* self = nullptr ;
805+
806+ #if COCOS2D_DEBUG >= 1
807+ tolua_Error tolua_err;
808+ if (!tolua_isusertype (tolua_S,1 ," cc.CCBReader" ,0 ,&tolua_err)) goto tolua_lerror;
809+ #endif
810+
811+ self = static_cast <CCBReader*>(tolua_tousertype (tolua_S,1 ,0 ));
812+ #if COCOS2D_DEBUG >= 1
813+ if (nullptr == self) {
814+ tolua_error (tolua_S," invalid 'self' in function 'tolua_cocos2d_CCBReader_getSubReaders'\n " , NULL );
815+ return 0 ;
816+ }
817+ #endif
818+
819+ argc = lua_gettop (tolua_S) - 1 ;
820+
821+ if (argc == 0 )
822+ {
823+ auto tolua_ret = self->getSubCCBFiles ();
824+ if (tolua_ret.empty ()) {
825+ return 0 ;
826+ }
827+
828+ int i = 1 ;
829+ lua_newtable (tolua_S);
830+ for (auto item : tolua_ret)
831+ {
832+ auto reader = item;
833+ int ID = (reader) ? (int )reader->_ID : -1 ;
834+ int * luaID = (reader) ? &reader->_luaID : NULL ;
835+
836+ toluafix_pushusertype_ccobject (tolua_S, ID , luaID, (void *)reader," cc.CCBReader" );
837+ lua_rawseti (tolua_S, -2 , i);
838+ ++i;
839+ }
840+ return 1 ;
841+
842+ }
843+
844+ CCLOG (" 'getSubReaders' function of CCBReader has wrong number of arguments: %d, was expecting %d\n " , argc, 0 );
845+ return 0 ;
846+
847+ #if COCOS2D_DEBUG >= 1
848+ tolua_lerror:
849+ tolua_error (tolua_S," #ferror in function 'getSubReaders'." ,&tolua_err);
850+ return 0 ;
851+ #endif
852+ }
853+
854+ static int tolua_cocos2d_CCBReader_getDocumentControllerName (lua_State* tolua_S)
855+ {
856+ if (nullptr == tolua_S)
857+ return 0 ;
858+
859+ int argc = 0 ;
860+ CCBReader* self = nullptr ;
861+
862+ #if COCOS2D_DEBUG >= 1
863+ tolua_Error tolua_err;
864+ if (!tolua_isusertype (tolua_S,1 ," cc.CCBReader" ,0 ,&tolua_err)) goto tolua_lerror;
865+ #endif
866+
867+ self = static_cast <CCBReader*>(tolua_tousertype (tolua_S,1 ,0 ));
868+ #if COCOS2D_DEBUG >= 1
869+ if (nullptr == self) {
870+ tolua_error (tolua_S," invalid 'self' in function 'tolua_cocos2d_CCBReader_getSubReaders'\n " , NULL );
871+ return 0 ;
872+ }
873+ #endif
874+
875+ argc = lua_gettop (tolua_S) - 1 ;
876+
877+ if (argc == 0 )
878+ {
879+ auto tolua_ret = self->getDocumentControllerName ();
880+ if (tolua_ret.empty ()) {
881+ return 0 ;
882+ }
883+
884+ lua_pushstring (tolua_S, tolua_ret.c_str ());
885+ return 1 ;
886+ }
887+
888+ CCLOG (" 'getDocumentControllerName' function of CCBReader has wrong number of arguments: %d, was expecting %d\n " , argc, 0 );
889+ return 0 ;
890+
891+ #if COCOS2D_DEBUG >= 1
892+ tolua_lerror:
893+ tolua_error (tolua_S," #ferror in function 'getDocumentControllerName'." ,&tolua_err);
894+ return 0 ;
895+ #endif
896+ }
897+
798898static void extendCCBReader (lua_State* tolua_S)
799899{
800900 lua_pushstring (tolua_S, " cc.CCBReader" );
801901 lua_rawget (tolua_S, LUA_REGISTRYINDEX );
802902 if (lua_istable (tolua_S,-1 ))
803903 {
804904 lua_pushstring (tolua_S," load" );
805- lua_pushcfunction (tolua_S,tolua_cocos2d_CCBReader_load );
905+ lua_pushcfunction (tolua_S,tolua_cocos2d_CCBReader_load);
906+ lua_rawset (tolua_S,-3 );
907+
908+ lua_pushstring (tolua_S," getSubReaders" );
909+ lua_pushcfunction (tolua_S,tolua_cocos2d_CCBReader_getSubReaders);
910+ lua_rawset (tolua_S,-3 );
911+
912+ lua_pushstring (tolua_S," getDocumentControllerName" );
913+ lua_pushcfunction (tolua_S,tolua_cocos2d_CCBReader_getDocumentControllerName);
806914 lua_rawset (tolua_S,-3 );
807915 }
808916 lua_pop (tolua_S, 1 );
0 commit comments