IOLuaAPI.cpp 71 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081108210831084108510861087108810891090109110921093109410951096109710981099110011011102110311041105110611071108110911101111111211131114111511161117111811191120112111221123112411251126112711281129113011311132113311341135113611371138113911401141114211431144114511461147114811491150115111521153115411551156115711581159116011611162116311641165116611671168116911701171117211731174117511761177117811791180118111821183118411851186118711881189119011911192119311941195119611971198119912001201120212031204120512061207120812091210121112121213121412151216121712181219122012211222122312241225122612271228122912301231123212331234123512361237123812391240124112421243124412451246124712481249125012511252125312541255125612571258125912601261126212631264126512661267126812691270127112721273127412751276127712781279128012811282128312841285128612871288128912901291129212931294129512961297129812991300130113021303130413051306130713081309131013111312131313141315131613171318131913201321132213231324132513261327132813291330133113321333133413351336133713381339134013411342134313441345134613471348134913501351135213531354135513561357135813591360136113621363136413651366136713681369137013711372137313741375137613771378137913801381138213831384138513861387138813891390139113921393139413951396139713981399140014011402140314041405140614071408140914101411141214131414141514161417141814191420142114221423142414251426142714281429143014311432143314341435143614371438143914401441144214431444144514461447144814491450145114521453145414551456145714581459146014611462146314641465146614671468146914701471147214731474147514761477147814791480148114821483148414851486148714881489149014911492149314941495149614971498149915001501150215031504150515061507150815091510151115121513151415151516151715181519152015211522152315241525152615271528152915301531153215331534153515361537153815391540154115421543154415451546154715481549155015511552155315541555155615571558155915601561156215631564156515661567156815691570157115721573157415751576157715781579158015811582158315841585158615871588158915901591159215931594159515961597159815991600160116021603160416051606160716081609161016111612161316141615161616171618161916201621162216231624162516261627162816291630163116321633163416351636163716381639164016411642164316441645164616471648164916501651165216531654165516561657165816591660166116621663166416651666166716681669167016711672167316741675167616771678167916801681168216831684168516861687168816891690169116921693169416951696169716981699170017011702170317041705170617071708170917101711171217131714171517161717171817191720172117221723172417251726172717281729173017311732173317341735173617371738173917401741174217431744174517461747174817491750175117521753175417551756175717581759176017611762176317641765176617671768176917701771177217731774177517761777177817791780178117821783178417851786178717881789179017911792179317941795179617971798179918001801180218031804180518061807180818091810181118121813181418151816181718181819182018211822182318241825182618271828182918301831183218331834183518361837183818391840184118421843184418451846184718481849185018511852185318541855185618571858185918601861186218631864186518661867186818691870187118721873187418751876187718781879188018811882188318841885188618871888188918901891189218931894189518961897189818991900190119021903190419051906190719081909191019111912191319141915191619171918191919201921192219231924192519261927192819291930193119321933193419351936193719381939194019411942194319441945194619471948194919501951195219531954195519561957195819591960196119621963196419651966196719681969197019711972197319741975197619771978197919801981198219831984198519861987198819891990199119921993199419951996199719981999200020012002200320042005200620072008200920102011201220132014201520162017201820192020202120222023202420252026202720282029203020312032203320342035203620372038203920402041204220432044204520462047204820492050205120522053205420552056205720582059206020612062206320642065206620672068206920702071207220732074207520762077207820792080208120822083208420852086208720882089209020912092209320942095209620972098209921002101210221032104210521062107210821092110211121122113211421152116211721182119212021212122212321242125212621272128212921302131213221332134213521362137213821392140214121422143214421452146214721482149215021512152215321542155215621572158215921602161216221632164216521662167216821692170217121722173217421752176217721782179218021812182218321842185218621872188218921902191219221932194219521962197219821992200220122022203220422052206220722082209221022112212221322142215221622172218221922202221222222232224222522262227222822292230223122322233223422352236223722382239224022412242224322442245224622472248224922502251225222532254225522562257225822592260226122622263226422652266226722682269227022712272227322742275227622772278227922802281228222832284228522862287228822892290229122922293229422952296229722982299230023012302230323042305230623072308230923102311231223132314231523162317231823192320232123222323232423252326232723282329233023312332233323342335233623372338233923402341234223432344234523462347234823492350235123522353235423552356235723582359236023612362236323642365236623672368236923702371237223732374237523762377
  1. /*
  2. ** Lua binding: IO
  3. ** Generated automatically by tolua++-1.0.92 on 06/30/13 11:31:50.
  4. */
  5. //
  6. // Copyright (c) 2008-2013 the Urho3D project.
  7. //
  8. // Permission is hereby granted, free of charge, to any person obtaining a copy
  9. // of this software and associated documentation files (the "Software"), to deal
  10. // in the Software without restriction, including without limitation the rights
  11. // to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
  12. // copies of the Software, and to permit persons to whom the Software is
  13. // furnished to do so, subject to the following conditions:
  14. //
  15. // The above copyright notice and this permission notice shall be included in
  16. // all copies or substantial portions of the Software.
  17. //
  18. // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
  19. // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
  20. // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
  21. // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
  22. // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
  23. // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
  24. // THE SOFTWARE.
  25. //
  26. #include "Precompiled.h"
  27. #include "tolua++.h"
  28. /* Exported function */
  29. TOLUA_API int tolua_IO_open (lua_State* tolua_S);
  30. #define TOLUA_RELEASE
  31. #include "IOLuaAPI.h"
  32. #include "File.h"
  33. #include "FileSystem.h"
  34. #include "Log.h"
  35. #include "PackageFile.h"
  36. using namespace Urho3D;
  37. #pragma warning(disable:4800)
  38. /* function to release collected object via destructor */
  39. #ifdef __cplusplus
  40. static int tolua_collect_StringHash (lua_State* tolua_S)
  41. {
  42. StringHash* self = (StringHash*) tolua_tousertype(tolua_S,1,0);
  43. Mtolua_delete(self);
  44. return 0;
  45. }
  46. static int tolua_collect_String (lua_State* tolua_S)
  47. {
  48. String* self = (String*) tolua_tousertype(tolua_S,1,0);
  49. Mtolua_delete(self);
  50. return 0;
  51. }
  52. #endif
  53. /* function to register type */
  54. static void tolua_reg_types (lua_State* tolua_S)
  55. {
  56. tolua_usertype(tolua_S,"Log");
  57. tolua_usertype(tolua_S,"PackageEntry");
  58. tolua_usertype(tolua_S,"StringHash");
  59. tolua_usertype(tolua_S,"FileSystem");
  60. tolua_usertype(tolua_S,"Object");
  61. tolua_usertype(tolua_S,"Deserializer");
  62. tolua_usertype(tolua_S,"File");
  63. tolua_usertype(tolua_S,"String");
  64. tolua_usertype(tolua_S,"PackageFile");
  65. }
  66. /* method: Read of class File */
  67. #ifndef TOLUA_DISABLE_tolua_IO_File_Read00
  68. static int tolua_IO_File_Read00(lua_State* tolua_S)
  69. {
  70. #ifndef TOLUA_RELEASE
  71. tolua_Error tolua_err;
  72. if (
  73. !tolua_isusertype(tolua_S,1,"File",0,&tolua_err) ||
  74. !tolua_isuserdata(tolua_S,2,0,&tolua_err) ||
  75. !tolua_isnumber(tolua_S,3,0,&tolua_err) ||
  76. !tolua_isnoobj(tolua_S,4,&tolua_err)
  77. )
  78. goto tolua_lerror;
  79. else
  80. #endif
  81. {
  82. File* self = (File*) tolua_tousertype(tolua_S,1,0);
  83. void* dest = ((void*) tolua_touserdata(tolua_S,2,0));
  84. unsigned size = ((unsigned) tolua_tonumber(tolua_S,3,0));
  85. #ifndef TOLUA_RELEASE
  86. if (!self) tolua_error(tolua_S,"invalid 'self' in function 'Read'", NULL);
  87. #endif
  88. {
  89. unsigned tolua_ret = (unsigned) self->Read(dest,size);
  90. tolua_pushnumber(tolua_S,(lua_Number)tolua_ret);
  91. }
  92. }
  93. return 1;
  94. #ifndef TOLUA_RELEASE
  95. tolua_lerror:
  96. tolua_error(tolua_S,"#ferror in function 'Read'.",&tolua_err);
  97. return 0;
  98. #endif
  99. }
  100. #endif //#ifndef TOLUA_DISABLE
  101. /* method: Seek of class File */
  102. #ifndef TOLUA_DISABLE_tolua_IO_File_Seek00
  103. static int tolua_IO_File_Seek00(lua_State* tolua_S)
  104. {
  105. #ifndef TOLUA_RELEASE
  106. tolua_Error tolua_err;
  107. if (
  108. !tolua_isusertype(tolua_S,1,"File",0,&tolua_err) ||
  109. !tolua_isnumber(tolua_S,2,0,&tolua_err) ||
  110. !tolua_isnoobj(tolua_S,3,&tolua_err)
  111. )
  112. goto tolua_lerror;
  113. else
  114. #endif
  115. {
  116. File* self = (File*) tolua_tousertype(tolua_S,1,0);
  117. unsigned position = ((unsigned) tolua_tonumber(tolua_S,2,0));
  118. #ifndef TOLUA_RELEASE
  119. if (!self) tolua_error(tolua_S,"invalid 'self' in function 'Seek'", NULL);
  120. #endif
  121. {
  122. unsigned tolua_ret = (unsigned) self->Seek(position);
  123. tolua_pushnumber(tolua_S,(lua_Number)tolua_ret);
  124. }
  125. }
  126. return 1;
  127. #ifndef TOLUA_RELEASE
  128. tolua_lerror:
  129. tolua_error(tolua_S,"#ferror in function 'Seek'.",&tolua_err);
  130. return 0;
  131. #endif
  132. }
  133. #endif //#ifndef TOLUA_DISABLE
  134. /* method: GetName of class File */
  135. #ifndef TOLUA_DISABLE_tolua_IO_File_GetName00
  136. static int tolua_IO_File_GetName00(lua_State* tolua_S)
  137. {
  138. #ifndef TOLUA_RELEASE
  139. tolua_Error tolua_err;
  140. if (
  141. !tolua_isusertype(tolua_S,1,"const File",0,&tolua_err) ||
  142. !tolua_isnoobj(tolua_S,2,&tolua_err)
  143. )
  144. goto tolua_lerror;
  145. else
  146. #endif
  147. {
  148. const File* self = (const File*) tolua_tousertype(tolua_S,1,0);
  149. #ifndef TOLUA_RELEASE
  150. if (!self) tolua_error(tolua_S,"invalid 'self' in function 'GetName'", NULL);
  151. #endif
  152. {
  153. const String& tolua_ret = (const String&) self->GetName();
  154. tolua_pushusertype(tolua_S,(void*)&tolua_ret,"const String");
  155. }
  156. }
  157. return 1;
  158. #ifndef TOLUA_RELEASE
  159. tolua_lerror:
  160. tolua_error(tolua_S,"#ferror in function 'GetName'.",&tolua_err);
  161. return 0;
  162. #endif
  163. }
  164. #endif //#ifndef TOLUA_DISABLE
  165. /* method: GetChecksum of class File */
  166. #ifndef TOLUA_DISABLE_tolua_IO_File_GetChecksum00
  167. static int tolua_IO_File_GetChecksum00(lua_State* tolua_S)
  168. {
  169. #ifndef TOLUA_RELEASE
  170. tolua_Error tolua_err;
  171. if (
  172. !tolua_isusertype(tolua_S,1,"File",0,&tolua_err) ||
  173. !tolua_isnoobj(tolua_S,2,&tolua_err)
  174. )
  175. goto tolua_lerror;
  176. else
  177. #endif
  178. {
  179. File* self = (File*) tolua_tousertype(tolua_S,1,0);
  180. #ifndef TOLUA_RELEASE
  181. if (!self) tolua_error(tolua_S,"invalid 'self' in function 'GetChecksum'", NULL);
  182. #endif
  183. {
  184. unsigned tolua_ret = (unsigned) self->GetChecksum();
  185. tolua_pushnumber(tolua_S,(lua_Number)tolua_ret);
  186. }
  187. }
  188. return 1;
  189. #ifndef TOLUA_RELEASE
  190. tolua_lerror:
  191. tolua_error(tolua_S,"#ferror in function 'GetChecksum'.",&tolua_err);
  192. return 0;
  193. #endif
  194. }
  195. #endif //#ifndef TOLUA_DISABLE
  196. /* method: Open of class File */
  197. #ifndef TOLUA_DISABLE_tolua_IO_File_Open00
  198. static int tolua_IO_File_Open00(lua_State* tolua_S)
  199. {
  200. #ifndef TOLUA_RELEASE
  201. tolua_Error tolua_err;
  202. if (
  203. !tolua_isusertype(tolua_S,1,"File",0,&tolua_err) ||
  204. (tolua_isvaluenil(tolua_S,2,&tolua_err) || !tolua_isusertype(tolua_S,2,"const String",0,&tolua_err)) ||
  205. !tolua_isnumber(tolua_S,3,1,&tolua_err) ||
  206. !tolua_isnoobj(tolua_S,4,&tolua_err)
  207. )
  208. goto tolua_lerror;
  209. else
  210. #endif
  211. {
  212. File* self = (File*) tolua_tousertype(tolua_S,1,0);
  213. const String* fileName = ((const String*) tolua_tousertype(tolua_S,2,0));
  214. FileMode mode = ((FileMode) (int) tolua_tonumber(tolua_S,3,FILE_READ));
  215. #ifndef TOLUA_RELEASE
  216. if (!self) tolua_error(tolua_S,"invalid 'self' in function 'Open'", NULL);
  217. #endif
  218. {
  219. bool tolua_ret = (bool) self->Open(*fileName,mode);
  220. tolua_pushboolean(tolua_S,(bool)tolua_ret);
  221. }
  222. }
  223. return 1;
  224. #ifndef TOLUA_RELEASE
  225. tolua_lerror:
  226. tolua_error(tolua_S,"#ferror in function 'Open'.",&tolua_err);
  227. return 0;
  228. #endif
  229. }
  230. #endif //#ifndef TOLUA_DISABLE
  231. /* method: Open of class File */
  232. #ifndef TOLUA_DISABLE_tolua_IO_File_Open01
  233. static int tolua_IO_File_Open01(lua_State* tolua_S)
  234. {
  235. tolua_Error tolua_err;
  236. if (
  237. !tolua_isusertype(tolua_S,1,"File",0,&tolua_err) ||
  238. !tolua_isusertype(tolua_S,2,"PackageFile",0,&tolua_err) ||
  239. (tolua_isvaluenil(tolua_S,3,&tolua_err) || !tolua_isusertype(tolua_S,3,"const String",0,&tolua_err)) ||
  240. !tolua_isnoobj(tolua_S,4,&tolua_err)
  241. )
  242. goto tolua_lerror;
  243. else
  244. {
  245. File* self = (File*) tolua_tousertype(tolua_S,1,0);
  246. PackageFile* package = ((PackageFile*) tolua_tousertype(tolua_S,2,0));
  247. const String* fileName = ((const String*) tolua_tousertype(tolua_S,3,0));
  248. #ifndef TOLUA_RELEASE
  249. if (!self) tolua_error(tolua_S,"invalid 'self' in function 'Open'", NULL);
  250. #endif
  251. {
  252. bool tolua_ret = (bool) self->Open(package,*fileName);
  253. tolua_pushboolean(tolua_S,(bool)tolua_ret);
  254. }
  255. }
  256. return 1;
  257. tolua_lerror:
  258. return tolua_IO_File_Open00(tolua_S);
  259. }
  260. #endif //#ifndef TOLUA_DISABLE
  261. /* method: Close of class File */
  262. #ifndef TOLUA_DISABLE_tolua_IO_File_Close00
  263. static int tolua_IO_File_Close00(lua_State* tolua_S)
  264. {
  265. #ifndef TOLUA_RELEASE
  266. tolua_Error tolua_err;
  267. if (
  268. !tolua_isusertype(tolua_S,1,"File",0,&tolua_err) ||
  269. !tolua_isnoobj(tolua_S,2,&tolua_err)
  270. )
  271. goto tolua_lerror;
  272. else
  273. #endif
  274. {
  275. File* self = (File*) tolua_tousertype(tolua_S,1,0);
  276. #ifndef TOLUA_RELEASE
  277. if (!self) tolua_error(tolua_S,"invalid 'self' in function 'Close'", NULL);
  278. #endif
  279. {
  280. self->Close();
  281. }
  282. }
  283. return 0;
  284. #ifndef TOLUA_RELEASE
  285. tolua_lerror:
  286. tolua_error(tolua_S,"#ferror in function 'Close'.",&tolua_err);
  287. return 0;
  288. #endif
  289. }
  290. #endif //#ifndef TOLUA_DISABLE
  291. /* method: Flush of class File */
  292. #ifndef TOLUA_DISABLE_tolua_IO_File_Flush00
  293. static int tolua_IO_File_Flush00(lua_State* tolua_S)
  294. {
  295. #ifndef TOLUA_RELEASE
  296. tolua_Error tolua_err;
  297. if (
  298. !tolua_isusertype(tolua_S,1,"File",0,&tolua_err) ||
  299. !tolua_isnoobj(tolua_S,2,&tolua_err)
  300. )
  301. goto tolua_lerror;
  302. else
  303. #endif
  304. {
  305. File* self = (File*) tolua_tousertype(tolua_S,1,0);
  306. #ifndef TOLUA_RELEASE
  307. if (!self) tolua_error(tolua_S,"invalid 'self' in function 'Flush'", NULL);
  308. #endif
  309. {
  310. self->Flush();
  311. }
  312. }
  313. return 0;
  314. #ifndef TOLUA_RELEASE
  315. tolua_lerror:
  316. tolua_error(tolua_S,"#ferror in function 'Flush'.",&tolua_err);
  317. return 0;
  318. #endif
  319. }
  320. #endif //#ifndef TOLUA_DISABLE
  321. /* method: SetName of class File */
  322. #ifndef TOLUA_DISABLE_tolua_IO_File_SetName00
  323. static int tolua_IO_File_SetName00(lua_State* tolua_S)
  324. {
  325. #ifndef TOLUA_RELEASE
  326. tolua_Error tolua_err;
  327. if (
  328. !tolua_isusertype(tolua_S,1,"File",0,&tolua_err) ||
  329. (tolua_isvaluenil(tolua_S,2,&tolua_err) || !tolua_isusertype(tolua_S,2,"const String",0,&tolua_err)) ||
  330. !tolua_isnoobj(tolua_S,3,&tolua_err)
  331. )
  332. goto tolua_lerror;
  333. else
  334. #endif
  335. {
  336. File* self = (File*) tolua_tousertype(tolua_S,1,0);
  337. const String* name = ((const String*) tolua_tousertype(tolua_S,2,0));
  338. #ifndef TOLUA_RELEASE
  339. if (!self) tolua_error(tolua_S,"invalid 'self' in function 'SetName'", NULL);
  340. #endif
  341. {
  342. self->SetName(*name);
  343. }
  344. }
  345. return 0;
  346. #ifndef TOLUA_RELEASE
  347. tolua_lerror:
  348. tolua_error(tolua_S,"#ferror in function 'SetName'.",&tolua_err);
  349. return 0;
  350. #endif
  351. }
  352. #endif //#ifndef TOLUA_DISABLE
  353. /* method: GetMode of class File */
  354. #ifndef TOLUA_DISABLE_tolua_IO_File_GetMode00
  355. static int tolua_IO_File_GetMode00(lua_State* tolua_S)
  356. {
  357. #ifndef TOLUA_RELEASE
  358. tolua_Error tolua_err;
  359. if (
  360. !tolua_isusertype(tolua_S,1,"const File",0,&tolua_err) ||
  361. !tolua_isnoobj(tolua_S,2,&tolua_err)
  362. )
  363. goto tolua_lerror;
  364. else
  365. #endif
  366. {
  367. const File* self = (const File*) tolua_tousertype(tolua_S,1,0);
  368. #ifndef TOLUA_RELEASE
  369. if (!self) tolua_error(tolua_S,"invalid 'self' in function 'GetMode'", NULL);
  370. #endif
  371. {
  372. FileMode tolua_ret = (FileMode) self->GetMode();
  373. tolua_pushnumber(tolua_S,(lua_Number)tolua_ret);
  374. }
  375. }
  376. return 1;
  377. #ifndef TOLUA_RELEASE
  378. tolua_lerror:
  379. tolua_error(tolua_S,"#ferror in function 'GetMode'.",&tolua_err);
  380. return 0;
  381. #endif
  382. }
  383. #endif //#ifndef TOLUA_DISABLE
  384. /* method: IsOpen of class File */
  385. #ifndef TOLUA_DISABLE_tolua_IO_File_IsOpen00
  386. static int tolua_IO_File_IsOpen00(lua_State* tolua_S)
  387. {
  388. #ifndef TOLUA_RELEASE
  389. tolua_Error tolua_err;
  390. if (
  391. !tolua_isusertype(tolua_S,1,"const File",0,&tolua_err) ||
  392. !tolua_isnoobj(tolua_S,2,&tolua_err)
  393. )
  394. goto tolua_lerror;
  395. else
  396. #endif
  397. {
  398. const File* self = (const File*) tolua_tousertype(tolua_S,1,0);
  399. #ifndef TOLUA_RELEASE
  400. if (!self) tolua_error(tolua_S,"invalid 'self' in function 'IsOpen'", NULL);
  401. #endif
  402. {
  403. bool tolua_ret = (bool) self->IsOpen();
  404. tolua_pushboolean(tolua_S,(bool)tolua_ret);
  405. }
  406. }
  407. return 1;
  408. #ifndef TOLUA_RELEASE
  409. tolua_lerror:
  410. tolua_error(tolua_S,"#ferror in function 'IsOpen'.",&tolua_err);
  411. return 0;
  412. #endif
  413. }
  414. #endif //#ifndef TOLUA_DISABLE
  415. /* method: GetHandle of class File */
  416. #ifndef TOLUA_DISABLE_tolua_IO_File_GetHandle00
  417. static int tolua_IO_File_GetHandle00(lua_State* tolua_S)
  418. {
  419. #ifndef TOLUA_RELEASE
  420. tolua_Error tolua_err;
  421. if (
  422. !tolua_isusertype(tolua_S,1,"const File",0,&tolua_err) ||
  423. !tolua_isnoobj(tolua_S,2,&tolua_err)
  424. )
  425. goto tolua_lerror;
  426. else
  427. #endif
  428. {
  429. const File* self = (const File*) tolua_tousertype(tolua_S,1,0);
  430. #ifndef TOLUA_RELEASE
  431. if (!self) tolua_error(tolua_S,"invalid 'self' in function 'GetHandle'", NULL);
  432. #endif
  433. {
  434. void* tolua_ret = (void*) self->GetHandle();
  435. tolua_pushuserdata(tolua_S,(void*)tolua_ret);
  436. }
  437. }
  438. return 1;
  439. #ifndef TOLUA_RELEASE
  440. tolua_lerror:
  441. tolua_error(tolua_S,"#ferror in function 'GetHandle'.",&tolua_err);
  442. return 0;
  443. #endif
  444. }
  445. #endif //#ifndef TOLUA_DISABLE
  446. /* method: IsPackaged of class File */
  447. #ifndef TOLUA_DISABLE_tolua_IO_File_IsPackaged00
  448. static int tolua_IO_File_IsPackaged00(lua_State* tolua_S)
  449. {
  450. #ifndef TOLUA_RELEASE
  451. tolua_Error tolua_err;
  452. if (
  453. !tolua_isusertype(tolua_S,1,"const File",0,&tolua_err) ||
  454. !tolua_isnoobj(tolua_S,2,&tolua_err)
  455. )
  456. goto tolua_lerror;
  457. else
  458. #endif
  459. {
  460. const File* self = (const File*) tolua_tousertype(tolua_S,1,0);
  461. #ifndef TOLUA_RELEASE
  462. if (!self) tolua_error(tolua_S,"invalid 'self' in function 'IsPackaged'", NULL);
  463. #endif
  464. {
  465. bool tolua_ret = (bool) self->IsPackaged();
  466. tolua_pushboolean(tolua_S,(bool)tolua_ret);
  467. }
  468. }
  469. return 1;
  470. #ifndef TOLUA_RELEASE
  471. tolua_lerror:
  472. tolua_error(tolua_S,"#ferror in function 'IsPackaged'.",&tolua_err);
  473. return 0;
  474. #endif
  475. }
  476. #endif //#ifndef TOLUA_DISABLE
  477. /* get function: SCAN_FILES */
  478. #ifndef TOLUA_DISABLE_tolua_get_SCAN_FILES
  479. static int tolua_get_SCAN_FILES(lua_State* tolua_S)
  480. {
  481. tolua_pushnumber(tolua_S,(lua_Number)SCAN_FILES);
  482. return 1;
  483. }
  484. #endif //#ifndef TOLUA_DISABLE
  485. /* get function: SCAN_DIRS */
  486. #ifndef TOLUA_DISABLE_tolua_get_SCAN_DIRS
  487. static int tolua_get_SCAN_DIRS(lua_State* tolua_S)
  488. {
  489. tolua_pushnumber(tolua_S,(lua_Number)SCAN_DIRS);
  490. return 1;
  491. }
  492. #endif //#ifndef TOLUA_DISABLE
  493. /* get function: SCAN_HIDDEN */
  494. #ifndef TOLUA_DISABLE_tolua_get_SCAN_HIDDEN
  495. static int tolua_get_SCAN_HIDDEN(lua_State* tolua_S)
  496. {
  497. tolua_pushnumber(tolua_S,(lua_Number)SCAN_HIDDEN);
  498. return 1;
  499. }
  500. #endif //#ifndef TOLUA_DISABLE
  501. /* method: SetCurrentDir of class FileSystem */
  502. #ifndef TOLUA_DISABLE_tolua_IO_FileSystem_SetCurrentDir00
  503. static int tolua_IO_FileSystem_SetCurrentDir00(lua_State* tolua_S)
  504. {
  505. #ifndef TOLUA_RELEASE
  506. tolua_Error tolua_err;
  507. if (
  508. !tolua_isusertype(tolua_S,1,"FileSystem",0,&tolua_err) ||
  509. (tolua_isvaluenil(tolua_S,2,&tolua_err) || !tolua_isusertype(tolua_S,2,"const String",0,&tolua_err)) ||
  510. !tolua_isnoobj(tolua_S,3,&tolua_err)
  511. )
  512. goto tolua_lerror;
  513. else
  514. #endif
  515. {
  516. FileSystem* self = (FileSystem*) tolua_tousertype(tolua_S,1,0);
  517. const String* pathName = ((const String*) tolua_tousertype(tolua_S,2,0));
  518. #ifndef TOLUA_RELEASE
  519. if (!self) tolua_error(tolua_S,"invalid 'self' in function 'SetCurrentDir'", NULL);
  520. #endif
  521. {
  522. bool tolua_ret = (bool) self->SetCurrentDir(*pathName);
  523. tolua_pushboolean(tolua_S,(bool)tolua_ret);
  524. }
  525. }
  526. return 1;
  527. #ifndef TOLUA_RELEASE
  528. tolua_lerror:
  529. tolua_error(tolua_S,"#ferror in function 'SetCurrentDir'.",&tolua_err);
  530. return 0;
  531. #endif
  532. }
  533. #endif //#ifndef TOLUA_DISABLE
  534. /* method: CreateDir of class FileSystem */
  535. #ifndef TOLUA_DISABLE_tolua_IO_FileSystem_CreateDir00
  536. static int tolua_IO_FileSystem_CreateDir00(lua_State* tolua_S)
  537. {
  538. #ifndef TOLUA_RELEASE
  539. tolua_Error tolua_err;
  540. if (
  541. !tolua_isusertype(tolua_S,1,"FileSystem",0,&tolua_err) ||
  542. (tolua_isvaluenil(tolua_S,2,&tolua_err) || !tolua_isusertype(tolua_S,2,"const String",0,&tolua_err)) ||
  543. !tolua_isnoobj(tolua_S,3,&tolua_err)
  544. )
  545. goto tolua_lerror;
  546. else
  547. #endif
  548. {
  549. FileSystem* self = (FileSystem*) tolua_tousertype(tolua_S,1,0);
  550. const String* pathName = ((const String*) tolua_tousertype(tolua_S,2,0));
  551. #ifndef TOLUA_RELEASE
  552. if (!self) tolua_error(tolua_S,"invalid 'self' in function 'CreateDir'", NULL);
  553. #endif
  554. {
  555. bool tolua_ret = (bool) self->CreateDir(*pathName);
  556. tolua_pushboolean(tolua_S,(bool)tolua_ret);
  557. }
  558. }
  559. return 1;
  560. #ifndef TOLUA_RELEASE
  561. tolua_lerror:
  562. tolua_error(tolua_S,"#ferror in function 'CreateDir'.",&tolua_err);
  563. return 0;
  564. #endif
  565. }
  566. #endif //#ifndef TOLUA_DISABLE
  567. /* method: SystemCommand of class FileSystem */
  568. #ifndef TOLUA_DISABLE_tolua_IO_FileSystem_SystemCommand00
  569. static int tolua_IO_FileSystem_SystemCommand00(lua_State* tolua_S)
  570. {
  571. #ifndef TOLUA_RELEASE
  572. tolua_Error tolua_err;
  573. if (
  574. !tolua_isusertype(tolua_S,1,"FileSystem",0,&tolua_err) ||
  575. (tolua_isvaluenil(tolua_S,2,&tolua_err) || !tolua_isusertype(tolua_S,2,"const String",0,&tolua_err)) ||
  576. !tolua_isnoobj(tolua_S,3,&tolua_err)
  577. )
  578. goto tolua_lerror;
  579. else
  580. #endif
  581. {
  582. FileSystem* self = (FileSystem*) tolua_tousertype(tolua_S,1,0);
  583. const String* commandLine = ((const String*) tolua_tousertype(tolua_S,2,0));
  584. #ifndef TOLUA_RELEASE
  585. if (!self) tolua_error(tolua_S,"invalid 'self' in function 'SystemCommand'", NULL);
  586. #endif
  587. {
  588. int tolua_ret = (int) self->SystemCommand(*commandLine);
  589. tolua_pushnumber(tolua_S,(lua_Number)tolua_ret);
  590. }
  591. }
  592. return 1;
  593. #ifndef TOLUA_RELEASE
  594. tolua_lerror:
  595. tolua_error(tolua_S,"#ferror in function 'SystemCommand'.",&tolua_err);
  596. return 0;
  597. #endif
  598. }
  599. #endif //#ifndef TOLUA_DISABLE
  600. /* method: SystemOpen of class FileSystem */
  601. #ifndef TOLUA_DISABLE_tolua_IO_FileSystem_SystemOpen00
  602. static int tolua_IO_FileSystem_SystemOpen00(lua_State* tolua_S)
  603. {
  604. #ifndef TOLUA_RELEASE
  605. tolua_Error tolua_err;
  606. if (
  607. !tolua_isusertype(tolua_S,1,"FileSystem",0,&tolua_err) ||
  608. (tolua_isvaluenil(tolua_S,2,&tolua_err) || !tolua_isusertype(tolua_S,2,"const String",0,&tolua_err)) ||
  609. !tolua_isnoobj(tolua_S,3,&tolua_err)
  610. )
  611. goto tolua_lerror;
  612. else
  613. #endif
  614. {
  615. FileSystem* self = (FileSystem*) tolua_tousertype(tolua_S,1,0);
  616. const String* fileName = ((const String*) tolua_tousertype(tolua_S,2,0));
  617. #ifndef TOLUA_RELEASE
  618. if (!self) tolua_error(tolua_S,"invalid 'self' in function 'SystemOpen'", NULL);
  619. #endif
  620. {
  621. bool tolua_ret = (bool) self->SystemOpen(*fileName);
  622. tolua_pushboolean(tolua_S,(bool)tolua_ret);
  623. }
  624. }
  625. return 1;
  626. #ifndef TOLUA_RELEASE
  627. tolua_lerror:
  628. tolua_error(tolua_S,"#ferror in function 'SystemOpen'.",&tolua_err);
  629. return 0;
  630. #endif
  631. }
  632. #endif //#ifndef TOLUA_DISABLE
  633. /* method: SystemOpen of class FileSystem */
  634. #ifndef TOLUA_DISABLE_tolua_IO_FileSystem_SystemOpen01
  635. static int tolua_IO_FileSystem_SystemOpen01(lua_State* tolua_S)
  636. {
  637. tolua_Error tolua_err;
  638. if (
  639. !tolua_isusertype(tolua_S,1,"FileSystem",0,&tolua_err) ||
  640. (tolua_isvaluenil(tolua_S,2,&tolua_err) || !tolua_isusertype(tolua_S,2,"const String",0,&tolua_err)) ||
  641. (tolua_isvaluenil(tolua_S,3,&tolua_err) || !tolua_isusertype(tolua_S,3,"const String",0,&tolua_err)) ||
  642. !tolua_isnoobj(tolua_S,4,&tolua_err)
  643. )
  644. goto tolua_lerror;
  645. else
  646. {
  647. FileSystem* self = (FileSystem*) tolua_tousertype(tolua_S,1,0);
  648. const String* fileName = ((const String*) tolua_tousertype(tolua_S,2,0));
  649. const String* mode = ((const String*) tolua_tousertype(tolua_S,3,0));
  650. #ifndef TOLUA_RELEASE
  651. if (!self) tolua_error(tolua_S,"invalid 'self' in function 'SystemOpen'", NULL);
  652. #endif
  653. {
  654. bool tolua_ret = (bool) self->SystemOpen(*fileName,*mode);
  655. tolua_pushboolean(tolua_S,(bool)tolua_ret);
  656. }
  657. }
  658. return 1;
  659. tolua_lerror:
  660. return tolua_IO_FileSystem_SystemOpen00(tolua_S);
  661. }
  662. #endif //#ifndef TOLUA_DISABLE
  663. /* method: Copy of class FileSystem */
  664. #ifndef TOLUA_DISABLE_tolua_IO_FileSystem_Copy00
  665. static int tolua_IO_FileSystem_Copy00(lua_State* tolua_S)
  666. {
  667. #ifndef TOLUA_RELEASE
  668. tolua_Error tolua_err;
  669. if (
  670. !tolua_isusertype(tolua_S,1,"FileSystem",0,&tolua_err) ||
  671. (tolua_isvaluenil(tolua_S,2,&tolua_err) || !tolua_isusertype(tolua_S,2,"const String",0,&tolua_err)) ||
  672. (tolua_isvaluenil(tolua_S,3,&tolua_err) || !tolua_isusertype(tolua_S,3,"const String",0,&tolua_err)) ||
  673. !tolua_isnoobj(tolua_S,4,&tolua_err)
  674. )
  675. goto tolua_lerror;
  676. else
  677. #endif
  678. {
  679. FileSystem* self = (FileSystem*) tolua_tousertype(tolua_S,1,0);
  680. const String* srcFileName = ((const String*) tolua_tousertype(tolua_S,2,0));
  681. const String* destFileName = ((const String*) tolua_tousertype(tolua_S,3,0));
  682. #ifndef TOLUA_RELEASE
  683. if (!self) tolua_error(tolua_S,"invalid 'self' in function 'Copy'", NULL);
  684. #endif
  685. {
  686. bool tolua_ret = (bool) self->Copy(*srcFileName,*destFileName);
  687. tolua_pushboolean(tolua_S,(bool)tolua_ret);
  688. }
  689. }
  690. return 1;
  691. #ifndef TOLUA_RELEASE
  692. tolua_lerror:
  693. tolua_error(tolua_S,"#ferror in function 'Copy'.",&tolua_err);
  694. return 0;
  695. #endif
  696. }
  697. #endif //#ifndef TOLUA_DISABLE
  698. /* method: Rename of class FileSystem */
  699. #ifndef TOLUA_DISABLE_tolua_IO_FileSystem_Rename00
  700. static int tolua_IO_FileSystem_Rename00(lua_State* tolua_S)
  701. {
  702. #ifndef TOLUA_RELEASE
  703. tolua_Error tolua_err;
  704. if (
  705. !tolua_isusertype(tolua_S,1,"FileSystem",0,&tolua_err) ||
  706. (tolua_isvaluenil(tolua_S,2,&tolua_err) || !tolua_isusertype(tolua_S,2,"const String",0,&tolua_err)) ||
  707. (tolua_isvaluenil(tolua_S,3,&tolua_err) || !tolua_isusertype(tolua_S,3,"const String",0,&tolua_err)) ||
  708. !tolua_isnoobj(tolua_S,4,&tolua_err)
  709. )
  710. goto tolua_lerror;
  711. else
  712. #endif
  713. {
  714. FileSystem* self = (FileSystem*) tolua_tousertype(tolua_S,1,0);
  715. const String* srcFileName = ((const String*) tolua_tousertype(tolua_S,2,0));
  716. const String* destFileName = ((const String*) tolua_tousertype(tolua_S,3,0));
  717. #ifndef TOLUA_RELEASE
  718. if (!self) tolua_error(tolua_S,"invalid 'self' in function 'Rename'", NULL);
  719. #endif
  720. {
  721. bool tolua_ret = (bool) self->Rename(*srcFileName,*destFileName);
  722. tolua_pushboolean(tolua_S,(bool)tolua_ret);
  723. }
  724. }
  725. return 1;
  726. #ifndef TOLUA_RELEASE
  727. tolua_lerror:
  728. tolua_error(tolua_S,"#ferror in function 'Rename'.",&tolua_err);
  729. return 0;
  730. #endif
  731. }
  732. #endif //#ifndef TOLUA_DISABLE
  733. /* method: Delete of class FileSystem */
  734. #ifndef TOLUA_DISABLE_tolua_IO_FileSystem_Delete00
  735. static int tolua_IO_FileSystem_Delete00(lua_State* tolua_S)
  736. {
  737. #ifndef TOLUA_RELEASE
  738. tolua_Error tolua_err;
  739. if (
  740. !tolua_isusertype(tolua_S,1,"FileSystem",0,&tolua_err) ||
  741. (tolua_isvaluenil(tolua_S,2,&tolua_err) || !tolua_isusertype(tolua_S,2,"const String",0,&tolua_err)) ||
  742. !tolua_isnoobj(tolua_S,3,&tolua_err)
  743. )
  744. goto tolua_lerror;
  745. else
  746. #endif
  747. {
  748. FileSystem* self = (FileSystem*) tolua_tousertype(tolua_S,1,0);
  749. const String* fileName = ((const String*) tolua_tousertype(tolua_S,2,0));
  750. #ifndef TOLUA_RELEASE
  751. if (!self) tolua_error(tolua_S,"invalid 'self' in function 'Delete'", NULL);
  752. #endif
  753. {
  754. bool tolua_ret = (bool) self->Delete(*fileName);
  755. tolua_pushboolean(tolua_S,(bool)tolua_ret);
  756. }
  757. }
  758. return 1;
  759. #ifndef TOLUA_RELEASE
  760. tolua_lerror:
  761. tolua_error(tolua_S,"#ferror in function 'Delete'.",&tolua_err);
  762. return 0;
  763. #endif
  764. }
  765. #endif //#ifndef TOLUA_DISABLE
  766. /* method: RegisterPath of class FileSystem */
  767. #ifndef TOLUA_DISABLE_tolua_IO_FileSystem_RegisterPath00
  768. static int tolua_IO_FileSystem_RegisterPath00(lua_State* tolua_S)
  769. {
  770. #ifndef TOLUA_RELEASE
  771. tolua_Error tolua_err;
  772. if (
  773. !tolua_isusertype(tolua_S,1,"FileSystem",0,&tolua_err) ||
  774. (tolua_isvaluenil(tolua_S,2,&tolua_err) || !tolua_isusertype(tolua_S,2,"const String",0,&tolua_err)) ||
  775. !tolua_isnoobj(tolua_S,3,&tolua_err)
  776. )
  777. goto tolua_lerror;
  778. else
  779. #endif
  780. {
  781. FileSystem* self = (FileSystem*) tolua_tousertype(tolua_S,1,0);
  782. const String* pathName = ((const String*) tolua_tousertype(tolua_S,2,0));
  783. #ifndef TOLUA_RELEASE
  784. if (!self) tolua_error(tolua_S,"invalid 'self' in function 'RegisterPath'", NULL);
  785. #endif
  786. {
  787. self->RegisterPath(*pathName);
  788. }
  789. }
  790. return 0;
  791. #ifndef TOLUA_RELEASE
  792. tolua_lerror:
  793. tolua_error(tolua_S,"#ferror in function 'RegisterPath'.",&tolua_err);
  794. return 0;
  795. #endif
  796. }
  797. #endif //#ifndef TOLUA_DISABLE
  798. /* method: GetCurrentDir of class FileSystem */
  799. #ifndef TOLUA_DISABLE_tolua_IO_FileSystem_GetCurrentDir00
  800. static int tolua_IO_FileSystem_GetCurrentDir00(lua_State* tolua_S)
  801. {
  802. #ifndef TOLUA_RELEASE
  803. tolua_Error tolua_err;
  804. if (
  805. !tolua_isusertype(tolua_S,1,"const FileSystem",0,&tolua_err) ||
  806. !tolua_isnoobj(tolua_S,2,&tolua_err)
  807. )
  808. goto tolua_lerror;
  809. else
  810. #endif
  811. {
  812. const FileSystem* self = (const FileSystem*) tolua_tousertype(tolua_S,1,0);
  813. #ifndef TOLUA_RELEASE
  814. if (!self) tolua_error(tolua_S,"invalid 'self' in function 'GetCurrentDir'", NULL);
  815. #endif
  816. {
  817. String tolua_ret = (String) self->GetCurrentDir();
  818. {
  819. #ifdef __cplusplus
  820. void* tolua_obj = Mtolua_new((String)(tolua_ret));
  821. tolua_pushusertype(tolua_S,tolua_obj,"String");
  822. tolua_register_gc(tolua_S,lua_gettop(tolua_S));
  823. #else
  824. void* tolua_obj = tolua_copy(tolua_S,(void*)&tolua_ret,sizeof(String));
  825. tolua_pushusertype(tolua_S,tolua_obj,"String");
  826. tolua_register_gc(tolua_S,lua_gettop(tolua_S));
  827. #endif
  828. }
  829. }
  830. }
  831. return 1;
  832. #ifndef TOLUA_RELEASE
  833. tolua_lerror:
  834. tolua_error(tolua_S,"#ferror in function 'GetCurrentDir'.",&tolua_err);
  835. return 0;
  836. #endif
  837. }
  838. #endif //#ifndef TOLUA_DISABLE
  839. /* method: HasRegisteredPaths of class FileSystem */
  840. #ifndef TOLUA_DISABLE_tolua_IO_FileSystem_HasRegisteredPaths00
  841. static int tolua_IO_FileSystem_HasRegisteredPaths00(lua_State* tolua_S)
  842. {
  843. #ifndef TOLUA_RELEASE
  844. tolua_Error tolua_err;
  845. if (
  846. !tolua_isusertype(tolua_S,1,"const FileSystem",0,&tolua_err) ||
  847. !tolua_isnoobj(tolua_S,2,&tolua_err)
  848. )
  849. goto tolua_lerror;
  850. else
  851. #endif
  852. {
  853. const FileSystem* self = (const FileSystem*) tolua_tousertype(tolua_S,1,0);
  854. #ifndef TOLUA_RELEASE
  855. if (!self) tolua_error(tolua_S,"invalid 'self' in function 'HasRegisteredPaths'", NULL);
  856. #endif
  857. {
  858. bool tolua_ret = (bool) self->HasRegisteredPaths();
  859. tolua_pushboolean(tolua_S,(bool)tolua_ret);
  860. }
  861. }
  862. return 1;
  863. #ifndef TOLUA_RELEASE
  864. tolua_lerror:
  865. tolua_error(tolua_S,"#ferror in function 'HasRegisteredPaths'.",&tolua_err);
  866. return 0;
  867. #endif
  868. }
  869. #endif //#ifndef TOLUA_DISABLE
  870. /* method: CheckAccess of class FileSystem */
  871. #ifndef TOLUA_DISABLE_tolua_IO_FileSystem_CheckAccess00
  872. static int tolua_IO_FileSystem_CheckAccess00(lua_State* tolua_S)
  873. {
  874. #ifndef TOLUA_RELEASE
  875. tolua_Error tolua_err;
  876. if (
  877. !tolua_isusertype(tolua_S,1,"const FileSystem",0,&tolua_err) ||
  878. (tolua_isvaluenil(tolua_S,2,&tolua_err) || !tolua_isusertype(tolua_S,2,"const String",0,&tolua_err)) ||
  879. !tolua_isnoobj(tolua_S,3,&tolua_err)
  880. )
  881. goto tolua_lerror;
  882. else
  883. #endif
  884. {
  885. const FileSystem* self = (const FileSystem*) tolua_tousertype(tolua_S,1,0);
  886. const String* pathName = ((const String*) tolua_tousertype(tolua_S,2,0));
  887. #ifndef TOLUA_RELEASE
  888. if (!self) tolua_error(tolua_S,"invalid 'self' in function 'CheckAccess'", NULL);
  889. #endif
  890. {
  891. bool tolua_ret = (bool) self->CheckAccess(*pathName);
  892. tolua_pushboolean(tolua_S,(bool)tolua_ret);
  893. }
  894. }
  895. return 1;
  896. #ifndef TOLUA_RELEASE
  897. tolua_lerror:
  898. tolua_error(tolua_S,"#ferror in function 'CheckAccess'.",&tolua_err);
  899. return 0;
  900. #endif
  901. }
  902. #endif //#ifndef TOLUA_DISABLE
  903. /* method: GetLastModifiedTime of class FileSystem */
  904. #ifndef TOLUA_DISABLE_tolua_IO_FileSystem_GetLastModifiedTime00
  905. static int tolua_IO_FileSystem_GetLastModifiedTime00(lua_State* tolua_S)
  906. {
  907. #ifndef TOLUA_RELEASE
  908. tolua_Error tolua_err;
  909. if (
  910. !tolua_isusertype(tolua_S,1,"const FileSystem",0,&tolua_err) ||
  911. (tolua_isvaluenil(tolua_S,2,&tolua_err) || !tolua_isusertype(tolua_S,2,"const String",0,&tolua_err)) ||
  912. !tolua_isnoobj(tolua_S,3,&tolua_err)
  913. )
  914. goto tolua_lerror;
  915. else
  916. #endif
  917. {
  918. const FileSystem* self = (const FileSystem*) tolua_tousertype(tolua_S,1,0);
  919. const String* fileName = ((const String*) tolua_tousertype(tolua_S,2,0));
  920. #ifndef TOLUA_RELEASE
  921. if (!self) tolua_error(tolua_S,"invalid 'self' in function 'GetLastModifiedTime'", NULL);
  922. #endif
  923. {
  924. unsigned tolua_ret = (unsigned) self->GetLastModifiedTime(*fileName);
  925. tolua_pushnumber(tolua_S,(lua_Number)tolua_ret);
  926. }
  927. }
  928. return 1;
  929. #ifndef TOLUA_RELEASE
  930. tolua_lerror:
  931. tolua_error(tolua_S,"#ferror in function 'GetLastModifiedTime'.",&tolua_err);
  932. return 0;
  933. #endif
  934. }
  935. #endif //#ifndef TOLUA_DISABLE
  936. /* method: FileExists of class FileSystem */
  937. #ifndef TOLUA_DISABLE_tolua_IO_FileSystem_FileExists00
  938. static int tolua_IO_FileSystem_FileExists00(lua_State* tolua_S)
  939. {
  940. #ifndef TOLUA_RELEASE
  941. tolua_Error tolua_err;
  942. if (
  943. !tolua_isusertype(tolua_S,1,"const FileSystem",0,&tolua_err) ||
  944. (tolua_isvaluenil(tolua_S,2,&tolua_err) || !tolua_isusertype(tolua_S,2,"const String",0,&tolua_err)) ||
  945. !tolua_isnoobj(tolua_S,3,&tolua_err)
  946. )
  947. goto tolua_lerror;
  948. else
  949. #endif
  950. {
  951. const FileSystem* self = (const FileSystem*) tolua_tousertype(tolua_S,1,0);
  952. const String* fileName = ((const String*) tolua_tousertype(tolua_S,2,0));
  953. #ifndef TOLUA_RELEASE
  954. if (!self) tolua_error(tolua_S,"invalid 'self' in function 'FileExists'", NULL);
  955. #endif
  956. {
  957. bool tolua_ret = (bool) self->FileExists(*fileName);
  958. tolua_pushboolean(tolua_S,(bool)tolua_ret);
  959. }
  960. }
  961. return 1;
  962. #ifndef TOLUA_RELEASE
  963. tolua_lerror:
  964. tolua_error(tolua_S,"#ferror in function 'FileExists'.",&tolua_err);
  965. return 0;
  966. #endif
  967. }
  968. #endif //#ifndef TOLUA_DISABLE
  969. /* method: DirExists of class FileSystem */
  970. #ifndef TOLUA_DISABLE_tolua_IO_FileSystem_DirExists00
  971. static int tolua_IO_FileSystem_DirExists00(lua_State* tolua_S)
  972. {
  973. #ifndef TOLUA_RELEASE
  974. tolua_Error tolua_err;
  975. if (
  976. !tolua_isusertype(tolua_S,1,"const FileSystem",0,&tolua_err) ||
  977. (tolua_isvaluenil(tolua_S,2,&tolua_err) || !tolua_isusertype(tolua_S,2,"const String",0,&tolua_err)) ||
  978. !tolua_isnoobj(tolua_S,3,&tolua_err)
  979. )
  980. goto tolua_lerror;
  981. else
  982. #endif
  983. {
  984. const FileSystem* self = (const FileSystem*) tolua_tousertype(tolua_S,1,0);
  985. const String* pathName = ((const String*) tolua_tousertype(tolua_S,2,0));
  986. #ifndef TOLUA_RELEASE
  987. if (!self) tolua_error(tolua_S,"invalid 'self' in function 'DirExists'", NULL);
  988. #endif
  989. {
  990. bool tolua_ret = (bool) self->DirExists(*pathName);
  991. tolua_pushboolean(tolua_S,(bool)tolua_ret);
  992. }
  993. }
  994. return 1;
  995. #ifndef TOLUA_RELEASE
  996. tolua_lerror:
  997. tolua_error(tolua_S,"#ferror in function 'DirExists'.",&tolua_err);
  998. return 0;
  999. #endif
  1000. }
  1001. #endif //#ifndef TOLUA_DISABLE
  1002. /* method: GetProgramDir of class FileSystem */
  1003. #ifndef TOLUA_DISABLE_tolua_IO_FileSystem_GetProgramDir00
  1004. static int tolua_IO_FileSystem_GetProgramDir00(lua_State* tolua_S)
  1005. {
  1006. #ifndef TOLUA_RELEASE
  1007. tolua_Error tolua_err;
  1008. if (
  1009. !tolua_isusertype(tolua_S,1,"const FileSystem",0,&tolua_err) ||
  1010. !tolua_isnoobj(tolua_S,2,&tolua_err)
  1011. )
  1012. goto tolua_lerror;
  1013. else
  1014. #endif
  1015. {
  1016. const FileSystem* self = (const FileSystem*) tolua_tousertype(tolua_S,1,0);
  1017. #ifndef TOLUA_RELEASE
  1018. if (!self) tolua_error(tolua_S,"invalid 'self' in function 'GetProgramDir'", NULL);
  1019. #endif
  1020. {
  1021. String tolua_ret = (String) self->GetProgramDir();
  1022. {
  1023. #ifdef __cplusplus
  1024. void* tolua_obj = Mtolua_new((String)(tolua_ret));
  1025. tolua_pushusertype(tolua_S,tolua_obj,"String");
  1026. tolua_register_gc(tolua_S,lua_gettop(tolua_S));
  1027. #else
  1028. void* tolua_obj = tolua_copy(tolua_S,(void*)&tolua_ret,sizeof(String));
  1029. tolua_pushusertype(tolua_S,tolua_obj,"String");
  1030. tolua_register_gc(tolua_S,lua_gettop(tolua_S));
  1031. #endif
  1032. }
  1033. }
  1034. }
  1035. return 1;
  1036. #ifndef TOLUA_RELEASE
  1037. tolua_lerror:
  1038. tolua_error(tolua_S,"#ferror in function 'GetProgramDir'.",&tolua_err);
  1039. return 0;
  1040. #endif
  1041. }
  1042. #endif //#ifndef TOLUA_DISABLE
  1043. /* method: GetUserDocumentsDir of class FileSystem */
  1044. #ifndef TOLUA_DISABLE_tolua_IO_FileSystem_GetUserDocumentsDir00
  1045. static int tolua_IO_FileSystem_GetUserDocumentsDir00(lua_State* tolua_S)
  1046. {
  1047. #ifndef TOLUA_RELEASE
  1048. tolua_Error tolua_err;
  1049. if (
  1050. !tolua_isusertype(tolua_S,1,"const FileSystem",0,&tolua_err) ||
  1051. !tolua_isnoobj(tolua_S,2,&tolua_err)
  1052. )
  1053. goto tolua_lerror;
  1054. else
  1055. #endif
  1056. {
  1057. const FileSystem* self = (const FileSystem*) tolua_tousertype(tolua_S,1,0);
  1058. #ifndef TOLUA_RELEASE
  1059. if (!self) tolua_error(tolua_S,"invalid 'self' in function 'GetUserDocumentsDir'", NULL);
  1060. #endif
  1061. {
  1062. String tolua_ret = (String) self->GetUserDocumentsDir();
  1063. {
  1064. #ifdef __cplusplus
  1065. void* tolua_obj = Mtolua_new((String)(tolua_ret));
  1066. tolua_pushusertype(tolua_S,tolua_obj,"String");
  1067. tolua_register_gc(tolua_S,lua_gettop(tolua_S));
  1068. #else
  1069. void* tolua_obj = tolua_copy(tolua_S,(void*)&tolua_ret,sizeof(String));
  1070. tolua_pushusertype(tolua_S,tolua_obj,"String");
  1071. tolua_register_gc(tolua_S,lua_gettop(tolua_S));
  1072. #endif
  1073. }
  1074. }
  1075. }
  1076. return 1;
  1077. #ifndef TOLUA_RELEASE
  1078. tolua_lerror:
  1079. tolua_error(tolua_S,"#ferror in function 'GetUserDocumentsDir'.",&tolua_err);
  1080. return 0;
  1081. #endif
  1082. }
  1083. #endif //#ifndef TOLUA_DISABLE
  1084. /* function: GetFileSystem */
  1085. #ifndef TOLUA_DISABLE_tolua_IO_GetFileSystem00
  1086. static int tolua_IO_GetFileSystem00(lua_State* tolua_S)
  1087. {
  1088. #ifndef TOLUA_RELEASE
  1089. tolua_Error tolua_err;
  1090. if (
  1091. !tolua_isnoobj(tolua_S,1,&tolua_err)
  1092. )
  1093. goto tolua_lerror;
  1094. else
  1095. #endif
  1096. {
  1097. {
  1098. FileSystem* tolua_ret = (FileSystem*) GetFileSystem();
  1099. tolua_pushusertype(tolua_S,(void*)tolua_ret,"FileSystem");
  1100. }
  1101. }
  1102. return 1;
  1103. #ifndef TOLUA_RELEASE
  1104. tolua_lerror:
  1105. tolua_error(tolua_S,"#ferror in function 'GetFileSystem'.",&tolua_err);
  1106. return 0;
  1107. #endif
  1108. }
  1109. #endif //#ifndef TOLUA_DISABLE
  1110. /* function: SplitPath */
  1111. #ifndef TOLUA_DISABLE_tolua_IO_SplitPath00
  1112. static int tolua_IO_SplitPath00(lua_State* tolua_S)
  1113. {
  1114. #ifndef TOLUA_RELEASE
  1115. tolua_Error tolua_err;
  1116. if (
  1117. (tolua_isvaluenil(tolua_S,1,&tolua_err) || !tolua_isusertype(tolua_S,1,"const String",0,&tolua_err)) ||
  1118. (tolua_isvaluenil(tolua_S,2,&tolua_err) || !tolua_isusertype(tolua_S,2,"String",0,&tolua_err)) ||
  1119. (tolua_isvaluenil(tolua_S,3,&tolua_err) || !tolua_isusertype(tolua_S,3,"String",0,&tolua_err)) ||
  1120. (tolua_isvaluenil(tolua_S,4,&tolua_err) || !tolua_isusertype(tolua_S,4,"String",0,&tolua_err)) ||
  1121. !tolua_isnoobj(tolua_S,5,&tolua_err)
  1122. )
  1123. goto tolua_lerror;
  1124. else
  1125. #endif
  1126. {
  1127. const String* fullPath = ((const String*) tolua_tousertype(tolua_S,1,0));
  1128. String* pathName = ((String*) tolua_tousertype(tolua_S,2,0));
  1129. String* fileName = ((String*) tolua_tousertype(tolua_S,3,0));
  1130. String* extension = ((String*) tolua_tousertype(tolua_S,4,0));
  1131. {
  1132. SplitPath(*fullPath,*pathName,*fileName,*extension);
  1133. }
  1134. }
  1135. return 0;
  1136. #ifndef TOLUA_RELEASE
  1137. tolua_lerror:
  1138. tolua_error(tolua_S,"#ferror in function 'SplitPath'.",&tolua_err);
  1139. return 0;
  1140. #endif
  1141. }
  1142. #endif //#ifndef TOLUA_DISABLE
  1143. /* function: GetPath */
  1144. #ifndef TOLUA_DISABLE_tolua_IO_GetPath00
  1145. static int tolua_IO_GetPath00(lua_State* tolua_S)
  1146. {
  1147. #ifndef TOLUA_RELEASE
  1148. tolua_Error tolua_err;
  1149. if (
  1150. (tolua_isvaluenil(tolua_S,1,&tolua_err) || !tolua_isusertype(tolua_S,1,"const String",0,&tolua_err)) ||
  1151. !tolua_isnoobj(tolua_S,2,&tolua_err)
  1152. )
  1153. goto tolua_lerror;
  1154. else
  1155. #endif
  1156. {
  1157. const String* fullPath = ((const String*) tolua_tousertype(tolua_S,1,0));
  1158. {
  1159. String tolua_ret = (String) GetPath(*fullPath);
  1160. {
  1161. #ifdef __cplusplus
  1162. void* tolua_obj = Mtolua_new((String)(tolua_ret));
  1163. tolua_pushusertype(tolua_S,tolua_obj,"String");
  1164. tolua_register_gc(tolua_S,lua_gettop(tolua_S));
  1165. #else
  1166. void* tolua_obj = tolua_copy(tolua_S,(void*)&tolua_ret,sizeof(String));
  1167. tolua_pushusertype(tolua_S,tolua_obj,"String");
  1168. tolua_register_gc(tolua_S,lua_gettop(tolua_S));
  1169. #endif
  1170. }
  1171. }
  1172. }
  1173. return 1;
  1174. #ifndef TOLUA_RELEASE
  1175. tolua_lerror:
  1176. tolua_error(tolua_S,"#ferror in function 'GetPath'.",&tolua_err);
  1177. return 0;
  1178. #endif
  1179. }
  1180. #endif //#ifndef TOLUA_DISABLE
  1181. /* function: GetFileName */
  1182. #ifndef TOLUA_DISABLE_tolua_IO_GetFileName00
  1183. static int tolua_IO_GetFileName00(lua_State* tolua_S)
  1184. {
  1185. #ifndef TOLUA_RELEASE
  1186. tolua_Error tolua_err;
  1187. if (
  1188. (tolua_isvaluenil(tolua_S,1,&tolua_err) || !tolua_isusertype(tolua_S,1,"const String",0,&tolua_err)) ||
  1189. !tolua_isnoobj(tolua_S,2,&tolua_err)
  1190. )
  1191. goto tolua_lerror;
  1192. else
  1193. #endif
  1194. {
  1195. const String* fullPath = ((const String*) tolua_tousertype(tolua_S,1,0));
  1196. {
  1197. String tolua_ret = (String) GetFileName(*fullPath);
  1198. {
  1199. #ifdef __cplusplus
  1200. void* tolua_obj = Mtolua_new((String)(tolua_ret));
  1201. tolua_pushusertype(tolua_S,tolua_obj,"String");
  1202. tolua_register_gc(tolua_S,lua_gettop(tolua_S));
  1203. #else
  1204. void* tolua_obj = tolua_copy(tolua_S,(void*)&tolua_ret,sizeof(String));
  1205. tolua_pushusertype(tolua_S,tolua_obj,"String");
  1206. tolua_register_gc(tolua_S,lua_gettop(tolua_S));
  1207. #endif
  1208. }
  1209. }
  1210. }
  1211. return 1;
  1212. #ifndef TOLUA_RELEASE
  1213. tolua_lerror:
  1214. tolua_error(tolua_S,"#ferror in function 'GetFileName'.",&tolua_err);
  1215. return 0;
  1216. #endif
  1217. }
  1218. #endif //#ifndef TOLUA_DISABLE
  1219. /* function: GetExtension */
  1220. #ifndef TOLUA_DISABLE_tolua_IO_GetExtension00
  1221. static int tolua_IO_GetExtension00(lua_State* tolua_S)
  1222. {
  1223. #ifndef TOLUA_RELEASE
  1224. tolua_Error tolua_err;
  1225. if (
  1226. (tolua_isvaluenil(tolua_S,1,&tolua_err) || !tolua_isusertype(tolua_S,1,"const String",0,&tolua_err)) ||
  1227. !tolua_isnoobj(tolua_S,2,&tolua_err)
  1228. )
  1229. goto tolua_lerror;
  1230. else
  1231. #endif
  1232. {
  1233. const String* fullPath = ((const String*) tolua_tousertype(tolua_S,1,0));
  1234. {
  1235. String tolua_ret = (String) GetExtension(*fullPath);
  1236. {
  1237. #ifdef __cplusplus
  1238. void* tolua_obj = Mtolua_new((String)(tolua_ret));
  1239. tolua_pushusertype(tolua_S,tolua_obj,"String");
  1240. tolua_register_gc(tolua_S,lua_gettop(tolua_S));
  1241. #else
  1242. void* tolua_obj = tolua_copy(tolua_S,(void*)&tolua_ret,sizeof(String));
  1243. tolua_pushusertype(tolua_S,tolua_obj,"String");
  1244. tolua_register_gc(tolua_S,lua_gettop(tolua_S));
  1245. #endif
  1246. }
  1247. }
  1248. }
  1249. return 1;
  1250. #ifndef TOLUA_RELEASE
  1251. tolua_lerror:
  1252. tolua_error(tolua_S,"#ferror in function 'GetExtension'.",&tolua_err);
  1253. return 0;
  1254. #endif
  1255. }
  1256. #endif //#ifndef TOLUA_DISABLE
  1257. /* function: GetFileNameAndExtension */
  1258. #ifndef TOLUA_DISABLE_tolua_IO_GetFileNameAndExtension00
  1259. static int tolua_IO_GetFileNameAndExtension00(lua_State* tolua_S)
  1260. {
  1261. #ifndef TOLUA_RELEASE
  1262. tolua_Error tolua_err;
  1263. if (
  1264. (tolua_isvaluenil(tolua_S,1,&tolua_err) || !tolua_isusertype(tolua_S,1,"const String",0,&tolua_err)) ||
  1265. !tolua_isnoobj(tolua_S,2,&tolua_err)
  1266. )
  1267. goto tolua_lerror;
  1268. else
  1269. #endif
  1270. {
  1271. const String* fullPath = ((const String*) tolua_tousertype(tolua_S,1,0));
  1272. {
  1273. String tolua_ret = (String) GetFileNameAndExtension(*fullPath);
  1274. {
  1275. #ifdef __cplusplus
  1276. void* tolua_obj = Mtolua_new((String)(tolua_ret));
  1277. tolua_pushusertype(tolua_S,tolua_obj,"String");
  1278. tolua_register_gc(tolua_S,lua_gettop(tolua_S));
  1279. #else
  1280. void* tolua_obj = tolua_copy(tolua_S,(void*)&tolua_ret,sizeof(String));
  1281. tolua_pushusertype(tolua_S,tolua_obj,"String");
  1282. tolua_register_gc(tolua_S,lua_gettop(tolua_S));
  1283. #endif
  1284. }
  1285. }
  1286. }
  1287. return 1;
  1288. #ifndef TOLUA_RELEASE
  1289. tolua_lerror:
  1290. tolua_error(tolua_S,"#ferror in function 'GetFileNameAndExtension'.",&tolua_err);
  1291. return 0;
  1292. #endif
  1293. }
  1294. #endif //#ifndef TOLUA_DISABLE
  1295. /* function: ReplaceExtension */
  1296. #ifndef TOLUA_DISABLE_tolua_IO_ReplaceExtension00
  1297. static int tolua_IO_ReplaceExtension00(lua_State* tolua_S)
  1298. {
  1299. #ifndef TOLUA_RELEASE
  1300. tolua_Error tolua_err;
  1301. if (
  1302. (tolua_isvaluenil(tolua_S,1,&tolua_err) || !tolua_isusertype(tolua_S,1,"const String",0,&tolua_err)) ||
  1303. (tolua_isvaluenil(tolua_S,2,&tolua_err) || !tolua_isusertype(tolua_S,2,"const String",0,&tolua_err)) ||
  1304. !tolua_isnoobj(tolua_S,3,&tolua_err)
  1305. )
  1306. goto tolua_lerror;
  1307. else
  1308. #endif
  1309. {
  1310. const String* fullPath = ((const String*) tolua_tousertype(tolua_S,1,0));
  1311. const String* newExtension = ((const String*) tolua_tousertype(tolua_S,2,0));
  1312. {
  1313. String tolua_ret = (String) ReplaceExtension(*fullPath,*newExtension);
  1314. {
  1315. #ifdef __cplusplus
  1316. void* tolua_obj = Mtolua_new((String)(tolua_ret));
  1317. tolua_pushusertype(tolua_S,tolua_obj,"String");
  1318. tolua_register_gc(tolua_S,lua_gettop(tolua_S));
  1319. #else
  1320. void* tolua_obj = tolua_copy(tolua_S,(void*)&tolua_ret,sizeof(String));
  1321. tolua_pushusertype(tolua_S,tolua_obj,"String");
  1322. tolua_register_gc(tolua_S,lua_gettop(tolua_S));
  1323. #endif
  1324. }
  1325. }
  1326. }
  1327. return 1;
  1328. #ifndef TOLUA_RELEASE
  1329. tolua_lerror:
  1330. tolua_error(tolua_S,"#ferror in function 'ReplaceExtension'.",&tolua_err);
  1331. return 0;
  1332. #endif
  1333. }
  1334. #endif //#ifndef TOLUA_DISABLE
  1335. /* function: AddTrailingSlash */
  1336. #ifndef TOLUA_DISABLE_tolua_IO_AddTrailingSlash00
  1337. static int tolua_IO_AddTrailingSlash00(lua_State* tolua_S)
  1338. {
  1339. #ifndef TOLUA_RELEASE
  1340. tolua_Error tolua_err;
  1341. if (
  1342. (tolua_isvaluenil(tolua_S,1,&tolua_err) || !tolua_isusertype(tolua_S,1,"const String",0,&tolua_err)) ||
  1343. !tolua_isnoobj(tolua_S,2,&tolua_err)
  1344. )
  1345. goto tolua_lerror;
  1346. else
  1347. #endif
  1348. {
  1349. const String* pathName = ((const String*) tolua_tousertype(tolua_S,1,0));
  1350. {
  1351. String tolua_ret = (String) AddTrailingSlash(*pathName);
  1352. {
  1353. #ifdef __cplusplus
  1354. void* tolua_obj = Mtolua_new((String)(tolua_ret));
  1355. tolua_pushusertype(tolua_S,tolua_obj,"String");
  1356. tolua_register_gc(tolua_S,lua_gettop(tolua_S));
  1357. #else
  1358. void* tolua_obj = tolua_copy(tolua_S,(void*)&tolua_ret,sizeof(String));
  1359. tolua_pushusertype(tolua_S,tolua_obj,"String");
  1360. tolua_register_gc(tolua_S,lua_gettop(tolua_S));
  1361. #endif
  1362. }
  1363. }
  1364. }
  1365. return 1;
  1366. #ifndef TOLUA_RELEASE
  1367. tolua_lerror:
  1368. tolua_error(tolua_S,"#ferror in function 'AddTrailingSlash'.",&tolua_err);
  1369. return 0;
  1370. #endif
  1371. }
  1372. #endif //#ifndef TOLUA_DISABLE
  1373. /* function: RemoveTrailingSlash */
  1374. #ifndef TOLUA_DISABLE_tolua_IO_RemoveTrailingSlash00
  1375. static int tolua_IO_RemoveTrailingSlash00(lua_State* tolua_S)
  1376. {
  1377. #ifndef TOLUA_RELEASE
  1378. tolua_Error tolua_err;
  1379. if (
  1380. (tolua_isvaluenil(tolua_S,1,&tolua_err) || !tolua_isusertype(tolua_S,1,"const String",0,&tolua_err)) ||
  1381. !tolua_isnoobj(tolua_S,2,&tolua_err)
  1382. )
  1383. goto tolua_lerror;
  1384. else
  1385. #endif
  1386. {
  1387. const String* pathName = ((const String*) tolua_tousertype(tolua_S,1,0));
  1388. {
  1389. String tolua_ret = (String) RemoveTrailingSlash(*pathName);
  1390. {
  1391. #ifdef __cplusplus
  1392. void* tolua_obj = Mtolua_new((String)(tolua_ret));
  1393. tolua_pushusertype(tolua_S,tolua_obj,"String");
  1394. tolua_register_gc(tolua_S,lua_gettop(tolua_S));
  1395. #else
  1396. void* tolua_obj = tolua_copy(tolua_S,(void*)&tolua_ret,sizeof(String));
  1397. tolua_pushusertype(tolua_S,tolua_obj,"String");
  1398. tolua_register_gc(tolua_S,lua_gettop(tolua_S));
  1399. #endif
  1400. }
  1401. }
  1402. }
  1403. return 1;
  1404. #ifndef TOLUA_RELEASE
  1405. tolua_lerror:
  1406. tolua_error(tolua_S,"#ferror in function 'RemoveTrailingSlash'.",&tolua_err);
  1407. return 0;
  1408. #endif
  1409. }
  1410. #endif //#ifndef TOLUA_DISABLE
  1411. /* function: GetParentPath */
  1412. #ifndef TOLUA_DISABLE_tolua_IO_GetParentPath00
  1413. static int tolua_IO_GetParentPath00(lua_State* tolua_S)
  1414. {
  1415. #ifndef TOLUA_RELEASE
  1416. tolua_Error tolua_err;
  1417. if (
  1418. (tolua_isvaluenil(tolua_S,1,&tolua_err) || !tolua_isusertype(tolua_S,1,"const String",0,&tolua_err)) ||
  1419. !tolua_isnoobj(tolua_S,2,&tolua_err)
  1420. )
  1421. goto tolua_lerror;
  1422. else
  1423. #endif
  1424. {
  1425. const String* pathName = ((const String*) tolua_tousertype(tolua_S,1,0));
  1426. {
  1427. String tolua_ret = (String) GetParentPath(*pathName);
  1428. {
  1429. #ifdef __cplusplus
  1430. void* tolua_obj = Mtolua_new((String)(tolua_ret));
  1431. tolua_pushusertype(tolua_S,tolua_obj,"String");
  1432. tolua_register_gc(tolua_S,lua_gettop(tolua_S));
  1433. #else
  1434. void* tolua_obj = tolua_copy(tolua_S,(void*)&tolua_ret,sizeof(String));
  1435. tolua_pushusertype(tolua_S,tolua_obj,"String");
  1436. tolua_register_gc(tolua_S,lua_gettop(tolua_S));
  1437. #endif
  1438. }
  1439. }
  1440. }
  1441. return 1;
  1442. #ifndef TOLUA_RELEASE
  1443. tolua_lerror:
  1444. tolua_error(tolua_S,"#ferror in function 'GetParentPath'.",&tolua_err);
  1445. return 0;
  1446. #endif
  1447. }
  1448. #endif //#ifndef TOLUA_DISABLE
  1449. /* function: GetInternalPath */
  1450. #ifndef TOLUA_DISABLE_tolua_IO_GetInternalPath00
  1451. static int tolua_IO_GetInternalPath00(lua_State* tolua_S)
  1452. {
  1453. #ifndef TOLUA_RELEASE
  1454. tolua_Error tolua_err;
  1455. if (
  1456. (tolua_isvaluenil(tolua_S,1,&tolua_err) || !tolua_isusertype(tolua_S,1,"const String",0,&tolua_err)) ||
  1457. !tolua_isnoobj(tolua_S,2,&tolua_err)
  1458. )
  1459. goto tolua_lerror;
  1460. else
  1461. #endif
  1462. {
  1463. const String* pathName = ((const String*) tolua_tousertype(tolua_S,1,0));
  1464. {
  1465. String tolua_ret = (String) GetInternalPath(*pathName);
  1466. {
  1467. #ifdef __cplusplus
  1468. void* tolua_obj = Mtolua_new((String)(tolua_ret));
  1469. tolua_pushusertype(tolua_S,tolua_obj,"String");
  1470. tolua_register_gc(tolua_S,lua_gettop(tolua_S));
  1471. #else
  1472. void* tolua_obj = tolua_copy(tolua_S,(void*)&tolua_ret,sizeof(String));
  1473. tolua_pushusertype(tolua_S,tolua_obj,"String");
  1474. tolua_register_gc(tolua_S,lua_gettop(tolua_S));
  1475. #endif
  1476. }
  1477. }
  1478. }
  1479. return 1;
  1480. #ifndef TOLUA_RELEASE
  1481. tolua_lerror:
  1482. tolua_error(tolua_S,"#ferror in function 'GetInternalPath'.",&tolua_err);
  1483. return 0;
  1484. #endif
  1485. }
  1486. #endif //#ifndef TOLUA_DISABLE
  1487. /* function: GetNativePath */
  1488. #ifndef TOLUA_DISABLE_tolua_IO_GetNativePath00
  1489. static int tolua_IO_GetNativePath00(lua_State* tolua_S)
  1490. {
  1491. #ifndef TOLUA_RELEASE
  1492. tolua_Error tolua_err;
  1493. if (
  1494. (tolua_isvaluenil(tolua_S,1,&tolua_err) || !tolua_isusertype(tolua_S,1,"const String",0,&tolua_err)) ||
  1495. !tolua_isnoobj(tolua_S,2,&tolua_err)
  1496. )
  1497. goto tolua_lerror;
  1498. else
  1499. #endif
  1500. {
  1501. const String* pathName = ((const String*) tolua_tousertype(tolua_S,1,0));
  1502. {
  1503. String tolua_ret = (String) GetNativePath(*pathName);
  1504. {
  1505. #ifdef __cplusplus
  1506. void* tolua_obj = Mtolua_new((String)(tolua_ret));
  1507. tolua_pushusertype(tolua_S,tolua_obj,"String");
  1508. tolua_register_gc(tolua_S,lua_gettop(tolua_S));
  1509. #else
  1510. void* tolua_obj = tolua_copy(tolua_S,(void*)&tolua_ret,sizeof(String));
  1511. tolua_pushusertype(tolua_S,tolua_obj,"String");
  1512. tolua_register_gc(tolua_S,lua_gettop(tolua_S));
  1513. #endif
  1514. }
  1515. }
  1516. }
  1517. return 1;
  1518. #ifndef TOLUA_RELEASE
  1519. tolua_lerror:
  1520. tolua_error(tolua_S,"#ferror in function 'GetNativePath'.",&tolua_err);
  1521. return 0;
  1522. #endif
  1523. }
  1524. #endif //#ifndef TOLUA_DISABLE
  1525. /* get function: LOG_DEBUG */
  1526. #ifndef TOLUA_DISABLE_tolua_get_LOG_DEBUG
  1527. static int tolua_get_LOG_DEBUG(lua_State* tolua_S)
  1528. {
  1529. tolua_pushnumber(tolua_S,(lua_Number)LOG_DEBUG);
  1530. return 1;
  1531. }
  1532. #endif //#ifndef TOLUA_DISABLE
  1533. /* get function: LOG_INFO */
  1534. #ifndef TOLUA_DISABLE_tolua_get_LOG_INFO
  1535. static int tolua_get_LOG_INFO(lua_State* tolua_S)
  1536. {
  1537. tolua_pushnumber(tolua_S,(lua_Number)LOG_INFO);
  1538. return 1;
  1539. }
  1540. #endif //#ifndef TOLUA_DISABLE
  1541. /* get function: LOG_WARNING */
  1542. #ifndef TOLUA_DISABLE_tolua_get_LOG_WARNING
  1543. static int tolua_get_LOG_WARNING(lua_State* tolua_S)
  1544. {
  1545. tolua_pushnumber(tolua_S,(lua_Number)LOG_WARNING);
  1546. return 1;
  1547. }
  1548. #endif //#ifndef TOLUA_DISABLE
  1549. /* get function: LOG_ERROR */
  1550. #ifndef TOLUA_DISABLE_tolua_get_LOG_ERROR
  1551. static int tolua_get_LOG_ERROR(lua_State* tolua_S)
  1552. {
  1553. tolua_pushnumber(tolua_S,(lua_Number)LOG_ERROR);
  1554. return 1;
  1555. }
  1556. #endif //#ifndef TOLUA_DISABLE
  1557. /* get function: LOG_NONE */
  1558. #ifndef TOLUA_DISABLE_tolua_get_LOG_NONE
  1559. static int tolua_get_LOG_NONE(lua_State* tolua_S)
  1560. {
  1561. tolua_pushnumber(tolua_S,(lua_Number)LOG_NONE);
  1562. return 1;
  1563. }
  1564. #endif //#ifndef TOLUA_DISABLE
  1565. /* method: SetLevel of class Log */
  1566. #ifndef TOLUA_DISABLE_tolua_IO_Log_SetLevel00
  1567. static int tolua_IO_Log_SetLevel00(lua_State* tolua_S)
  1568. {
  1569. #ifndef TOLUA_RELEASE
  1570. tolua_Error tolua_err;
  1571. if (
  1572. !tolua_isusertype(tolua_S,1,"Log",0,&tolua_err) ||
  1573. !tolua_isnumber(tolua_S,2,0,&tolua_err) ||
  1574. !tolua_isnoobj(tolua_S,3,&tolua_err)
  1575. )
  1576. goto tolua_lerror;
  1577. else
  1578. #endif
  1579. {
  1580. Log* self = (Log*) tolua_tousertype(tolua_S,1,0);
  1581. int level = ((int) tolua_tonumber(tolua_S,2,0));
  1582. #ifndef TOLUA_RELEASE
  1583. if (!self) tolua_error(tolua_S,"invalid 'self' in function 'SetLevel'", NULL);
  1584. #endif
  1585. {
  1586. self->SetLevel(level);
  1587. }
  1588. }
  1589. return 0;
  1590. #ifndef TOLUA_RELEASE
  1591. tolua_lerror:
  1592. tolua_error(tolua_S,"#ferror in function 'SetLevel'.",&tolua_err);
  1593. return 0;
  1594. #endif
  1595. }
  1596. #endif //#ifndef TOLUA_DISABLE
  1597. /* method: SetTimeStamp of class Log */
  1598. #ifndef TOLUA_DISABLE_tolua_IO_Log_SetTimeStamp00
  1599. static int tolua_IO_Log_SetTimeStamp00(lua_State* tolua_S)
  1600. {
  1601. #ifndef TOLUA_RELEASE
  1602. tolua_Error tolua_err;
  1603. if (
  1604. !tolua_isusertype(tolua_S,1,"Log",0,&tolua_err) ||
  1605. !tolua_isboolean(tolua_S,2,0,&tolua_err) ||
  1606. !tolua_isnoobj(tolua_S,3,&tolua_err)
  1607. )
  1608. goto tolua_lerror;
  1609. else
  1610. #endif
  1611. {
  1612. Log* self = (Log*) tolua_tousertype(tolua_S,1,0);
  1613. bool enable = ((bool) tolua_toboolean(tolua_S,2,0));
  1614. #ifndef TOLUA_RELEASE
  1615. if (!self) tolua_error(tolua_S,"invalid 'self' in function 'SetTimeStamp'", NULL);
  1616. #endif
  1617. {
  1618. self->SetTimeStamp(enable);
  1619. }
  1620. }
  1621. return 0;
  1622. #ifndef TOLUA_RELEASE
  1623. tolua_lerror:
  1624. tolua_error(tolua_S,"#ferror in function 'SetTimeStamp'.",&tolua_err);
  1625. return 0;
  1626. #endif
  1627. }
  1628. #endif //#ifndef TOLUA_DISABLE
  1629. /* method: SetQuiet of class Log */
  1630. #ifndef TOLUA_DISABLE_tolua_IO_Log_SetQuiet00
  1631. static int tolua_IO_Log_SetQuiet00(lua_State* tolua_S)
  1632. {
  1633. #ifndef TOLUA_RELEASE
  1634. tolua_Error tolua_err;
  1635. if (
  1636. !tolua_isusertype(tolua_S,1,"Log",0,&tolua_err) ||
  1637. !tolua_isboolean(tolua_S,2,0,&tolua_err) ||
  1638. !tolua_isnoobj(tolua_S,3,&tolua_err)
  1639. )
  1640. goto tolua_lerror;
  1641. else
  1642. #endif
  1643. {
  1644. Log* self = (Log*) tolua_tousertype(tolua_S,1,0);
  1645. bool quiet = ((bool) tolua_toboolean(tolua_S,2,0));
  1646. #ifndef TOLUA_RELEASE
  1647. if (!self) tolua_error(tolua_S,"invalid 'self' in function 'SetQuiet'", NULL);
  1648. #endif
  1649. {
  1650. self->SetQuiet(quiet);
  1651. }
  1652. }
  1653. return 0;
  1654. #ifndef TOLUA_RELEASE
  1655. tolua_lerror:
  1656. tolua_error(tolua_S,"#ferror in function 'SetQuiet'.",&tolua_err);
  1657. return 0;
  1658. #endif
  1659. }
  1660. #endif //#ifndef TOLUA_DISABLE
  1661. /* method: GetLevel of class Log */
  1662. #ifndef TOLUA_DISABLE_tolua_IO_Log_GetLevel00
  1663. static int tolua_IO_Log_GetLevel00(lua_State* tolua_S)
  1664. {
  1665. #ifndef TOLUA_RELEASE
  1666. tolua_Error tolua_err;
  1667. if (
  1668. !tolua_isusertype(tolua_S,1,"const Log",0,&tolua_err) ||
  1669. !tolua_isnoobj(tolua_S,2,&tolua_err)
  1670. )
  1671. goto tolua_lerror;
  1672. else
  1673. #endif
  1674. {
  1675. const Log* self = (const Log*) tolua_tousertype(tolua_S,1,0);
  1676. #ifndef TOLUA_RELEASE
  1677. if (!self) tolua_error(tolua_S,"invalid 'self' in function 'GetLevel'", NULL);
  1678. #endif
  1679. {
  1680. int tolua_ret = (int) self->GetLevel();
  1681. tolua_pushnumber(tolua_S,(lua_Number)tolua_ret);
  1682. }
  1683. }
  1684. return 1;
  1685. #ifndef TOLUA_RELEASE
  1686. tolua_lerror:
  1687. tolua_error(tolua_S,"#ferror in function 'GetLevel'.",&tolua_err);
  1688. return 0;
  1689. #endif
  1690. }
  1691. #endif //#ifndef TOLUA_DISABLE
  1692. /* method: GetTimeStamp of class Log */
  1693. #ifndef TOLUA_DISABLE_tolua_IO_Log_GetTimeStamp00
  1694. static int tolua_IO_Log_GetTimeStamp00(lua_State* tolua_S)
  1695. {
  1696. #ifndef TOLUA_RELEASE
  1697. tolua_Error tolua_err;
  1698. if (
  1699. !tolua_isusertype(tolua_S,1,"const Log",0,&tolua_err) ||
  1700. !tolua_isnoobj(tolua_S,2,&tolua_err)
  1701. )
  1702. goto tolua_lerror;
  1703. else
  1704. #endif
  1705. {
  1706. const Log* self = (const Log*) tolua_tousertype(tolua_S,1,0);
  1707. #ifndef TOLUA_RELEASE
  1708. if (!self) tolua_error(tolua_S,"invalid 'self' in function 'GetTimeStamp'", NULL);
  1709. #endif
  1710. {
  1711. bool tolua_ret = (bool) self->GetTimeStamp();
  1712. tolua_pushboolean(tolua_S,(bool)tolua_ret);
  1713. }
  1714. }
  1715. return 1;
  1716. #ifndef TOLUA_RELEASE
  1717. tolua_lerror:
  1718. tolua_error(tolua_S,"#ferror in function 'GetTimeStamp'.",&tolua_err);
  1719. return 0;
  1720. #endif
  1721. }
  1722. #endif //#ifndef TOLUA_DISABLE
  1723. /* method: IsQuiet of class Log */
  1724. #ifndef TOLUA_DISABLE_tolua_IO_Log_IsQuiet00
  1725. static int tolua_IO_Log_IsQuiet00(lua_State* tolua_S)
  1726. {
  1727. #ifndef TOLUA_RELEASE
  1728. tolua_Error tolua_err;
  1729. if (
  1730. !tolua_isusertype(tolua_S,1,"const Log",0,&tolua_err) ||
  1731. !tolua_isnoobj(tolua_S,2,&tolua_err)
  1732. )
  1733. goto tolua_lerror;
  1734. else
  1735. #endif
  1736. {
  1737. const Log* self = (const Log*) tolua_tousertype(tolua_S,1,0);
  1738. #ifndef TOLUA_RELEASE
  1739. if (!self) tolua_error(tolua_S,"invalid 'self' in function 'IsQuiet'", NULL);
  1740. #endif
  1741. {
  1742. bool tolua_ret = (bool) self->IsQuiet();
  1743. tolua_pushboolean(tolua_S,(bool)tolua_ret);
  1744. }
  1745. }
  1746. return 1;
  1747. #ifndef TOLUA_RELEASE
  1748. tolua_lerror:
  1749. tolua_error(tolua_S,"#ferror in function 'IsQuiet'.",&tolua_err);
  1750. return 0;
  1751. #endif
  1752. }
  1753. #endif //#ifndef TOLUA_DISABLE
  1754. /* method: Write of class Log */
  1755. #ifndef TOLUA_DISABLE_tolua_IO_Log_Write00
  1756. static int tolua_IO_Log_Write00(lua_State* tolua_S)
  1757. {
  1758. #ifndef TOLUA_RELEASE
  1759. tolua_Error tolua_err;
  1760. if (
  1761. !tolua_isusertable(tolua_S,1,"Log",0,&tolua_err) ||
  1762. !tolua_isnumber(tolua_S,2,0,&tolua_err) ||
  1763. !tolua_isstring(tolua_S,3,0,&tolua_err) ||
  1764. !tolua_isnoobj(tolua_S,4,&tolua_err)
  1765. )
  1766. goto tolua_lerror;
  1767. else
  1768. #endif
  1769. {
  1770. int level = ((int) tolua_tonumber(tolua_S,2,0));
  1771. const char* message = ((const char*) tolua_tostring(tolua_S,3,0));
  1772. {
  1773. Log::Write(level,message);
  1774. }
  1775. }
  1776. return 0;
  1777. #ifndef TOLUA_RELEASE
  1778. tolua_lerror:
  1779. tolua_error(tolua_S,"#ferror in function 'Write'.",&tolua_err);
  1780. return 0;
  1781. #endif
  1782. }
  1783. #endif //#ifndef TOLUA_DISABLE
  1784. /* method: WriteRaw of class Log */
  1785. #ifndef TOLUA_DISABLE_tolua_IO_Log_WriteRaw00
  1786. static int tolua_IO_Log_WriteRaw00(lua_State* tolua_S)
  1787. {
  1788. #ifndef TOLUA_RELEASE
  1789. tolua_Error tolua_err;
  1790. if (
  1791. !tolua_isusertable(tolua_S,1,"Log",0,&tolua_err) ||
  1792. !tolua_isstring(tolua_S,2,0,&tolua_err) ||
  1793. !tolua_isboolean(tolua_S,3,1,&tolua_err) ||
  1794. !tolua_isnoobj(tolua_S,4,&tolua_err)
  1795. )
  1796. goto tolua_lerror;
  1797. else
  1798. #endif
  1799. {
  1800. const char* message = ((const char*) tolua_tostring(tolua_S,2,0));
  1801. bool error = ((bool) tolua_toboolean(tolua_S,3,false));
  1802. {
  1803. Log::WriteRaw(message,error);
  1804. }
  1805. }
  1806. return 0;
  1807. #ifndef TOLUA_RELEASE
  1808. tolua_lerror:
  1809. tolua_error(tolua_S,"#ferror in function 'WriteRaw'.",&tolua_err);
  1810. return 0;
  1811. #endif
  1812. }
  1813. #endif //#ifndef TOLUA_DISABLE
  1814. /* function: GetLog */
  1815. #ifndef TOLUA_DISABLE_tolua_IO_GetLog00
  1816. static int tolua_IO_GetLog00(lua_State* tolua_S)
  1817. {
  1818. #ifndef TOLUA_RELEASE
  1819. tolua_Error tolua_err;
  1820. if (
  1821. !tolua_isnoobj(tolua_S,1,&tolua_err)
  1822. )
  1823. goto tolua_lerror;
  1824. else
  1825. #endif
  1826. {
  1827. {
  1828. Log* tolua_ret = (Log*) GetLog();
  1829. tolua_pushusertype(tolua_S,(void*)tolua_ret,"Log");
  1830. }
  1831. }
  1832. return 1;
  1833. #ifndef TOLUA_RELEASE
  1834. tolua_lerror:
  1835. tolua_error(tolua_S,"#ferror in function 'GetLog'.",&tolua_err);
  1836. return 0;
  1837. #endif
  1838. }
  1839. #endif //#ifndef TOLUA_DISABLE
  1840. /* get function: offset_ of class PackageEntry */
  1841. #ifndef TOLUA_DISABLE_tolua_get_PackageEntry_offset_
  1842. static int tolua_get_PackageEntry_offset_(lua_State* tolua_S)
  1843. {
  1844. PackageEntry* self = (PackageEntry*) tolua_tousertype(tolua_S,1,0);
  1845. #ifndef TOLUA_RELEASE
  1846. if (!self) tolua_error(tolua_S,"invalid 'self' in accessing variable 'offset_'",NULL);
  1847. #endif
  1848. tolua_pushnumber(tolua_S,(lua_Number)self->offset_);
  1849. return 1;
  1850. }
  1851. #endif //#ifndef TOLUA_DISABLE
  1852. /* set function: offset_ of class PackageEntry */
  1853. #ifndef TOLUA_DISABLE_tolua_set_PackageEntry_offset_
  1854. static int tolua_set_PackageEntry_offset_(lua_State* tolua_S)
  1855. {
  1856. PackageEntry* self = (PackageEntry*) tolua_tousertype(tolua_S,1,0);
  1857. #ifndef TOLUA_RELEASE
  1858. tolua_Error tolua_err;
  1859. if (!self) tolua_error(tolua_S,"invalid 'self' in accessing variable 'offset_'",NULL);
  1860. if (!tolua_isnumber(tolua_S,2,0,&tolua_err))
  1861. tolua_error(tolua_S,"#vinvalid type in variable assignment.",&tolua_err);
  1862. #endif
  1863. self->offset_ = ((unsigned) tolua_tonumber(tolua_S,2,0))
  1864. ;
  1865. return 0;
  1866. }
  1867. #endif //#ifndef TOLUA_DISABLE
  1868. /* get function: size_ of class PackageEntry */
  1869. #ifndef TOLUA_DISABLE_tolua_get_PackageEntry_size_
  1870. static int tolua_get_PackageEntry_size_(lua_State* tolua_S)
  1871. {
  1872. PackageEntry* self = (PackageEntry*) tolua_tousertype(tolua_S,1,0);
  1873. #ifndef TOLUA_RELEASE
  1874. if (!self) tolua_error(tolua_S,"invalid 'self' in accessing variable 'size_'",NULL);
  1875. #endif
  1876. tolua_pushnumber(tolua_S,(lua_Number)self->size_);
  1877. return 1;
  1878. }
  1879. #endif //#ifndef TOLUA_DISABLE
  1880. /* set function: size_ of class PackageEntry */
  1881. #ifndef TOLUA_DISABLE_tolua_set_PackageEntry_size_
  1882. static int tolua_set_PackageEntry_size_(lua_State* tolua_S)
  1883. {
  1884. PackageEntry* self = (PackageEntry*) tolua_tousertype(tolua_S,1,0);
  1885. #ifndef TOLUA_RELEASE
  1886. tolua_Error tolua_err;
  1887. if (!self) tolua_error(tolua_S,"invalid 'self' in accessing variable 'size_'",NULL);
  1888. if (!tolua_isnumber(tolua_S,2,0,&tolua_err))
  1889. tolua_error(tolua_S,"#vinvalid type in variable assignment.",&tolua_err);
  1890. #endif
  1891. self->size_ = ((unsigned) tolua_tonumber(tolua_S,2,0))
  1892. ;
  1893. return 0;
  1894. }
  1895. #endif //#ifndef TOLUA_DISABLE
  1896. /* get function: checksum_ of class PackageEntry */
  1897. #ifndef TOLUA_DISABLE_tolua_get_PackageEntry_checksum_
  1898. static int tolua_get_PackageEntry_checksum_(lua_State* tolua_S)
  1899. {
  1900. PackageEntry* self = (PackageEntry*) tolua_tousertype(tolua_S,1,0);
  1901. #ifndef TOLUA_RELEASE
  1902. if (!self) tolua_error(tolua_S,"invalid 'self' in accessing variable 'checksum_'",NULL);
  1903. #endif
  1904. tolua_pushnumber(tolua_S,(lua_Number)self->checksum_);
  1905. return 1;
  1906. }
  1907. #endif //#ifndef TOLUA_DISABLE
  1908. /* set function: checksum_ of class PackageEntry */
  1909. #ifndef TOLUA_DISABLE_tolua_set_PackageEntry_checksum_
  1910. static int tolua_set_PackageEntry_checksum_(lua_State* tolua_S)
  1911. {
  1912. PackageEntry* self = (PackageEntry*) tolua_tousertype(tolua_S,1,0);
  1913. #ifndef TOLUA_RELEASE
  1914. tolua_Error tolua_err;
  1915. if (!self) tolua_error(tolua_S,"invalid 'self' in accessing variable 'checksum_'",NULL);
  1916. if (!tolua_isnumber(tolua_S,2,0,&tolua_err))
  1917. tolua_error(tolua_S,"#vinvalid type in variable assignment.",&tolua_err);
  1918. #endif
  1919. self->checksum_ = ((unsigned) tolua_tonumber(tolua_S,2,0))
  1920. ;
  1921. return 0;
  1922. }
  1923. #endif //#ifndef TOLUA_DISABLE
  1924. /* method: Open of class PackageFile */
  1925. #ifndef TOLUA_DISABLE_tolua_IO_PackageFile_Open00
  1926. static int tolua_IO_PackageFile_Open00(lua_State* tolua_S)
  1927. {
  1928. #ifndef TOLUA_RELEASE
  1929. tolua_Error tolua_err;
  1930. if (
  1931. !tolua_isusertype(tolua_S,1,"PackageFile",0,&tolua_err) ||
  1932. (tolua_isvaluenil(tolua_S,2,&tolua_err) || !tolua_isusertype(tolua_S,2,"const String",0,&tolua_err)) ||
  1933. !tolua_isnoobj(tolua_S,3,&tolua_err)
  1934. )
  1935. goto tolua_lerror;
  1936. else
  1937. #endif
  1938. {
  1939. PackageFile* self = (PackageFile*) tolua_tousertype(tolua_S,1,0);
  1940. const String* fileName = ((const String*) tolua_tousertype(tolua_S,2,0));
  1941. #ifndef TOLUA_RELEASE
  1942. if (!self) tolua_error(tolua_S,"invalid 'self' in function 'Open'", NULL);
  1943. #endif
  1944. {
  1945. bool tolua_ret = (bool) self->Open(*fileName);
  1946. tolua_pushboolean(tolua_S,(bool)tolua_ret);
  1947. }
  1948. }
  1949. return 1;
  1950. #ifndef TOLUA_RELEASE
  1951. tolua_lerror:
  1952. tolua_error(tolua_S,"#ferror in function 'Open'.",&tolua_err);
  1953. return 0;
  1954. #endif
  1955. }
  1956. #endif //#ifndef TOLUA_DISABLE
  1957. /* method: Exists of class PackageFile */
  1958. #ifndef TOLUA_DISABLE_tolua_IO_PackageFile_Exists00
  1959. static int tolua_IO_PackageFile_Exists00(lua_State* tolua_S)
  1960. {
  1961. #ifndef TOLUA_RELEASE
  1962. tolua_Error tolua_err;
  1963. if (
  1964. !tolua_isusertype(tolua_S,1,"const PackageFile",0,&tolua_err) ||
  1965. (tolua_isvaluenil(tolua_S,2,&tolua_err) || !tolua_isusertype(tolua_S,2,"const String",0,&tolua_err)) ||
  1966. !tolua_isnoobj(tolua_S,3,&tolua_err)
  1967. )
  1968. goto tolua_lerror;
  1969. else
  1970. #endif
  1971. {
  1972. const PackageFile* self = (const PackageFile*) tolua_tousertype(tolua_S,1,0);
  1973. const String* fileName = ((const String*) tolua_tousertype(tolua_S,2,0));
  1974. #ifndef TOLUA_RELEASE
  1975. if (!self) tolua_error(tolua_S,"invalid 'self' in function 'Exists'", NULL);
  1976. #endif
  1977. {
  1978. bool tolua_ret = (bool) self->Exists(*fileName);
  1979. tolua_pushboolean(tolua_S,(bool)tolua_ret);
  1980. }
  1981. }
  1982. return 1;
  1983. #ifndef TOLUA_RELEASE
  1984. tolua_lerror:
  1985. tolua_error(tolua_S,"#ferror in function 'Exists'.",&tolua_err);
  1986. return 0;
  1987. #endif
  1988. }
  1989. #endif //#ifndef TOLUA_DISABLE
  1990. /* method: GetEntry of class PackageFile */
  1991. #ifndef TOLUA_DISABLE_tolua_IO_PackageFile_GetEntry00
  1992. static int tolua_IO_PackageFile_GetEntry00(lua_State* tolua_S)
  1993. {
  1994. #ifndef TOLUA_RELEASE
  1995. tolua_Error tolua_err;
  1996. if (
  1997. !tolua_isusertype(tolua_S,1,"const PackageFile",0,&tolua_err) ||
  1998. (tolua_isvaluenil(tolua_S,2,&tolua_err) || !tolua_isusertype(tolua_S,2,"const String",0,&tolua_err)) ||
  1999. !tolua_isnoobj(tolua_S,3,&tolua_err)
  2000. )
  2001. goto tolua_lerror;
  2002. else
  2003. #endif
  2004. {
  2005. const PackageFile* self = (const PackageFile*) tolua_tousertype(tolua_S,1,0);
  2006. const String* fileName = ((const String*) tolua_tousertype(tolua_S,2,0));
  2007. #ifndef TOLUA_RELEASE
  2008. if (!self) tolua_error(tolua_S,"invalid 'self' in function 'GetEntry'", NULL);
  2009. #endif
  2010. {
  2011. const PackageEntry* tolua_ret = (const PackageEntry*) self->GetEntry(*fileName);
  2012. tolua_pushusertype(tolua_S,(void*)tolua_ret,"const PackageEntry");
  2013. }
  2014. }
  2015. return 1;
  2016. #ifndef TOLUA_RELEASE
  2017. tolua_lerror:
  2018. tolua_error(tolua_S,"#ferror in function 'GetEntry'.",&tolua_err);
  2019. return 0;
  2020. #endif
  2021. }
  2022. #endif //#ifndef TOLUA_DISABLE
  2023. /* method: GetName of class PackageFile */
  2024. #ifndef TOLUA_DISABLE_tolua_IO_PackageFile_GetName00
  2025. static int tolua_IO_PackageFile_GetName00(lua_State* tolua_S)
  2026. {
  2027. #ifndef TOLUA_RELEASE
  2028. tolua_Error tolua_err;
  2029. if (
  2030. !tolua_isusertype(tolua_S,1,"const PackageFile",0,&tolua_err) ||
  2031. !tolua_isnoobj(tolua_S,2,&tolua_err)
  2032. )
  2033. goto tolua_lerror;
  2034. else
  2035. #endif
  2036. {
  2037. const PackageFile* self = (const PackageFile*) tolua_tousertype(tolua_S,1,0);
  2038. #ifndef TOLUA_RELEASE
  2039. if (!self) tolua_error(tolua_S,"invalid 'self' in function 'GetName'", NULL);
  2040. #endif
  2041. {
  2042. const String& tolua_ret = (const String&) self->GetName();
  2043. tolua_pushusertype(tolua_S,(void*)&tolua_ret,"const String");
  2044. }
  2045. }
  2046. return 1;
  2047. #ifndef TOLUA_RELEASE
  2048. tolua_lerror:
  2049. tolua_error(tolua_S,"#ferror in function 'GetName'.",&tolua_err);
  2050. return 0;
  2051. #endif
  2052. }
  2053. #endif //#ifndef TOLUA_DISABLE
  2054. /* method: GetNameHash of class PackageFile */
  2055. #ifndef TOLUA_DISABLE_tolua_IO_PackageFile_GetNameHash00
  2056. static int tolua_IO_PackageFile_GetNameHash00(lua_State* tolua_S)
  2057. {
  2058. #ifndef TOLUA_RELEASE
  2059. tolua_Error tolua_err;
  2060. if (
  2061. !tolua_isusertype(tolua_S,1,"const PackageFile",0,&tolua_err) ||
  2062. !tolua_isnoobj(tolua_S,2,&tolua_err)
  2063. )
  2064. goto tolua_lerror;
  2065. else
  2066. #endif
  2067. {
  2068. const PackageFile* self = (const PackageFile*) tolua_tousertype(tolua_S,1,0);
  2069. #ifndef TOLUA_RELEASE
  2070. if (!self) tolua_error(tolua_S,"invalid 'self' in function 'GetNameHash'", NULL);
  2071. #endif
  2072. {
  2073. StringHash tolua_ret = (StringHash) self->GetNameHash();
  2074. {
  2075. #ifdef __cplusplus
  2076. void* tolua_obj = Mtolua_new((StringHash)(tolua_ret));
  2077. tolua_pushusertype(tolua_S,tolua_obj,"StringHash");
  2078. tolua_register_gc(tolua_S,lua_gettop(tolua_S));
  2079. #else
  2080. void* tolua_obj = tolua_copy(tolua_S,(void*)&tolua_ret,sizeof(StringHash));
  2081. tolua_pushusertype(tolua_S,tolua_obj,"StringHash");
  2082. tolua_register_gc(tolua_S,lua_gettop(tolua_S));
  2083. #endif
  2084. }
  2085. }
  2086. }
  2087. return 1;
  2088. #ifndef TOLUA_RELEASE
  2089. tolua_lerror:
  2090. tolua_error(tolua_S,"#ferror in function 'GetNameHash'.",&tolua_err);
  2091. return 0;
  2092. #endif
  2093. }
  2094. #endif //#ifndef TOLUA_DISABLE
  2095. /* method: GetNumFiles of class PackageFile */
  2096. #ifndef TOLUA_DISABLE_tolua_IO_PackageFile_GetNumFiles00
  2097. static int tolua_IO_PackageFile_GetNumFiles00(lua_State* tolua_S)
  2098. {
  2099. #ifndef TOLUA_RELEASE
  2100. tolua_Error tolua_err;
  2101. if (
  2102. !tolua_isusertype(tolua_S,1,"const PackageFile",0,&tolua_err) ||
  2103. !tolua_isnoobj(tolua_S,2,&tolua_err)
  2104. )
  2105. goto tolua_lerror;
  2106. else
  2107. #endif
  2108. {
  2109. const PackageFile* self = (const PackageFile*) tolua_tousertype(tolua_S,1,0);
  2110. #ifndef TOLUA_RELEASE
  2111. if (!self) tolua_error(tolua_S,"invalid 'self' in function 'GetNumFiles'", NULL);
  2112. #endif
  2113. {
  2114. unsigned tolua_ret = (unsigned) self->GetNumFiles();
  2115. tolua_pushnumber(tolua_S,(lua_Number)tolua_ret);
  2116. }
  2117. }
  2118. return 1;
  2119. #ifndef TOLUA_RELEASE
  2120. tolua_lerror:
  2121. tolua_error(tolua_S,"#ferror in function 'GetNumFiles'.",&tolua_err);
  2122. return 0;
  2123. #endif
  2124. }
  2125. #endif //#ifndef TOLUA_DISABLE
  2126. /* method: GetTotalSize of class PackageFile */
  2127. #ifndef TOLUA_DISABLE_tolua_IO_PackageFile_GetTotalSize00
  2128. static int tolua_IO_PackageFile_GetTotalSize00(lua_State* tolua_S)
  2129. {
  2130. #ifndef TOLUA_RELEASE
  2131. tolua_Error tolua_err;
  2132. if (
  2133. !tolua_isusertype(tolua_S,1,"const PackageFile",0,&tolua_err) ||
  2134. !tolua_isnoobj(tolua_S,2,&tolua_err)
  2135. )
  2136. goto tolua_lerror;
  2137. else
  2138. #endif
  2139. {
  2140. const PackageFile* self = (const PackageFile*) tolua_tousertype(tolua_S,1,0);
  2141. #ifndef TOLUA_RELEASE
  2142. if (!self) tolua_error(tolua_S,"invalid 'self' in function 'GetTotalSize'", NULL);
  2143. #endif
  2144. {
  2145. unsigned tolua_ret = (unsigned) self->GetTotalSize();
  2146. tolua_pushnumber(tolua_S,(lua_Number)tolua_ret);
  2147. }
  2148. }
  2149. return 1;
  2150. #ifndef TOLUA_RELEASE
  2151. tolua_lerror:
  2152. tolua_error(tolua_S,"#ferror in function 'GetTotalSize'.",&tolua_err);
  2153. return 0;
  2154. #endif
  2155. }
  2156. #endif //#ifndef TOLUA_DISABLE
  2157. /* method: GetChecksum of class PackageFile */
  2158. #ifndef TOLUA_DISABLE_tolua_IO_PackageFile_GetChecksum00
  2159. static int tolua_IO_PackageFile_GetChecksum00(lua_State* tolua_S)
  2160. {
  2161. #ifndef TOLUA_RELEASE
  2162. tolua_Error tolua_err;
  2163. if (
  2164. !tolua_isusertype(tolua_S,1,"const PackageFile",0,&tolua_err) ||
  2165. !tolua_isnoobj(tolua_S,2,&tolua_err)
  2166. )
  2167. goto tolua_lerror;
  2168. else
  2169. #endif
  2170. {
  2171. const PackageFile* self = (const PackageFile*) tolua_tousertype(tolua_S,1,0);
  2172. #ifndef TOLUA_RELEASE
  2173. if (!self) tolua_error(tolua_S,"invalid 'self' in function 'GetChecksum'", NULL);
  2174. #endif
  2175. {
  2176. unsigned tolua_ret = (unsigned) self->GetChecksum();
  2177. tolua_pushnumber(tolua_S,(lua_Number)tolua_ret);
  2178. }
  2179. }
  2180. return 1;
  2181. #ifndef TOLUA_RELEASE
  2182. tolua_lerror:
  2183. tolua_error(tolua_S,"#ferror in function 'GetChecksum'.",&tolua_err);
  2184. return 0;
  2185. #endif
  2186. }
  2187. #endif //#ifndef TOLUA_DISABLE
  2188. /* Open function */
  2189. TOLUA_API int tolua_IO_open (lua_State* tolua_S)
  2190. {
  2191. tolua_open(tolua_S);
  2192. tolua_reg_types(tolua_S);
  2193. tolua_module(tolua_S,NULL,1);
  2194. tolua_beginmodule(tolua_S,NULL);
  2195. tolua_constant(tolua_S,"FILE_READ",FILE_READ);
  2196. tolua_constant(tolua_S,"FILE_WRITE",FILE_WRITE);
  2197. tolua_constant(tolua_S,"FILE_READWRITE",FILE_READWRITE);
  2198. tolua_cclass(tolua_S,"File","File","Deserializer",NULL);
  2199. tolua_beginmodule(tolua_S,"File");
  2200. tolua_function(tolua_S,"Read",tolua_IO_File_Read00);
  2201. tolua_function(tolua_S,"Seek",tolua_IO_File_Seek00);
  2202. tolua_function(tolua_S,"GetName",tolua_IO_File_GetName00);
  2203. tolua_function(tolua_S,"GetChecksum",tolua_IO_File_GetChecksum00);
  2204. tolua_function(tolua_S,"Open",tolua_IO_File_Open00);
  2205. tolua_function(tolua_S,"Open",tolua_IO_File_Open01);
  2206. tolua_function(tolua_S,"Close",tolua_IO_File_Close00);
  2207. tolua_function(tolua_S,"Flush",tolua_IO_File_Flush00);
  2208. tolua_function(tolua_S,"SetName",tolua_IO_File_SetName00);
  2209. tolua_function(tolua_S,"GetMode",tolua_IO_File_GetMode00);
  2210. tolua_function(tolua_S,"IsOpen",tolua_IO_File_IsOpen00);
  2211. tolua_function(tolua_S,"GetHandle",tolua_IO_File_GetHandle00);
  2212. tolua_function(tolua_S,"IsPackaged",tolua_IO_File_IsPackaged00);
  2213. tolua_endmodule(tolua_S);
  2214. tolua_variable(tolua_S,"SCAN_FILES",tolua_get_SCAN_FILES,NULL);
  2215. tolua_variable(tolua_S,"SCAN_DIRS",tolua_get_SCAN_DIRS,NULL);
  2216. tolua_variable(tolua_S,"SCAN_HIDDEN",tolua_get_SCAN_HIDDEN,NULL);
  2217. tolua_cclass(tolua_S,"FileSystem","FileSystem","Object",NULL);
  2218. tolua_beginmodule(tolua_S,"FileSystem");
  2219. tolua_function(tolua_S,"SetCurrentDir",tolua_IO_FileSystem_SetCurrentDir00);
  2220. tolua_function(tolua_S,"CreateDir",tolua_IO_FileSystem_CreateDir00);
  2221. tolua_function(tolua_S,"SystemCommand",tolua_IO_FileSystem_SystemCommand00);
  2222. tolua_function(tolua_S,"SystemOpen",tolua_IO_FileSystem_SystemOpen00);
  2223. tolua_function(tolua_S,"SystemOpen",tolua_IO_FileSystem_SystemOpen01);
  2224. tolua_function(tolua_S,"Copy",tolua_IO_FileSystem_Copy00);
  2225. tolua_function(tolua_S,"Rename",tolua_IO_FileSystem_Rename00);
  2226. tolua_function(tolua_S,"Delete",tolua_IO_FileSystem_Delete00);
  2227. tolua_function(tolua_S,"RegisterPath",tolua_IO_FileSystem_RegisterPath00);
  2228. tolua_function(tolua_S,"GetCurrentDir",tolua_IO_FileSystem_GetCurrentDir00);
  2229. tolua_function(tolua_S,"HasRegisteredPaths",tolua_IO_FileSystem_HasRegisteredPaths00);
  2230. tolua_function(tolua_S,"CheckAccess",tolua_IO_FileSystem_CheckAccess00);
  2231. tolua_function(tolua_S,"GetLastModifiedTime",tolua_IO_FileSystem_GetLastModifiedTime00);
  2232. tolua_function(tolua_S,"FileExists",tolua_IO_FileSystem_FileExists00);
  2233. tolua_function(tolua_S,"DirExists",tolua_IO_FileSystem_DirExists00);
  2234. tolua_function(tolua_S,"GetProgramDir",tolua_IO_FileSystem_GetProgramDir00);
  2235. tolua_function(tolua_S,"GetUserDocumentsDir",tolua_IO_FileSystem_GetUserDocumentsDir00);
  2236. tolua_endmodule(tolua_S);
  2237. tolua_function(tolua_S,"GetFileSystem",tolua_IO_GetFileSystem00);
  2238. tolua_function(tolua_S,"SplitPath",tolua_IO_SplitPath00);
  2239. tolua_function(tolua_S,"GetPath",tolua_IO_GetPath00);
  2240. tolua_function(tolua_S,"GetFileName",tolua_IO_GetFileName00);
  2241. tolua_function(tolua_S,"GetExtension",tolua_IO_GetExtension00);
  2242. tolua_function(tolua_S,"GetFileNameAndExtension",tolua_IO_GetFileNameAndExtension00);
  2243. tolua_function(tolua_S,"ReplaceExtension",tolua_IO_ReplaceExtension00);
  2244. tolua_function(tolua_S,"AddTrailingSlash",tolua_IO_AddTrailingSlash00);
  2245. tolua_function(tolua_S,"RemoveTrailingSlash",tolua_IO_RemoveTrailingSlash00);
  2246. tolua_function(tolua_S,"GetParentPath",tolua_IO_GetParentPath00);
  2247. tolua_function(tolua_S,"GetInternalPath",tolua_IO_GetInternalPath00);
  2248. tolua_function(tolua_S,"GetNativePath",tolua_IO_GetNativePath00);
  2249. tolua_variable(tolua_S,"LOG_DEBUG",tolua_get_LOG_DEBUG,NULL);
  2250. tolua_variable(tolua_S,"LOG_INFO",tolua_get_LOG_INFO,NULL);
  2251. tolua_variable(tolua_S,"LOG_WARNING",tolua_get_LOG_WARNING,NULL);
  2252. tolua_variable(tolua_S,"LOG_ERROR",tolua_get_LOG_ERROR,NULL);
  2253. tolua_variable(tolua_S,"LOG_NONE",tolua_get_LOG_NONE,NULL);
  2254. tolua_cclass(tolua_S,"Log","Log","Object",NULL);
  2255. tolua_beginmodule(tolua_S,"Log");
  2256. tolua_function(tolua_S,"SetLevel",tolua_IO_Log_SetLevel00);
  2257. tolua_function(tolua_S,"SetTimeStamp",tolua_IO_Log_SetTimeStamp00);
  2258. tolua_function(tolua_S,"SetQuiet",tolua_IO_Log_SetQuiet00);
  2259. tolua_function(tolua_S,"GetLevel",tolua_IO_Log_GetLevel00);
  2260. tolua_function(tolua_S,"GetTimeStamp",tolua_IO_Log_GetTimeStamp00);
  2261. tolua_function(tolua_S,"IsQuiet",tolua_IO_Log_IsQuiet00);
  2262. tolua_function(tolua_S,"Write",tolua_IO_Log_Write00);
  2263. tolua_function(tolua_S,"WriteRaw",tolua_IO_Log_WriteRaw00);
  2264. tolua_endmodule(tolua_S);
  2265. tolua_function(tolua_S,"GetLog",tolua_IO_GetLog00);
  2266. tolua_cclass(tolua_S,"PackageEntry","PackageEntry","",NULL);
  2267. tolua_beginmodule(tolua_S,"PackageEntry");
  2268. tolua_variable(tolua_S,"offset_",tolua_get_PackageEntry_offset_,tolua_set_PackageEntry_offset_);
  2269. tolua_variable(tolua_S,"size_",tolua_get_PackageEntry_size_,tolua_set_PackageEntry_size_);
  2270. tolua_variable(tolua_S,"checksum_",tolua_get_PackageEntry_checksum_,tolua_set_PackageEntry_checksum_);
  2271. tolua_endmodule(tolua_S);
  2272. tolua_cclass(tolua_S,"PackageFile","PackageFile","Object",NULL);
  2273. tolua_beginmodule(tolua_S,"PackageFile");
  2274. tolua_function(tolua_S,"Open",tolua_IO_PackageFile_Open00);
  2275. tolua_function(tolua_S,"Exists",tolua_IO_PackageFile_Exists00);
  2276. tolua_function(tolua_S,"GetEntry",tolua_IO_PackageFile_GetEntry00);
  2277. tolua_function(tolua_S,"GetName",tolua_IO_PackageFile_GetName00);
  2278. tolua_function(tolua_S,"GetNameHash",tolua_IO_PackageFile_GetNameHash00);
  2279. tolua_function(tolua_S,"GetNumFiles",tolua_IO_PackageFile_GetNumFiles00);
  2280. tolua_function(tolua_S,"GetTotalSize",tolua_IO_PackageFile_GetTotalSize00);
  2281. tolua_function(tolua_S,"GetChecksum",tolua_IO_PackageFile_GetChecksum00);
  2282. tolua_endmodule(tolua_S);
  2283. tolua_endmodule(tolua_S);
  2284. return 1;
  2285. }
  2286. #if defined(LUA_VERSION_NUM) && LUA_VERSION_NUM >= 501
  2287. TOLUA_API int luaopen_IO (lua_State* tolua_S) {
  2288. return tolua_IO_open(tolua_S);
  2289. };
  2290. #endif