Example #1
0
        public static string[] GetAllExpiredCsvFile()
        {
            List <string> expiredCsvFiles = new List <string>();

            foreach (string csvFile in ListAllCsvFilesInCsvFolder())
            {
                string csvCodeFileName = JumpCsvEditorHelper.PathCombine(JumpCsvEditorHelper.PathCombine(Application.dataPath, JumpCsvConfig.CsvSourceCodeFileDirectory), JumpCsvEditorHelper.GetCsvDataClassName(csvFile) + ".cs");
                //string csvDataFileName = JumpCsvEditorHelper.PathCombine(JumpCsvEditorHelper.PathCombine(Application.dataPath, JumpCsvConfig.CsvBinDataDirectory) , JumpCsvEditorHelper.GetCsvDataBinaryFileName(csvFile));
                if (!File.Exists(csvCodeFileName))
                {
                    expiredCsvFiles.Add(csvFile);
                }
                else   // check content is latest
                {
                    string className   = JumpCsvEditorHelper.GetCsvDataClassName(csvFile);
                    Type   csvCodeType = CsvHelper.GetType("JumpCSV." + className);
                    int    hashCode    = (int)(csvCodeType.GetField("mHashCode").GetValue(null));

                    string         resourcePath = JumpCsvEditorHelper.PathCombine(Application.dataPath, "Build/CSV/Common");
                    string         path         = JumpCsvEditorHelper.MakeRelativePath(resourcePath, csvFile);
                    CsvSpreadSheet spreadSheet  = new CsvSpreadSheet(path.Replace(".csv", ""), true);                      //string content = reader.ReadToEnd();
                    //csvReader.ReadFromString(content);
                    int CheckSum = spreadSheet.GetHashCode();
                    if (CheckSum != hashCode)
                    {
                        expiredCsvFiles.Add(csvFile);
                    }
                }
            }
            return(expiredCsvFiles.ToArray());
        }
Example #2
0
        public static string[] GetAllLoseCsvCode()
        {
            List <string> csvCodeFiles = new List <string>();

            foreach (string csvFile in ListAllCsvFilesInCsvFolder())
            {
                string csvCodeFileName = JumpCsvEditorHelper.PathCombine(JumpCsvEditorHelper.PathCombine(Application.dataPath, JumpCsvConfig.CsvSourceCodeFileDirectory), JumpCsvEditorHelper.GetCsvDataClassName(csvFile) + ".cs");
                if (!File.Exists(csvCodeFileName))
                {
                    csvCodeFiles.Add(csvCodeFileName);
                }
            }
            return(csvCodeFiles.ToArray());
        }