LuaUInt32Wrap.cs 1.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475
  1. //this source code was auto-generated by tolua#, do not modify it
  2. using System;
  3. using LuaInterface;
  4. public class LuaUInt32Wrap
  5. {
  6. public static void Register(LuaState L)
  7. {
  8. L.BeginClass(typeof(LuaUInt32), typeof(System.Object), "LuaUInt32");
  9. L.RegFunction("FromString", FromString);
  10. L.RegFunction("BytesToUInt32", BytesToUInt32);
  11. L.RegFunction("New", _CreateLuaUInt32);
  12. L.RegFunction("__tostring", ToLua.op_ToString);
  13. L.EndClass();
  14. }
  15. [MonoPInvokeCallbackAttribute(typeof(LuaCSFunction))]
  16. static int _CreateLuaUInt32(IntPtr L)
  17. {
  18. try
  19. {
  20. int count = LuaDLL.lua_gettop(L);
  21. if (count == 0)
  22. {
  23. LuaUInt32 obj = new LuaUInt32();
  24. ToLua.PushObject(L, obj);
  25. return 1;
  26. }
  27. else
  28. {
  29. return LuaDLL.luaL_throw(L, "invalid arguments to ctor method: LuaUInt32.New");
  30. }
  31. }
  32. catch (Exception e)
  33. {
  34. return LuaDLL.toluaL_exception(L, e);
  35. }
  36. }
  37. [MonoPInvokeCallbackAttribute(typeof(LuaCSFunction))]
  38. static int FromString(IntPtr L)
  39. {
  40. try
  41. {
  42. ToLua.CheckArgsCount(L, 1);
  43. string arg0 = ToLua.CheckString(L, 1);
  44. byte[] o = LuaUInt32.FromString(arg0);
  45. ToLua.Push(L, o);
  46. return 1;
  47. }
  48. catch (Exception e)
  49. {
  50. return LuaDLL.toluaL_exception(L, e);
  51. }
  52. }
  53. [MonoPInvokeCallbackAttribute(typeof(LuaCSFunction))]
  54. static int BytesToUInt32(IntPtr L)
  55. {
  56. try
  57. {
  58. ToLua.CheckArgsCount(L, 1);
  59. byte[] arg0 = ToLua.CheckByteBuffer(L, 1);
  60. uint o = LuaUInt32.BytesToUInt32(arg0);
  61. LuaDLL.lua_pushnumber(L, o);
  62. return 1;
  63. }
  64. catch (Exception e)
  65. {
  66. return LuaDLL.toluaL_exception(L, e);
  67. }
  68. }
  69. }