]> git.proxmox.com Git - mirror_edk2.git/blobdiff - Tools/Java/Source/FrameworkWizard/src/org/tianocore/frameworkwizard/common/GlobalData.java
1. Fix EDKT463: When wizard new or clone a msa/spd/fpd, should follow these rules
[mirror_edk2.git] / Tools / Java / Source / FrameworkWizard / src / org / tianocore / frameworkwizard / common / GlobalData.java
index 83a6dd052aac7ef57eafc6cfa6e1565e81808a0d..ed175e53430a01af51227f21f748707651dbe338 100644 (file)
@@ -210,8 +210,8 @@ public class GlobalData {
      @return\r
      \r
      **/\r
-    public static ModuleIdentification findModuleIdByGuidVersion(String moduleGuid, String moduleVersion,\r
-                                                                 String packageGuid, String packageVersion) {\r
+    public static ModuleIdentification findModuleId(String moduleGuid, String moduleVersion, String packageGuid,\r
+                                                    String packageVersion) {\r
         ModuleIdentification mid = null;\r
         for (int index = 0; index < vModuleList.size(); index++) {\r
             if (vModuleList.elementAt(index).equals(moduleGuid, moduleVersion, packageGuid, packageVersion)) {\r
@@ -230,7 +230,7 @@ public class GlobalData {
      @return\r
      \r
      **/\r
-    public static PackageIdentification findPackageIdByGuidVersion(String packageGuid, String packageVersion) {\r
+    public static PackageIdentification findPackageId(String packageGuid, String packageVersion) {\r
         PackageIdentification pid = null;\r
         for (int index = 0; index < vPackageList.size(); index++) {\r
             if (vPackageList.elementAt(index).equals(packageGuid, packageVersion)) {\r
@@ -249,7 +249,7 @@ public class GlobalData {
      @return\r
      \r
      **/\r
-    public static PlatformIdentification findPlatformIdByGuidVersion(String platformGuid, String platformVersion) {\r
+    public static PlatformIdentification findPlatformId(String platformGuid, String platformVersion) {\r
         PlatformIdentification pid = null;\r
         for (int index = 0; index < vPlatformList.size(); index++) {\r
             if (vPlatformList.elementAt(index).equals(platformGuid, platformVersion)) {\r
@@ -259,4 +259,42 @@ public class GlobalData {
         }\r
         return pid;\r
     }\r
+\r
+    /**\r
+    \r
+     @param relativePath\r
+     @param mode\r
+     @return\r
+    \r
+    **/\r
+    public static boolean isDuplicateRelativePath(String relativePath, int mode) {\r
+        if (mode == DataType.RETURN_TYPE_MODULE_SURFACE_AREA) {\r
+            for (int index = 0; index < vModuleList.size(); index++) {\r
+                String path = vModuleList.elementAt(index).getPath();\r
+                if (Tools.getFilePathOnly(path).equals(relativePath)) {\r
+                    return true;\r
+                }\r
+            }\r
+        }\r
+\r
+        if (mode == DataType.RETURN_TYPE_PACKAGE_SURFACE_AREA) {\r
+            for (int index = 0; index < vPackageList.size(); index++) {\r
+                String path = vPackageList.elementAt(index).getPath();\r
+                if (Tools.getFilePathOnly(path).equals(relativePath)) {\r
+                    return true;\r
+                }\r
+            }\r
+        }\r
+\r
+        if (mode == DataType.RETURN_TYPE_PLATFORM_SURFACE_AREA) {\r
+            for (int index = 0; index < vPlatformList.size(); index++) {\r
+                String path = vPlatformList.elementAt(index).getPath();\r
+                if (Tools.getFilePathOnly(path).equals(relativePath)) {\r
+                    return true;\r
+                }\r
+            }\r
+        }\r
+\r
+        return false;\r
+    }\r
 }\r