Пример #1
0
        public void ModifyItem(ItemModifyMode mode, byte[] itemJson, params string[] precepts)
        {
            using (var writer = new CJsonWriter())
            {
                writer.PutVarCUInt((int)DataFormat.FormatJson); // format
                writer.PutVarCUInt((int)mode);                  // mode
                writer.PutVarCUInt(0);                          // stateToken

                writer.PutVarCUInt(precepts.Length);            // len(precepts)
                foreach (var precept in precepts)
                {
                    writer.PutVString(precept);
                }

                reindexer_buffer.PinBufferFor(writer.CurrentBuffer, args =>
                {
                    using (var data = itemJson.GetHandle())
                    {
                        Assert.ThrowIfError(() => ReindexerBinding.reindexer_modify_item_packed_tx(_rx, _tr, args, data.Buffer));
                    }
                });
            }
        }