C++: Generate output in a folder

This commit is contained in:
Katy Coe
2020-07-18 19:18:08 +02:00
parent e74663a2ba
commit 632d1d2d9b
4 changed files with 20 additions and 15 deletions

View File

@@ -22,8 +22,15 @@ namespace Il2CppInspector.Outputs
public CppScaffolding(AppModel model) => this.model = model;
public void WriteCppToFile(string outputFile) {
using var fs = new FileStream(outputFile, FileMode.Create);
public void Write(string outputPath) {
// Ensure output directory exists and is not a file
// A System.IOException will be thrown if it's a file'
Directory.CreateDirectory(outputPath);
// Write il2cpp-types.h
var typeHeaderFile = Path.Combine(outputPath, "il2cpp-types.h");
using var fs = new FileStream(typeHeaderFile, FileMode.Create);
writer = new StreamWriter(fs, Encoding.UTF8);
writeLine("// Generated C++ file by Il2CppInspector - http://www.djkaty.com - https://github.com/djkaty");