static void Main(string[] args) { CSVGenCode.Debug.Log(TempletPath); var gener = new CSVGenCode.CSVToCppCodeGen(); gener.GenCode(InputDir, OutputDir, TempletPath, ConfigFile); }
static void Main(string[] args) { bool hasNoArgs = args.Length == 0; if (hasNoArgs) { const string numFileName = "num.txt"; const string configFilePrefix = "config{0}.txt"; //模拟输入 var numStr = File.ReadAllText("num.txt"); int num = 0; if (int.TryParse(numStr, out num)) { num = num % 2; } else { Debug.LogError("hasNoArgs and num.txt parse error" + numStr); return; } File.WriteAllText(numFileName, (num + 1).ToString()); args = File.ReadAllLines(string.Format(configFilePrefix, num)); } foreach (var arg in args) { DealParams(arg); } if (isHelp) { return; } if (isExl2Csv) { if (CheckInvalid(InputDir, "InputDir", "i") || CheckInvalid(OutputDir, "OutputDir", "o") || CheckInvalid(ConfigFile, "ConfigFile", "r") ) { Console.Read(); return; } ConfigHelper.ReadConfig(_P(ConfigFile)); var gener = new CSVGenCode.Exl2CSV(); gener.ConvertCSV(DealInputDir(), _P(OutputDir)); } else { if (CheckInvalid(TempletPath, "TempletPath", "t") || CheckInvalid(InputDir, "InputDir", "i") || CheckInvalid(OutputDir, "OutputDir", "o") || CheckInvalid(ConfigFile, "ConfigFile", "r") ) { Console.Read(); return; } ConfigHelper.ReadConfig(_P(ConfigFile)); var gener = new CSVGenCode.CSVToCppCodeGen(); gener.GenCode(DealInputDir(), _P(OutputDir), _P(TempletPath)); } if (hasNoArgs) { Console.Read(); } }
public static void CSVGenCode() { var gener = new CSVGenCode.CSVToCppCodeGen(); gener.GenCode(InputDir, OutputDir, TempletPath, ConfigFile); }