少年修仙传客户端基础资源
hch
2020-12-07 002fe17a16f0a9fa5bb71654dd95c72c35f253b8
Assets/Plugins/LitJson/JsonWriter.cs
@@ -39,7 +39,7 @@
    public class JsonWriter
    {
        #region Fields
        private static NumberFormatInfo number_format;
        private static readonly NumberFormatInfo number_format;
        private WriterContext        context;
        private Stack<WriterContext> ctx_stack;
@@ -50,6 +50,7 @@
        private StringBuilder        inst_string_builder;
        private bool                 pretty_print;
        private bool                 validate;
        private bool                 lower_case_properties;
        private TextWriter           writer;
        #endregion
@@ -75,6 +76,11 @@
        public bool Validate {
            get { return validate; }
            set { validate = value; }
        }
        public bool LowerCaseProperties {
            get { return lower_case_properties; }
            set { lower_case_properties = value; }
        }
        #endregion
@@ -166,6 +172,7 @@
            indent_value = 4;
            pretty_print = false;
            validate = true;
            lower_case_properties = false;
            ctx_stack = new Stack<WriterContext> ();
            context = new WriterContext ();
@@ -216,7 +223,7 @@
                writer.Write (',');
            if (pretty_print && ! context.ExpectingValue)
                writer.Write ('\n');
                writer.Write (Environment.NewLine);
        }
        private void PutString (string str)
@@ -365,6 +372,7 @@
            context.ExpectingValue = false;
        }
        [CLSCompliant(false)]
        public void Write (ulong number)
        {
            DoValidation (Condition.Value);
@@ -441,14 +449,17 @@
        {
            DoValidation (Condition.Property);
            PutNewline ();
            string propertyName = (property_name == null || !lower_case_properties)
                ? property_name
                : property_name.ToLowerInvariant();
            PutString (property_name);
            PutString (propertyName);
            if (pretty_print) {
                if (property_name.Length > context.Padding)
                    context.Padding = property_name.Length;
                if (propertyName.Length > context.Padding)
                    context.Padding = propertyName.Length;
                for (int i = context.Padding - property_name.Length;
                for (int i = context.Padding - propertyName.Length;
                     i >= 0; i--)
                    writer.Write (' ');