#if USE_UNI_LUA
|
using LuaAPI = UniLua.Lua;
|
using RealStatePtr = UniLua.ILuaState;
|
using LuaCSFunction = UniLua.CSharpFunctionDelegate;
|
#else
|
using LuaAPI = XLua.LuaDLL.Lua;
|
using RealStatePtr = System.IntPtr;
|
using LuaCSFunction = XLua.LuaDLL.lua_CSFunction;
|
#endif
|
|
using XLua;
|
using System.Collections.Generic;
|
|
|
namespace XLua.CSObjectWrap
|
{
|
using Utils = XLua.Utils;
|
public class FileExtersionWrap
|
{
|
public static void __Register(RealStatePtr L)
|
{
|
ObjectTranslator translator = ObjectTranslatorPool.Instance.Find(L);
|
System.Type type = typeof(FileExtersion);
|
Utils.BeginObjectRegister(type, L, translator, 0, 0, 0, 0);
|
|
|
|
|
|
|
Utils.EndObjectRegister(type, L, translator, null, null,
|
null, null, null);
|
|
Utils.BeginClassRegister(type, L, __CreateInstance, 12, 0, 0);
|
Utils.RegisterFunc(L, Utils.CLS_IDX, "GetFileInfos", _m_GetFileInfos_xlua_st_);
|
Utils.RegisterFunc(L, Utils.CLS_IDX, "GetAllDirectoryFileInfos", _m_GetAllDirectoryFileInfos_xlua_st_);
|
Utils.RegisterFunc(L, Utils.CLS_IDX, "GetFileRelativePath", _m_GetFileRelativePath_xlua_st_);
|
Utils.RegisterFunc(L, Utils.CLS_IDX, "GetVersionFromFileName", _m_GetVersionFromFileName_xlua_st_);
|
Utils.RegisterFunc(L, Utils.CLS_IDX, "RemoveVersionFromFileFullName", _m_RemoveVersionFromFileFullName_xlua_st_);
|
Utils.RegisterFunc(L, Utils.CLS_IDX, "AddVersionToFileFullName", _m_AddVersionToFileFullName_xlua_st_);
|
Utils.RegisterFunc(L, Utils.CLS_IDX, "DirectoryCopy", _m_DirectoryCopy_xlua_st_);
|
Utils.RegisterFunc(L, Utils.CLS_IDX, "GetMD5HashFromFile", _m_GetMD5HashFromFile_xlua_st_);
|
Utils.RegisterFunc(L, Utils.CLS_IDX, "GetStringMD5Hash", _m_GetStringMD5Hash_xlua_st_);
|
Utils.RegisterFunc(L, Utils.CLS_IDX, "ReadFileAllLines", _m_ReadFileAllLines_xlua_st_);
|
|
|
Utils.RegisterObject(L, translator, Utils.CLS_IDX, "lineSplit", FileExtersion.lineSplit);
|
|
|
|
|
Utils.EndClassRegister(type, L, translator);
|
}
|
|
[MonoPInvokeCallbackAttribute(typeof(LuaCSFunction))]
|
static int __CreateInstance(RealStatePtr L)
|
{
|
|
try {
|
ObjectTranslator translator = ObjectTranslatorPool.Instance.Find(L);
|
if(LuaAPI.lua_gettop(L) == 1)
|
{
|
|
FileExtersion gen_ret = new FileExtersion();
|
translator.Push(L, gen_ret);
|
|
return 1;
|
}
|
|
}
|
catch(System.Exception gen_e) {
|
return LuaAPI.luaL_error(L, "c# exception:" + gen_e);
|
}
|
return LuaAPI.luaL_error(L, "invalid arguments to FileExtersion constructor!");
|
|
}
|
|
|
|
|
|
|
|
|
[MonoPInvokeCallbackAttribute(typeof(LuaCSFunction))]
|
static int _m_GetFileInfos_xlua_st_(RealStatePtr L)
|
{
|
try {
|
|
ObjectTranslator translator = ObjectTranslatorPool.Instance.Find(L);
|
|
|
|
|
{
|
string __path = LuaAPI.lua_tostring(L, 1);
|
string[] __searchPatterns = (string[])translator.GetObject(L, 2, typeof(string[]));
|
|
System.Collections.Generic.List<System.IO.FileInfo> gen_ret = FileExtersion.GetFileInfos( __path, __searchPatterns );
|
translator.Push(L, gen_ret);
|
|
|
|
return 1;
|
}
|
|
} catch(System.Exception gen_e) {
|
return LuaAPI.luaL_error(L, "c# exception:" + gen_e);
|
}
|
|
}
|
|
[MonoPInvokeCallbackAttribute(typeof(LuaCSFunction))]
|
static int _m_GetAllDirectoryFileInfos_xlua_st_(RealStatePtr L)
|
{
|
try {
|
|
ObjectTranslator translator = ObjectTranslatorPool.Instance.Find(L);
|
|
|
|
|
{
|
string __path = LuaAPI.lua_tostring(L, 1);
|
System.Collections.Generic.List<System.IO.FileInfo> __fileInfos = (System.Collections.Generic.List<System.IO.FileInfo>)translator.GetObject(L, 2, typeof(System.Collections.Generic.List<System.IO.FileInfo>));
|
|
FileExtersion.GetAllDirectoryFileInfos( __path, __fileInfos );
|
|
|
|
return 0;
|
}
|
|
} catch(System.Exception gen_e) {
|
return LuaAPI.luaL_error(L, "c# exception:" + gen_e);
|
}
|
|
}
|
|
[MonoPInvokeCallbackAttribute(typeof(LuaCSFunction))]
|
static int _m_GetFileRelativePath_xlua_st_(RealStatePtr L)
|
{
|
try {
|
|
|
|
|
{
|
string __root = LuaAPI.lua_tostring(L, 1);
|
string __fileFullName = LuaAPI.lua_tostring(L, 2);
|
|
string gen_ret = FileExtersion.GetFileRelativePath( __root, __fileFullName );
|
LuaAPI.lua_pushstring(L, gen_ret);
|
|
|
|
return 1;
|
}
|
|
} catch(System.Exception gen_e) {
|
return LuaAPI.luaL_error(L, "c# exception:" + gen_e);
|
}
|
|
}
|
|
[MonoPInvokeCallbackAttribute(typeof(LuaCSFunction))]
|
static int _m_GetVersionFromFileName_xlua_st_(RealStatePtr L)
|
{
|
try {
|
|
|
|
|
{
|
string __fileName = LuaAPI.lua_tostring(L, 1);
|
|
int gen_ret = FileExtersion.GetVersionFromFileName( __fileName );
|
LuaAPI.xlua_pushinteger(L, gen_ret);
|
|
|
|
return 1;
|
}
|
|
} catch(System.Exception gen_e) {
|
return LuaAPI.luaL_error(L, "c# exception:" + gen_e);
|
}
|
|
}
|
|
[MonoPInvokeCallbackAttribute(typeof(LuaCSFunction))]
|
static int _m_RemoveVersionFromFileFullName_xlua_st_(RealStatePtr L)
|
{
|
try {
|
|
|
|
|
{
|
string __fullName = LuaAPI.lua_tostring(L, 1);
|
|
string gen_ret = FileExtersion.RemoveVersionFromFileFullName( __fullName );
|
LuaAPI.lua_pushstring(L, gen_ret);
|
|
|
|
return 1;
|
}
|
|
} catch(System.Exception gen_e) {
|
return LuaAPI.luaL_error(L, "c# exception:" + gen_e);
|
}
|
|
}
|
|
[MonoPInvokeCallbackAttribute(typeof(LuaCSFunction))]
|
static int _m_AddVersionToFileFullName_xlua_st_(RealStatePtr L)
|
{
|
try {
|
|
|
|
|
{
|
string __fullName = LuaAPI.lua_tostring(L, 1);
|
int __version = LuaAPI.xlua_tointeger(L, 2);
|
|
string gen_ret = FileExtersion.AddVersionToFileFullName( __fullName, __version );
|
LuaAPI.lua_pushstring(L, gen_ret);
|
|
|
|
return 1;
|
}
|
|
} catch(System.Exception gen_e) {
|
return LuaAPI.luaL_error(L, "c# exception:" + gen_e);
|
}
|
|
}
|
|
[MonoPInvokeCallbackAttribute(typeof(LuaCSFunction))]
|
static int _m_DirectoryCopy_xlua_st_(RealStatePtr L)
|
{
|
try {
|
|
|
|
|
{
|
string __from = LuaAPI.lua_tostring(L, 1);
|
string __to = LuaAPI.lua_tostring(L, 2);
|
|
FileExtersion.DirectoryCopy( __from, __to );
|
|
|
|
return 0;
|
}
|
|
} catch(System.Exception gen_e) {
|
return LuaAPI.luaL_error(L, "c# exception:" + gen_e);
|
}
|
|
}
|
|
[MonoPInvokeCallbackAttribute(typeof(LuaCSFunction))]
|
static int _m_GetMD5HashFromFile_xlua_st_(RealStatePtr L)
|
{
|
try {
|
|
|
|
|
{
|
string _fileName = LuaAPI.lua_tostring(L, 1);
|
|
string gen_ret = FileExtersion.GetMD5HashFromFile( _fileName );
|
LuaAPI.lua_pushstring(L, gen_ret);
|
|
|
|
return 1;
|
}
|
|
} catch(System.Exception gen_e) {
|
return LuaAPI.luaL_error(L, "c# exception:" + gen_e);
|
}
|
|
}
|
|
[MonoPInvokeCallbackAttribute(typeof(LuaCSFunction))]
|
static int _m_GetStringMD5Hash_xlua_st_(RealStatePtr L)
|
{
|
try {
|
|
|
|
|
{
|
string _str = LuaAPI.lua_tostring(L, 1);
|
|
string gen_ret = FileExtersion.GetStringMD5Hash( _str );
|
LuaAPI.lua_pushstring(L, gen_ret);
|
|
|
|
return 1;
|
}
|
|
} catch(System.Exception gen_e) {
|
return LuaAPI.luaL_error(L, "c# exception:" + gen_e);
|
}
|
|
}
|
|
[MonoPInvokeCallbackAttribute(typeof(LuaCSFunction))]
|
static int _m_ReadFileAllLines_xlua_st_(RealStatePtr L)
|
{
|
try {
|
|
ObjectTranslator translator = ObjectTranslatorPool.Instance.Find(L);
|
|
|
|
|
{
|
string _path = LuaAPI.lua_tostring(L, 1);
|
|
FileExtersion.LuaConfigData gen_ret = FileExtersion.ReadFileAllLines( _path );
|
translator.Push(L, gen_ret);
|
|
|
|
return 1;
|
}
|
|
} catch(System.Exception gen_e) {
|
return LuaAPI.luaL_error(L, "c# exception:" + gen_e);
|
}
|
|
}
|
|
|
|
|
|
|
|
|
|
|
}
|
}
|