public static void GenerateCode(ProcessedInputFiles inputFiles, string outputDir) { Directory.CreateDirectory(outputDir); using (Formatter idlStreamWriter = new Formatter(Path.Combine(outputDir, inputFiles.FilenameBase + ".codegen.idl"))) { inputFiles.OutputDataTypes.OutputCode(inputFiles.TypeDictionary, idlStreamWriter); } }
static void Main(string[] args) { var inputDir = FindInputDirectory(); ProcessedInputFiles processedInputFiles = ProcessInputFiles(inputDir); GenerateCode(processedInputFiles, GetDefaultOutputLocation(inputDir)); GenerateEffectsCode(inputDir, processedInputFiles.TypeDictionary, GetDefaultEffectsOutputLocation(inputDir)); }
public static void GenerateCode(ProcessedInputFiles inputFiles, string outputDir) { Directory.CreateDirectory(outputDir); OutputFiles outputFiles = new OutputFiles(); using (Formatter cppStreamWriter = new Formatter(Path.Combine(outputDir, inputFiles.FilenameBase + ".codegen.cpp")), idlStreamWriter = new Formatter(Path.Combine(outputDir, inputFiles.FilenameBase + ".codegen.idl"))) { outputFiles.CppFile = cppStreamWriter; outputFiles.IdlFile = idlStreamWriter; inputFiles.OutputDataTypes.OutputCode(inputFiles.TypeDictionary, outputFiles); } }
public static ProcessedInputFiles ProcessInputFiles(string inputDir) { ProcessedInputFiles result = new ProcessedInputFiles(); List <string> files = GetInputFileList(); Overrides.XmlBindings.Settings overridesXmlData = XmlBindings.Utilities.LoadXmlData <Overrides.XmlBindings.Settings>(inputDir, "Settings.xml"); Formatter.Prefix = overridesXmlData.Prefix.Value; result.FilenameBase = overridesXmlData.FilenameBase.Value; List <D2DTypes> typeDocuments = new List <D2DTypes>(); result.TypeDictionary = new Dictionary <string, QualifiableType>(); result.OutputDataTypes = new OutputDataTypes(); foreach (string fileName in files) { XmlBindings.D2DTypes xmlDocument = XmlBindings.Utilities.LoadXmlData <XmlBindings.D2DTypes>(inputDir, fileName); typeDocuments.Add(new D2DTypes(xmlDocument, overridesXmlData, result.TypeDictionary, result.OutputDataTypes)); } return(result); }
public static ProcessedInputFiles ProcessInputFiles(string inputDir) { ProcessedInputFiles result = new ProcessedInputFiles(); List<string> files = GetInputFileList(); Overrides.XmlBindings.Settings overridesXmlData = XmlBindings.Utilities.LoadXmlData<Overrides.XmlBindings.Settings>(inputDir, "Settings.xml"); Formatter.Prefix = overridesXmlData.Prefix.Value; result.FilenameBase = overridesXmlData.FilenameBase.Value; List<D2DTypes> typeDocuments = new List<D2DTypes>(); result.TypeDictionary = new Dictionary<string, QualifiableType>(); result.OutputDataTypes = new OutputDataTypes(); foreach (string fileName in files) { XmlBindings.D2DTypes xmlDocument = XmlBindings.Utilities.LoadXmlData<XmlBindings.D2DTypes>(inputDir, fileName); typeDocuments.Add(new D2DTypes(xmlDocument, overridesXmlData, result.TypeDictionary, result.OutputDataTypes)); } return result; }
public static void GenerateCode(ProcessedInputFiles inputFiles, string outputDir) { Directory.CreateDirectory(outputDir); using (Formatter idlStreamWriter = new Formatter(Path.Combine(outputDir, inputFiles.FilenameBase + ".codegen.idl"))) { inputFiles.OutputDataTypes.OutputCode(inputFiles.TypeDictionary, idlStreamWriter); } }