]> git.proxmox.com Git - mirror_edk2.git/blobdiff - Tools/Source/MigrationTools/org/tianocore/migration/Common.java
Laplace, run
[mirror_edk2.git] / Tools / Source / MigrationTools / org / tianocore / migration / Common.java
index fb89dcae4dfa452e65d43b2e05ade852a577caca..6b1208c7c6ad59ae7602b91a1d85b901616c781a 100644 (file)
@@ -155,19 +155,17 @@ public final class Common {
                File test;\r
 \r
                if (type == DIR || type == BOTH) {\r
-                       if (fda.dirFilter(path)) {\r
-                               fda.run(path);\r
-                       }\r
+                       fda.run(path);\r
                }\r
                for (int i = 0 ; i < list.length ; i++) {\r
                        test = new File(path + File.separator + list[i]);\r
                        if (test.isDirectory()) {\r
-                               toDoAll(path + File.separator + list[i], fda, type);\r
+                               if (fda.filter(test)) {\r
+                                       toDoAll(path + File.separator + list[i], fda, type);\r
+                               }\r
                        } else {\r
                                if (type == FILE || type == BOTH) {\r
-                                       if (fda.fileFilter(path + File.separator + list[i])) {\r
-                                               fda.run(path + File.separator + list[i]);\r
-                                       }\r
+                                       fda.run(path + File.separator + list[i]);\r
                                }\r
                        }\r
                }\r
@@ -176,8 +174,14 @@ public final class Common {
        public static interface ForDoAll {\r
                public void run(String filepath) throws Exception;\r
                \r
-               public boolean dirFilter(String filepath);\r
+               public boolean filter(File dir);\r
+       }\r
+       \r
+       public static abstract class Laplace {\r
+               public final void transform(String src, String des) throws Exception {\r
+                       Common.string2file(operation(Common.file2string(src)), des);\r
+               }\r
                \r
-               public boolean fileFilter(String filepath);\r
+               public abstract String operation(String wholeline);\r
        }\r
 }\r