Exemplo n.º 1
0
        public string[] getStringArray(string valueName)
        {
            ArrayJSON array = getArrayJSON(valueName);

            if (array != null)
            {
                string[] output = new string[array.Length];
                for (int i = 0; i < array.Length; i++)
                {
                    output[i] = array.getStringAt(i);
                }
                return(output);
            }
            return(null);
        }
Exemplo n.º 2
0
 public ArrayJSON(string json)
 {
     originalJSON = StringParsingTool.getBetweenSquareBracket(json);
     string[] elements = ParserJSON.getDataList(originalJSON);
     data = new object[elements.Length];
     for (int i = 0; i < elements.Length; i++)
     {
         string value = elements[i];
         if (ParserJSON.isStringObjectJSON(value))
         {
             data[i] = new ObjectJSON(value);
         }
         else if (ParserJSON.isStringArrayJSON(value))
         {
             data[i] = new ArrayJSON(value);
         }
         else
         {
             data[i] = StringParsingTool.cleanString(value);
         }
     }
 }
Exemplo n.º 3
0
        public ObjectJSON(string json)
        {
            originalJSON = StringParsingTool.getBetweenCurlyBracket(json);
            Dictionary <string, string> elements = ParserJSON.getDataDictionnary(originalJSON);

            data = new Dictionary <string, object>();
            foreach (string key in elements.Keys)
            {
                string value = elements[key];
                if (ParserJSON.isStringObjectJSON(value))
                {
                    data[key] = new ObjectJSON(value);
                }
                else if (ParserJSON.isStringArrayJSON(value))
                {
                    data[key] = new ArrayJSON(value);
                }
                else
                {
                    data[key] = StringParsingTool.cleanString(value);
                }
            }
        }