예제 #1
0
        private static void GenerateStructImplementation(ProjectConfig config, string structName, string structCode)
        {
            Transpilers.AbstractTranspiler transpiler = LanguageUtil.GetTranspiler(config.Language);
            structCode = transpiler.WrapCodeForStructs(config, structCode);
            string fileExtension = LanguageUtil.GetFileExtension(config.Language);
            string path          = System.IO.Path.Combine(config.OutputDirStructs, structName + fileExtension);

            System.IO.File.WriteAllText(path, structCode);
        }
예제 #2
0
        private static void GenerateStructBundleImplementation(ProjectConfig config, string[] structOrder, Dictionary <string, string> structCodeByName)
        {
            Transpilers.AbstractTranspiler transpiler = LanguageUtil.GetTranspiler(config.Language);
            List <string> finalCode = new List <string>();

            foreach (string structName in structOrder)
            {
                finalCode.Add(transpiler.WrapCodeForStructs(config, structCodeByName[structName]));
            }
            finalCode.Insert(0, "<?php");
            finalCode.Add("?>");
            System.IO.File.WriteAllText(config.OutputDirStructs, string.Join(transpiler.NewLine, finalCode));
        }