static int _g_get_binaryWriter(RealStatePtr L)
        {
            try {
                ObjectTranslator translator = ObjectTranslatorPool.Instance.Find(L);

                CustomDataStruct.StreamBuffer gen_to_be_invoked = (CustomDataStruct.StreamBuffer)translator.FastGetCSObj(L, 1);
                translator.Push(L, gen_to_be_invoked.binaryWriter);
            } catch (System.Exception gen_e) {
                return(LuaAPI.luaL_error(L, "c# exception:" + gen_e));
            }
            return(1);
        }
Beispiel #2
0
        static int _m_GetBuffer_xlua_st_(RealStatePtr L)
        {
            try {
                ObjectTranslator translator = ObjectTranslatorPool.Instance.Find(L);



                int gen_param_count = LuaAPI.lua_gettop(L);

                if (gen_param_count == 1 && LuaTypes.LUA_TNUMBER == LuaAPI.lua_type(L, 1))
                {
                    int _expectedSize = LuaAPI.xlua_tointeger(L, 1);

                    byte[] gen_ret = CustomDataStruct.StreamBufferPool.GetBuffer(_expectedSize);
                    LuaAPI.lua_pushstring(L, gen_ret);



                    return(1);
                }
                if (gen_param_count == 1 && translator.Assignable <CustomDataStruct.StreamBuffer>(L, 1))
                {
                    CustomDataStruct.StreamBuffer _streamBuffer = (CustomDataStruct.StreamBuffer)translator.GetObject(L, 1, typeof(CustomDataStruct.StreamBuffer));

                    byte[] gen_ret = CustomDataStruct.StreamBufferPool.GetBuffer(_streamBuffer);
                    LuaAPI.lua_pushstring(L, gen_ret);



                    return(1);
                }
                if (gen_param_count == 3 && translator.Assignable <CustomDataStruct.StreamBuffer>(L, 1) && LuaTypes.LUA_TNUMBER == LuaAPI.lua_type(L, 2) && LuaTypes.LUA_TNUMBER == LuaAPI.lua_type(L, 3))
                {
                    CustomDataStruct.StreamBuffer _streamBuffer = (CustomDataStruct.StreamBuffer)translator.GetObject(L, 1, typeof(CustomDataStruct.StreamBuffer));
                    int _start  = LuaAPI.xlua_tointeger(L, 2);
                    int _length = LuaAPI.xlua_tointeger(L, 3);

                    byte[] gen_ret = CustomDataStruct.StreamBufferPool.GetBuffer(_streamBuffer, _start, _length);
                    LuaAPI.lua_pushstring(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 CustomDataStruct.StreamBufferPool.GetBuffer!"));
        }
Beispiel #3
0
        static int _m_RecycleStream_xlua_st_(RealStatePtr L)
        {
            try {
                ObjectTranslator translator = ObjectTranslatorPool.Instance.Find(L);



                {
                    CustomDataStruct.StreamBuffer _stream = (CustomDataStruct.StreamBuffer)translator.GetObject(L, 1, typeof(CustomDataStruct.StreamBuffer));

                    CustomDataStruct.StreamBufferPool.RecycleStream(_stream);



                    return(0);
                }
            } catch (System.Exception gen_e) {
                return(LuaAPI.luaL_error(L, "c# exception:" + gen_e));
            }
        }
        static int __CreateInstance(RealStatePtr L)
        {
            try {
                ObjectTranslator translator = ObjectTranslatorPool.Instance.Find(L);
                if (LuaAPI.lua_gettop(L) == 4 && LuaTypes.LUA_TNUMBER == LuaAPI.lua_type(L, 2) && LuaTypes.LUA_TBOOLEAN == LuaAPI.lua_type(L, 3) && LuaTypes.LUA_TBOOLEAN == LuaAPI.lua_type(L, 4))
                {
                    int  _bufferSize = LuaAPI.xlua_tointeger(L, 2);
                    bool _canWrite   = LuaAPI.lua_toboolean(L, 3);
                    bool _canRead    = LuaAPI.lua_toboolean(L, 4);

                    CustomDataStruct.StreamBuffer gen_ret = new CustomDataStruct.StreamBuffer(_bufferSize, _canWrite, _canRead);
                    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 CustomDataStruct.StreamBuffer constructor!"));
        }
        static int _m_Dispose(RealStatePtr L)
        {
            try {
                ObjectTranslator translator = ObjectTranslatorPool.Instance.Find(L);


                CustomDataStruct.StreamBuffer gen_to_be_invoked = (CustomDataStruct.StreamBuffer)translator.FastGetCSObj(L, 1);



                {
                    gen_to_be_invoked.Dispose(  );



                    return(0);
                }
            } catch (System.Exception gen_e) {
                return(LuaAPI.luaL_error(L, "c# exception:" + gen_e));
            }
        }
        static int _m_GetBuffer(RealStatePtr L)
        {
            try {
                ObjectTranslator translator = ObjectTranslatorPool.Instance.Find(L);


                CustomDataStruct.StreamBuffer gen_to_be_invoked = (CustomDataStruct.StreamBuffer)translator.FastGetCSObj(L, 1);



                {
                    byte[] gen_ret = gen_to_be_invoked.GetBuffer(  );
                    LuaAPI.lua_pushstring(L, gen_ret);



                    return(1);
                }
            } catch (System.Exception gen_e) {
                return(LuaAPI.luaL_error(L, "c# exception:" + gen_e));
            }
        }
        static int _m_ToArray(RealStatePtr L)
        {
            try {
                ObjectTranslator translator = ObjectTranslatorPool.Instance.Find(L);


                CustomDataStruct.StreamBuffer gen_to_be_invoked = (CustomDataStruct.StreamBuffer)translator.FastGetCSObj(L, 1);


                int gen_param_count = LuaAPI.lua_gettop(L);

                if (gen_param_count == 1)
                {
                    byte[] gen_ret = gen_to_be_invoked.ToArray(  );
                    LuaAPI.lua_pushstring(L, gen_ret);



                    return(1);
                }
                if (gen_param_count == 3 && LuaTypes.LUA_TNUMBER == LuaAPI.lua_type(L, 2) && LuaTypes.LUA_TNUMBER == LuaAPI.lua_type(L, 3))
                {
                    int _start  = LuaAPI.xlua_tointeger(L, 2);
                    int _length = LuaAPI.xlua_tointeger(L, 3);

                    byte[] gen_ret = gen_to_be_invoked.ToArray(_start, _length);
                    LuaAPI.lua_pushstring(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 CustomDataStruct.StreamBuffer.ToArray!"));
        }
        static int _m_SetPosition(RealStatePtr L)
        {
            try {
                ObjectTranslator translator = ObjectTranslatorPool.Instance.Find(L);


                CustomDataStruct.StreamBuffer gen_to_be_invoked = (CustomDataStruct.StreamBuffer)translator.FastGetCSObj(L, 1);



                {
                    long _offset = LuaAPI.lua_toint64(L, 2);

                    gen_to_be_invoked.SetPosition(_offset);



                    return(0);
                }
            } catch (System.Exception gen_e) {
                return(LuaAPI.luaL_error(L, "c# exception:" + gen_e));
            }
        }
Beispiel #9
0
        static int _m_GetStream_xlua_st_(RealStatePtr L)
        {
            try {
                ObjectTranslator translator = ObjectTranslatorPool.Instance.Find(L);



                {
                    int  _expectedSize = LuaAPI.xlua_tointeger(L, 1);
                    bool _canWrite     = LuaAPI.lua_toboolean(L, 2);
                    bool _canRead      = LuaAPI.lua_toboolean(L, 3);

                    CustomDataStruct.StreamBuffer gen_ret = CustomDataStruct.StreamBufferPool.GetStream(_expectedSize, _canWrite, _canRead);
                    translator.Push(L, gen_ret);



                    return(1);
                }
            } catch (System.Exception gen_e) {
                return(LuaAPI.luaL_error(L, "c# exception:" + gen_e));
            }
        }