Exemple #1
0
 static int LogWarning(IntPtr L)
 {
     try
     {
         ToLua.CheckArgsCount(L, 1);
         object arg0 = ToLua.ToVarObject(L, 1);
         CLuaFunction.LogWarning(arg0);
         return(0);
     }
     catch (Exception e)
     {
         return(LuaDLL.toluaL_exception(L, e));
     }
 }
Exemple #2
0
 static int DeleteFile(IntPtr L)
 {
     try
     {
         ToLua.CheckArgsCount(L, 1);
         string arg0 = ToLua.CheckString(L, 1);
         CLuaFunction.DeleteFile(arg0);
         return(0);
     }
     catch (Exception e)
     {
         return(LuaDLL.toluaL_exception(L, e));
     }
 }
Exemple #3
0
 static int CreateDirectory(IntPtr L)
 {
     try
     {
         ToLua.CheckArgsCount(L, 1);
         string arg0 = ToLua.CheckString(L, 1);
         CLuaFunction.CreateDirectory(arg0);
         return(0);
     }
     catch (Exception e)
     {
         return(LuaDLL.toluaL_exception(L, e));
     }
 }
Exemple #4
0
 static int LoadXmlForText(IntPtr L)
 {
     try
     {
         ToLua.CheckArgsCount(L, 1);
         string arg0 = ToLua.CheckString(L, 1);
         string o    = CLuaFunction.LoadXmlForText(arg0);
         LuaDLL.lua_pushstring(L, o);
         return(1);
     }
     catch (Exception e)
     {
         return(LuaDLL.toluaL_exception(L, e));
     }
 }
Exemple #5
0
 static int CreateByteArr(IntPtr L)
 {
     try
     {
         ToLua.CheckArgsCount(L, 1);
         int    arg0 = (int)LuaDLL.luaL_checknumber(L, 1);
         byte[] o    = CLuaFunction.CreateByteArr(arg0);
         ToLua.Push(L, o);
         return(1);
     }
     catch (Exception e)
     {
         return(LuaDLL.toluaL_exception(L, e));
     }
 }
Exemple #6
0
 static int ConvertStrToInt10(IntPtr L)
 {
     try
     {
         ToLua.CheckArgsCount(L, 1);
         string arg0 = ToLua.CheckString(L, 1);
         int    o    = CLuaFunction.ConvertStrToInt10(arg0);
         LuaDLL.lua_pushinteger(L, o);
         return(1);
     }
     catch (Exception e)
     {
         return(LuaDLL.toluaL_exception(L, e));
     }
 }
Exemple #7
0
 static int ConvertBytesToString(IntPtr L)
 {
     try
     {
         ToLua.CheckArgsCount(L, 1);
         byte[] arg0 = ToLua.CheckByteBuffer(L, 1);
         string o    = CLuaFunction.ConvertBytesToString(arg0);
         LuaDLL.lua_pushstring(L, o);
         return(1);
     }
     catch (Exception e)
     {
         return(LuaDLL.toluaL_exception(L, e));
     }
 }
Exemple #8
0
 static int WriteBytesByFileStream(IntPtr L)
 {
     try
     {
         ToLua.CheckArgsCount(L, 2);
         string arg0 = ToLua.CheckString(L, 1);
         byte[] arg1 = ToLua.CheckByteBuffer(L, 2);
         CLuaFunction.WriteBytesByFileStream(arg0, arg1);
         return(0);
     }
     catch (Exception e)
     {
         return(LuaDLL.toluaL_exception(L, e));
     }
 }
Exemple #9
0
 static int WriteAllText(IntPtr L)
 {
     try
     {
         ToLua.CheckArgsCount(L, 2);
         string arg0 = ToLua.CheckString(L, 1);
         string arg1 = ToLua.CheckString(L, 2);
         CLuaFunction.WriteAllText(arg0, arg1);
         return(0);
     }
     catch (Exception e)
     {
         return(LuaDLL.toluaL_exception(L, e));
     }
 }
Exemple #10
0
 static int FileExists(IntPtr L)
 {
     try
     {
         ToLua.CheckArgsCount(L, 1);
         string arg0 = ToLua.CheckString(L, 1);
         bool   o    = CLuaFunction.FileExists(arg0);
         LuaDLL.lua_pushboolean(L, o);
         return(1);
     }
     catch (Exception e)
     {
         return(LuaDLL.toluaL_exception(L, e));
     }
 }
Exemple #11
0
 static int CreateFileStream(IntPtr L)
 {
     try
     {
         ToLua.CheckArgsCount(L, 3);
         string arg0            = ToLua.CheckString(L, 1);
         int    arg1            = (int)LuaDLL.luaL_checknumber(L, 2);
         int    arg2            = (int)LuaDLL.luaL_checknumber(L, 3);
         System.IO.FileStream o = CLuaFunction.CreateFileStream(arg0, arg1, arg2);
         ToLua.PushObject(L, o);
         return(1);
     }
     catch (Exception e)
     {
         return(LuaDLL.toluaL_exception(L, e));
     }
 }
Exemple #12
0
    static int _CreateCLuaFunction(IntPtr L)
    {
        try
        {
            int count = LuaDLL.lua_gettop(L);

            if (count == 0)
            {
                CLuaFunction obj = new CLuaFunction();
                ToLua.PushObject(L, obj);
                return(1);
            }
            else
            {
                return(LuaDLL.luaL_throw(L, "invalid arguments to ctor method: CLuaFunction.New"));
            }
        }
        catch (Exception e)
        {
            return(LuaDLL.toluaL_exception(L, e));
        }
    }