]> git.proxmox.com Git - mirror_edk2.git/blobdiff - Tools/Source/MigrationTools/org/tianocore/migration/ModuleInfo.java
Turn to Regex in ModuleReader.java
[mirror_edk2.git] / Tools / Source / MigrationTools / org / tianocore / migration / ModuleInfo.java
index 220b3e8d4064485e8e3302c74a914c4b21db565d..5e3bbb50d02878f0ae17f47918d825942ebcb21c 100644 (file)
@@ -86,7 +86,7 @@ public class ModuleInfo {
                } else {\r
                        filename = ui.choose("Found .inf or .msa file in the module\nChoose one Please", msaorinf.toArray());\r
                }\r
-               ModuleReader mr = new ModuleReader(modulepath, this, db);\r
+               ModuleReader mr = new ModuleReader(modulepath, this, db, ui);\r
                if (filename.contains(".inf")) {\r
                        mr.readInf(filename);\r
                } else if (filename.contains(".msa")) {\r
@@ -130,19 +130,6 @@ public class ModuleInfo {
                ui.println(show + hash.size());\r
                ui.println(hash);\r
        }\r
-\r
-       public void ensureDir(String objFileWhole) {\r
-               Pattern ptnseparate = Pattern.compile("(.*)\\\\[^\\\\]*");\r
-               Matcher mtrseparate;\r
-               File tempdir;\r
-\r
-               mtrseparate = ptnseparate.matcher(objFileWhole);\r
-               if (mtrseparate.find()) {\r
-                       tempdir = new File(mtrseparate.group(1));\r
-                       if (!tempdir.exists()) tempdir.mkdirs();\r
-               }\r
-               \r
-       }\r
        \r
        // add '//' to all non-local include lines\r
        private void CommentOutNonLocalHFile() throws IOException {\r
@@ -158,7 +145,7 @@ public class ModuleInfo {
                while ( ii.hasNext() ) {\r
                        curFile = ii.next();\r
                        rd = new BufferedReader(new FileReader(modulepath + File.separator + curFile));\r
-                       ensureDir(modulepath + File.separator + "temp" + File.separator + curFile);\r
+                       Common.ensureDir(modulepath + File.separator + "temp" + File.separator + curFile);\r
                        outfile = new PrintWriter(new BufferedWriter(new FileWriter(modulepath + File.separator + "temp" + File.separator + curFile)));\r
                        while ((line = rd.readLine()) != null) {\r
                                if (line.contains("#include")) {\r