/// <summary> /// Writes a BSON regular expression to the writer. /// </summary> /// <param name="regex">A BsonRegularExpression.</param> public override void WriteRegularExpression(BsonRegularExpression regex) { if (Disposed) { throw new ObjectDisposedException("BsonBinaryWriter"); } if (State != BsonWriterState.Value) { ThrowInvalidState("WriteRegularExpression", BsonWriterState.Value); } _bsonStream.WriteBsonType(BsonType.RegularExpression); WriteNameHelper(); _bsonStream.WriteCString(regex.Pattern); _bsonStream.WriteCString(regex.Options); State = GetNextState(); }
static int _m_WriteCString(RealStatePtr L) { try { ObjectTranslator translator = ObjectTranslatorPool.Instance.Find(L); MongoDB.Bson.IO.BsonStream gen_to_be_invoked = (MongoDB.Bson.IO.BsonStream)translator.FastGetCSObj(L, 1); { string _value = LuaAPI.lua_tostring(L, 2); gen_to_be_invoked.WriteCString(_value); return(0); } } catch (System.Exception gen_e) { return(LuaAPI.luaL_error(L, "c# exception:" + gen_e)); } }