Esempio n. 1
0
        static int __CreateInstance(RealStatePtr L)
        {
            try {
                ObjectTranslator translator = ObjectTranslatorPool.Instance.Find(L);
                if (LuaAPI.lua_gettop(L) == 3 && translator.Assignable <MongoDB.Bson.IO.IByteBuffer>(L, 2) && LuaTypes.LUA_TBOOLEAN == LuaAPI.lua_type(L, 3))
                {
                    MongoDB.Bson.IO.IByteBuffer _buffer = (MongoDB.Bson.IO.IByteBuffer)translator.GetObject(L, 2, typeof(MongoDB.Bson.IO.IByteBuffer));
                    bool _ownsBuffer = LuaAPI.lua_toboolean(L, 3);

                    MongoDB.Bson.IO.ByteBufferStream gen_ret = new MongoDB.Bson.IO.ByteBufferStream(_buffer, _ownsBuffer);
                    translator.Push(L, gen_ret);

                    return(1);
                }
                if (LuaAPI.lua_gettop(L) == 2 && translator.Assignable <MongoDB.Bson.IO.IByteBuffer>(L, 2))
                {
                    MongoDB.Bson.IO.IByteBuffer _buffer = (MongoDB.Bson.IO.IByteBuffer)translator.GetObject(L, 2, typeof(MongoDB.Bson.IO.IByteBuffer));

                    MongoDB.Bson.IO.ByteBufferStream gen_ret = new MongoDB.Bson.IO.ByteBufferStream(_buffer);
                    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 MongoDB.Bson.IO.ByteBufferStream constructor!"));
        }
Esempio n. 2
0
        static int _m_Write(RealStatePtr L)
        {
            try {
                ObjectTranslator translator = ObjectTranslatorPool.Instance.Find(L);


                MongoDB.Bson.IO.ByteBufferStream gen_to_be_invoked = (MongoDB.Bson.IO.ByteBufferStream)translator.FastGetCSObj(L, 1);



                {
                    byte[] _buffer = LuaAPI.lua_tobytes(L, 2);
                    int    _offset = LuaAPI.xlua_tointeger(L, 3);
                    int    _count  = LuaAPI.xlua_tointeger(L, 4);

                    gen_to_be_invoked.Write(_buffer, _offset, _count);



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


                MongoDB.Bson.IO.ByteBufferStream gen_to_be_invoked = (MongoDB.Bson.IO.ByteBufferStream)translator.FastGetCSObj(L, 1);



                {
                    long _offset = LuaAPI.lua_toint64(L, 2);
                    System.IO.SeekOrigin _origin; translator.Get(L, 3, out _origin);

                    long gen_ret = gen_to_be_invoked.Seek(_offset, _origin);
                    LuaAPI.lua_pushint64(L, gen_ret);



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

                MongoDB.Bson.IO.ByteBufferStream gen_to_be_invoked = (MongoDB.Bson.IO.ByteBufferStream)translator.FastGetCSObj(L, 1);
                gen_to_be_invoked.Position = LuaAPI.lua_toint64(L, 2);
            } catch (System.Exception gen_e) {
                return(LuaAPI.luaL_error(L, "c# exception:" + gen_e));
            }
            return(0);
        }
Esempio n. 5
0
        static int _g_get_Length(RealStatePtr L)
        {
            try {
                ObjectTranslator translator = ObjectTranslatorPool.Instance.Find(L);

                MongoDB.Bson.IO.ByteBufferStream gen_to_be_invoked = (MongoDB.Bson.IO.ByteBufferStream)translator.FastGetCSObj(L, 1);
                LuaAPI.lua_pushint64(L, gen_to_be_invoked.Length);
            } catch (System.Exception gen_e) {
                return(LuaAPI.luaL_error(L, "c# exception:" + gen_e));
            }
            return(1);
        }
Esempio n. 6
0
        static int _m_SkipCString(RealStatePtr L)
        {
            try {
                ObjectTranslator translator = ObjectTranslatorPool.Instance.Find(L);


                MongoDB.Bson.IO.ByteBufferStream gen_to_be_invoked = (MongoDB.Bson.IO.ByteBufferStream)translator.FastGetCSObj(L, 1);



                {
                    gen_to_be_invoked.SkipCString(  );



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


                MongoDB.Bson.IO.ByteBufferStream gen_to_be_invoked = (MongoDB.Bson.IO.ByteBufferStream)translator.FastGetCSObj(L, 1);



                {
                    MongoDB.Bson.IO.IByteBuffer gen_ret = gen_to_be_invoked.ReadSlice(  );
                    translator.PushAny(L, gen_ret);



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


                MongoDB.Bson.IO.ByteBufferStream gen_to_be_invoked = (MongoDB.Bson.IO.ByteBufferStream)translator.FastGetCSObj(L, 1);



                {
                    MongoDB.Bson.ObjectId _value; translator.Get(L, 2, out _value);

                    gen_to_be_invoked.WriteObjectId(_value);



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


                MongoDB.Bson.IO.ByteBufferStream gen_to_be_invoked = (MongoDB.Bson.IO.ByteBufferStream)translator.FastGetCSObj(L, 1);



                {
                    string _value = LuaAPI.lua_tostring(L, 2);
                    System.Text.UTF8Encoding _encoding = (System.Text.UTF8Encoding)translator.GetObject(L, 3, typeof(System.Text.UTF8Encoding));

                    gen_to_be_invoked.WriteString(_value, _encoding);



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


                MongoDB.Bson.IO.ByteBufferStream gen_to_be_invoked = (MongoDB.Bson.IO.ByteBufferStream)translator.FastGetCSObj(L, 1);



                {
                    System.Text.UTF8Encoding _encoding = (System.Text.UTF8Encoding)translator.GetObject(L, 2, typeof(System.Text.UTF8Encoding));

                    string gen_ret = gen_to_be_invoked.ReadString(_encoding);
                    LuaAPI.lua_pushstring(L, gen_ret);



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