public void WriteObject(BlittableJsonReaderObject obj)
        {
            if (obj == null)
            {
                WriteNull();
                return;
            }

            WriteStartObject();
            var props = obj.GetPropertiesByInsertionOrder();
            var prop  = new BlittableJsonReaderObject.PropertyDetails();

            for (int i = 0; i < props.Length; i++)
            {
                if (i != 0)
                {
                    WriteComma();
                }

                obj.GetPropertyByIndex(props[i], ref prop);
                WritePropertyName(prop.Name);

                WriteValue(prop.Token & BlittableJsonReaderBase.TypesMask, prop.Value);
            }

            WriteEndObject();
        }
Beispiel #2
0
        public void WriteObject(BlittableJsonReaderObject obj)
        {
            if (obj == null)
            {
                WriteNull();
                return;
            }

            WriteStartObject();

            var prop = new BlittableJsonReaderObject.PropertyDetails();

            using (var buffer = obj.GetPropertiesByInsertionOrder())
            {
                var props = buffer.Properties;
                for (int i = 0; i < props.Count; i++)
                {
                    if (i != 0)
                    {
                        WriteComma();
                    }

                    obj.GetPropertyByIndex(props.Array[i + props.Offset], ref prop);
                    WritePropertyName(prop.Name);

                    WriteValue(prop.Token & BlittableJsonReaderBase.TypesMask, prop.Value);
                }
            }


            WriteEndObject();
        }
Beispiel #3
0
        public void WriteObject(BlittableJsonReaderObject obj)
        {
            WriteStartObject();
            for (int i = 0; i < obj.Count; i++)
            {
                if (i != 0)
                {
                    WriteComma();
                }
                var prop = obj.GetPropertyByIndex(i);
                WritePropertyName(prop.Item1);

                WriteValue(prop.Item3 & BlittableJsonReaderObject.TypesMask, prop.Item2, originalPropertyOrder: false);
            }

            WriteEndObject();
        }
Beispiel #4
0
        public void WriteObject(BlittableJsonReaderObject obj)
        {
            WriteStartObject();
            var prop = new BlittableJsonReaderObject.PropertyDetails();

            for (int i = 0; i < obj.Count; i++)
            {
                if (i != 0)
                {
                    WriteComma();
                }
                obj.GetPropertyByIndex(i, ref prop);
                WritePropertyName(prop.Name);

                WriteValue(prop.Token & BlittableJsonReaderObject.TypesMask, prop.Value, originalPropertyOrder: false);
            }

            WriteEndObject();
        }
Beispiel #5
0
        public void WriteObjectOrdered(BlittableJsonReaderObject obj)
        {
            WriteStartObject();
            var props = obj.GetPropertiesByInsertionOrder();

            for (int i = 0; i < props.Length; i++)
            {
                if (i != 0)
                {
                    WriteComma();
                }

                var prop = obj.GetPropertyByIndex(props[i]);
                WritePropertyName(prop.Item1);

                WriteValue(prop.Item3 & BlittableJsonReaderBase.TypesMask, prop.Item2, originalPropertyOrder: true);
            }

            WriteEndObject();
        }