private string GetJsonData()
        {
            var srcTxt      = _sourceTxt.text;
            var clearedText = srcTxt.Replace("\n", "");

            clearedText = clearedText.Replace("\t", "");
            clearedText = clearedText.Replace(" ", "");
            clearedText = clearedText.Replace(SpaceSpecial, " ");

            var removedBrackets = clearedText.Remove(0, 1);

            removedBrackets = removedBrackets.Remove(removedBrackets.Length - 1);

            var stringsSpliited = ParseDataScheme.ParseScheme(removedBrackets);

            var jsonData = stringsSpliited[1];

            jsonData = jsonData.Remove(jsonData.Length - 1);
            //Debug.Log(jsonData);
            var titleIndex = 0;

            jsonData = jsonData.Remove(titleIndex, DataStatic.Length);
            //Debug.Log(jsonData);
            //Debug.Log(titleIndex);
            return(jsonData);
        }
        private string GetJsonScheme()
        {
            var srcTxt      = _sourceTxt.text;
            var clearedText = srcTxt.Replace("\n", "");

            clearedText = clearedText.Replace("\t", "");
            clearedText = clearedText.Replace(" ", "");

            var removedBrackets = clearedText.Remove(0, 1);

            removedBrackets = removedBrackets.Remove(removedBrackets.Length - 1);

            var stringsSpliited = ParseDataScheme.ParseScheme(removedBrackets);

            var jsonScheme = stringsSpliited[0];

            jsonScheme = jsonScheme.Remove(jsonScheme.Length - 1);
            var titleIndex = jsonScheme.IndexOf(SchemeStatic, StringComparison.Ordinal);

            jsonScheme = jsonScheme.Remove(titleIndex, SchemeStatic.Length);

            return(jsonScheme);
        }
Exemple #3
0
        private static TableRecordsClass GetFields(TableDataClass data)
        {
            var innerDataList = ParseDataScheme.ParseScheme(data.ClassData).ToList();

            List <RecordData> records = new List <RecordData>();

            for (int i = 0; i < innerDataList.Count; i++)
            {
                string     str    = innerDataList[i];
                RecordData record = CreateRecord(str);
                if (record != null)
                {
                    records.Add(record);
                }
            }

            var tableRecordsClass = new TableRecordsClass
            {
                ClassName = data.ClassName,
                ClassData = records
            };

            return(tableRecordsClass);
        }
Exemple #4
0
 private static IEnumerable <string> GetTablesSrings(string jsonStr)
 {
     return(ParseDataScheme.ParseScheme(jsonStr));
 }