$#include "PackageFile.h" struct PackageEntry { unsigned offset_ @ offset; unsigned size_ @ size; unsigned checksum_ @ checksum; }; class PackageFile : public Object { PackageFile(); PackageFile(const String fileName, unsigned startOffset = 0); ~PackageFile(); bool Open(const String fileName, unsigned startOffset = 0); bool Exists(const String fileName) const; const PackageEntry* GetEntry(const String fileName) const; const HashMap& GetEntries() const; const String GetName() const; StringHash GetNameHash() const; unsigned GetNumFiles() const; unsigned GetTotalSize() const; unsigned GetChecksum() const; bool IsCompressed() const; tolua_readonly tolua_property__get_set String name; tolua_readonly tolua_property__get_set StringHash nameHash; tolua_readonly tolua_property__get_set unsigned numFiles; tolua_readonly tolua_property__get_set unsigned totalSize; tolua_readonly tolua_property__get_set unsigned checksum; tolua_readonly tolua_property__is_set bool compressed; }; ${ #define TOLUA_DISABLE_tolua_IOLuaAPI_PackageFile_new00 static int tolua_IOLuaAPI_PackageFile_new00(lua_State* tolua_S) { return ToluaNewObject(tolua_S); } #define TOLUA_DISABLE_tolua_IOLuaAPI_PackageFile_new00_local static int tolua_IOLuaAPI_PackageFile_new00_local(lua_State* tolua_S) { return ToluaNewObjectGC(tolua_S); } /* method: new of class PackageFile */ #define TOLUA_DISABLE_tolua_IOLuaAPI_PackageFile_new01 static int tolua_IOLuaAPI_PackageFile_new01(lua_State* tolua_S) { tolua_Error tolua_err; if ( !tolua_isusertable(tolua_S,1,"PackageFile",0,&tolua_err) || !tolua_isurho3dstring(tolua_S,2,0,&tolua_err) || !tolua_isnumber(tolua_S,3,1,&tolua_err) || !tolua_isnoobj(tolua_S,4,&tolua_err) ) goto tolua_lerror; else { const String fileName = ((const String) tolua_tourho3dstring(tolua_S,2,0)); unsigned startOffset = ((unsigned) tolua_tonumber(tolua_S,3,0)); { PackageFile* tolua_ret = (PackageFile*) Mtolua_new((PackageFile)(GetContext(tolua_S),fileName,startOffset)); tolua_pushusertype(tolua_S,(void*)tolua_ret,"PackageFile"); } } return 1; tolua_lerror: return tolua_IOLuaAPI_PackageFile_new00(tolua_S); } /* method: new_local of class PackageFile */ #define TOLUA_DISABLE_tolua_IOLuaAPI_PackageFile_new01_local static int tolua_IOLuaAPI_PackageFile_new01_local(lua_State* tolua_S) { tolua_Error tolua_err; if ( !tolua_isusertable(tolua_S,1,"PackageFile",0,&tolua_err) || !tolua_isurho3dstring(tolua_S,2,0,&tolua_err) || !tolua_isnumber(tolua_S,3,1,&tolua_err) || !tolua_isnoobj(tolua_S,4,&tolua_err) ) goto tolua_lerror; else { const String fileName = ((const String) tolua_tourho3dstring(tolua_S,2,0)); unsigned startOffset = ((unsigned) tolua_tonumber(tolua_S,3,0)); { PackageFile* tolua_ret = (PackageFile*) Mtolua_new((PackageFile)(GetContext(tolua_S),fileName,startOffset)); tolua_pushusertype(tolua_S,(void*)tolua_ret,"PackageFile"); tolua_register_gc(tolua_S,lua_gettop(tolua_S)); } } return 1; tolua_lerror: return tolua_IOLuaAPI_PackageFile_new00_local(tolua_S); } $}