예제 #1
0
파일: Program.cs 프로젝트: Beittin/OOP_JSON
        /// <summary>
        /// Fills the contents of a <seealso cref="JSON_Array.Value"/>
        /// </summary>
        /// <param name="arr">The <seealso cref="JSON_Array"/></param>
        /// <param name="json">The string being parsed</param>
        /// <param name="index">The starting index of <paramref name="json"/></param>
        /// <returns>
        /// The number of characters to trim from <paramref name="json"/>
        /// </returns>
        static int FillArray(JSON_Array arr, string json, int index)
        {
            int  i        = 0;
            char end_char = json[0];

            if (end_char == ']')
            {
                return(1);
            }
            do
            {
                // The value could be any kind of JSON type
                // This is where the recursion sets in
                dynamic value = GetBase(json[0]);
                index = HandleBase(value, json);
                i    += index;
                i    += TrimString(ref json, index);
                arr.Value.Add(value);
                end_char = json[0];
                ++i; // increment to match next line
                i += TrimString(ref json, 1);
            } while (end_char == ',');
            return(i);
        }
예제 #2
0
파일: JSON.cs 프로젝트: nyanzebra/JSON
 public void remove(JSON json)
 {
     JSON_Array.Remove(json);
 }
예제 #3
0
파일: JSON.cs 프로젝트: nyanzebra/JSON
 public void add(JSON json)
 {
     JSON_Array.Add(json);
 }
예제 #4
0
파일: JSON.cs 프로젝트: nyanzebra/JSON
 public List <JSON> .Enumerator GetEnumerator()
 {
     return(JSON_Array.GetEnumerator());
 }