diff --git a/commonItems/Linguistics/adjective_rewrite_rules.txt b/commonItems/Linguistics/adjective_rewrite_rules.txt index 02c39d0c..ba320770 100644 --- a/commonItems/Linguistics/adjective_rewrite_rules.txt +++ b/commonItems/Linguistics/adjective_rewrite_rules.txt @@ -51,4 +51,3 @@ {"* Graeca", "Graeco-*"}, {"* pros to Latmo", "*"}, // Alexandreia pros to Latmo -{"* The Fort", "*"}, // "The Fort" in Arabic \ No newline at end of file diff --git a/commonItems/Parser.cs b/commonItems/Parser.cs index 9f5e2f11..369a2dc3 100644 --- a/commonItems/Parser.cs +++ b/commonItems/Parser.cs @@ -375,6 +375,22 @@ private static void FastForwardTo0Depth(BufferedReader reader, ref int braceDept return reader; } + public void ParseFolder(string path, string extensions, bool recursive, bool logFilePaths = false) { + var searchPattern = recursive ? "*" : "*.*"; + var searchOption = recursive ? SearchOption.AllDirectories : SearchOption.TopDirectoryOnly; + var files = Directory.GetFiles(path, searchPattern, searchOption); + + var validExtensions = extensions.Split(';'); + files.RemoveWhere(f => !validExtensions.Contains(CommonFunctions.GetExtension(f))); + + foreach (var file in files) { + if (logFilePaths) { + Logger.Debug($"Parsing file: {file}"); + } + ParseFile(file); + } + } + /// /// Parses a game folder in both vanilla game and mods directory. /// For example: diff --git a/commonItems/commonItems.csproj b/commonItems/commonItems.csproj index 41777a59..d6846383 100644 --- a/commonItems/commonItems.csproj +++ b/commonItems/commonItems.csproj @@ -6,7 +6,7 @@ False PGCG.$(AssemblyName) - 10.0.4 + 10.1.0 PGCG https://github.com/ParadoxGameConverters/commonItems.NET https://github.com/ParadoxGameConverters/commonItems.NET