コード例 #1
0
        internal static string BuildPath(List <JsonPosition> positions, JsonPosition?currentPosition)
        {
            int capacity = 0;

            if (positions != null)
            {
                for (int i = 0; i < positions.Count; i++)
                {
                    capacity += positions[i].CalculateLength();
                }
            }
            if (currentPosition != null)
            {
                capacity += currentPosition.GetValueOrDefault().CalculateLength();
            }

            StringBuilder sb = new StringBuilder(capacity);

            if (positions != null)
            {
                foreach (JsonPosition state in positions)
                {
                    state.WriteTo(sb);
                }
            }
            if (currentPosition != null)
            {
                currentPosition.GetValueOrDefault().WriteTo(sb);
            }

            return(sb.ToString());
        }
コード例 #2
0
        // Token: 0x06000BBC RID: 3004 RVA: 0x0004EDBC File Offset: 0x0004CFBC
        internal static string BuildPath(List <JsonPosition> positions, JsonPosition?currentPosition)
        {
            int num = 0;

            if (positions != null)
            {
                for (int i = 0; i < positions.Count; i++)
                {
                    num += positions[i].CalculateLength();
                }
            }
            if (currentPosition != null)
            {
                num += currentPosition.GetValueOrDefault().CalculateLength();
            }
            StringBuilder stringBuilder = new StringBuilder(num);
            StringWriter  stringWriter  = null;

            char[] array = null;
            if (positions != null)
            {
                foreach (JsonPosition jsonPosition in positions)
                {
                    jsonPosition.WriteTo(stringBuilder, ref stringWriter, ref array);
                }
            }
            if (currentPosition != null)
            {
                currentPosition.GetValueOrDefault().WriteTo(stringBuilder, ref stringWriter, ref array);
            }
            return(stringBuilder.ToString());
        }
コード例 #3
0
        internal static string BuildPath(List <JsonPosition> positions, JsonPosition?currentPosition)
        {
            int capacity = 0;

            if (positions != null)
            {
                for (int i = 0; i < positions.Count; i++)
                {
                    capacity += positions[i].CalculateLength();
                }
            }
            if (currentPosition != null)
            {
                capacity += currentPosition.GetValueOrDefault().CalculateLength();
            }

            var          sb     = StringBuilderManager.Allocate(capacity);
            StringWriter writer = null;

            char[] buffer = null;
            if (positions != null)
            {
                foreach (JsonPosition state in positions)
                {
                    state.WriteTo(sb, ref writer, ref buffer);
                }
            }
            if (currentPosition != null)
            {
                currentPosition.GetValueOrDefault().WriteTo(sb, ref writer, ref buffer);
            }

            return(StringBuilderManager.ReturnAndFree(sb));
        }
コード例 #4
0
        internal static string BuildPath(List <JsonPosition> positions, JsonPosition?currentPosition)
        {
            var capacity = 0;

            if (positions != null)
            {
                for (var i = 0; i < positions.Count; i++)
                {
                    capacity += positions[i].CalculateLength();
                }
            }
            if (currentPosition != null)
            {
                capacity += currentPosition.GetValueOrDefault().CalculateLength();
            }

            var          sb     = new StringBuilder(capacity);
            StringWriter?writer = null;

            char[]? buffer = null;
            if (positions != null)
            {
                foreach (var state in positions)
                {
                    state.WriteTo(sb, ref writer, ref buffer);
                }
            }
            if (currentPosition != null)
            {
                currentPosition.GetValueOrDefault().WriteTo(sb, ref writer, ref buffer);
            }

            return(sb.ToString());
        }
コード例 #5
0
        internal static string BuildPath(List <JsonPosition> positions, JsonPosition?currentPosition)
        {
            JsonPosition item;
            int          num = 0;

            if (positions != null)
            {
                for (int i = 0; i < positions.Count; i++)
                {
                    item = positions[i];
                    num += item.CalculateLength();
                }
            }
            if (currentPosition.HasValue)
            {
                item = currentPosition.GetValueOrDefault();
                num += item.CalculateLength();
            }
            StringBuilder stringBuilder = new StringBuilder(num);

            if (positions != null)
            {
                foreach (JsonPosition position in positions)
                {
                    position.WriteTo(stringBuilder);
                }
            }
            if (currentPosition.HasValue)
            {
                currentPosition.GetValueOrDefault().WriteTo(stringBuilder);
            }
            return(stringBuilder.ToString());
        }
コード例 #6
0
        internal static string BuildPath(List <JsonPosition> positions, JsonPosition?currentPosition)
        {
            int          capacity = 0;
            JsonPosition jsonPosition;

            if (positions != null)
            {
                for (int index = 0; index < positions.Count; ++index)
                {
                    int num = capacity;
                    jsonPosition = positions[index];
                    int length = jsonPosition.CalculateLength();
                    capacity = num + length;
                }
            }

            if (currentPosition.HasValue)
            {
                int num = capacity;
                jsonPosition = currentPosition.GetValueOrDefault();
                int length = jsonPosition.CalculateLength();
                capacity = num + length;
            }

            StringBuilder sb = new StringBuilder(capacity);

            if (positions != null)
            {
                foreach (JsonPosition position in positions)
                {
                    position.WriteTo(sb);
                }
            }

            if (currentPosition.HasValue)
            {
                jsonPosition = currentPosition.GetValueOrDefault();
                jsonPosition.WriteTo(sb);
            }

            return(sb.ToString());
        }