Skip to main content
Version: 5.11.8

Data Type

All data stored in BACKND are in a string format.
To allow each data type to be recognized, all pieces of data have their types as key values.

ClassificationData TypeDescription
BOOLboolIncludes the data in boolean format.
NnumbersIncludes all number type data, such as int, float, and double.
SstringIncludes all data in string format.
LlistIncludes data in list format.
MmapIncludes data in map and dictionary formats.
NULLnullIncludes data that does not have a value.

Identifying the data format of the JSON value to be returned

Method that returns the data format of Jsondata's key

public static string WhichDataTypeIsIt(LitJson.JsonData data, string key)
{
if(data.Keys.Contains(key))
{
if(data[key].Keys.Contains("S")) // string
return "S";
else if(data[key].Keys.Contains("N")) // number
return "N";
else if(data[key].Keys.Contains("M")) // map
return "M";
else if(data[key].Keys.Contains("L")) // list
return "L";
else if(data[key].Keys.Contains("BOOL")) // boolean
return "BOOL";
else if(data[key].Keys.Contains("NULL")) // null
return "NULL";
else
return null;
}
else
{
return null;
}
}

Method that returns the data format of the nth value of JsonData in a list format

public static string WhichDataTypeIsIt(LitJson.JsonData data, int n)
{
if(data.IsArray)
{
if(data[n].Keys.Contains("S")) // string
return "S";
else if(data[n].Keys.Contains("N")) // number
return "N";
else if(data[n].Keys.Contains("M")) // map
return "M";
else if(data[n].Keys.Contains("L")) // list
return "L";
else if(data[n].Keys.Contains("BOOL")) // boolean
return "BOOL";
else if(data[n].Keys.Contains("NULL")) // null
return "NULL";
else
return null;
}
else
{
return null;
}
}