]> git.proxmox.com Git - mirror_edk2.git/blobdiff - Tools/Source/FrameworkWizard/src/org/tianocore/frameworkwizard/common/Tools.java
1. Merge ModuleDefinitions to MsaHeader
[mirror_edk2.git] / Tools / Source / FrameworkWizard / src / org / tianocore / frameworkwizard / common / Tools.java
index d5d16b8d651d496d8ff6e1c7acddbf60f457552f..a5345019ea2bb20e616265591dbcb3f84453c124 100644 (file)
@@ -27,6 +27,16 @@ import javax.swing.JComboBox;
 import javax.swing.JList;\r
 import javax.swing.JOptionPane;\r
 \r
+import org.tianocore.ModuleSurfaceAreaDocument.ModuleSurfaceArea;\r
+import org.tianocore.MsaHeaderDocument.MsaHeader;\r
+import org.tianocore.PackageSurfaceAreaDocument.PackageSurfaceArea;\r
+import org.tianocore.PlatformHeaderDocument.PlatformHeader;\r
+import org.tianocore.PlatformSurfaceAreaDocument.PlatformSurfaceArea;\r
+import org.tianocore.SpdHeaderDocument.SpdHeader;\r
+import org.tianocore.frameworkwizard.module.Identifications.ModuleIdentification;\r
+import org.tianocore.frameworkwizard.packaging.PackageIdentification;\r
+import org.tianocore.frameworkwizard.platform.PlatformIdentification;\r
+\r
 /**\r
  The class is used to provides some useful interfaces  \r
  \r
@@ -457,4 +467,31 @@ public class Tools {
         //\r
         return hexString.trim();\r
     }\r
+    \r
+    public static ModuleIdentification getId(String path, ModuleSurfaceArea msa) {\r
+        MsaHeader head = msa.getMsaHeader();\r
+        String name = head.getModuleName();\r
+        String guid = head.getGuidValue();\r
+        String version = head.getVersion();\r
+        ModuleIdentification id = new ModuleIdentification(name, guid, version, path);\r
+        return id;\r
+    }\r
+\r
+    public static PackageIdentification getId(String path, PackageSurfaceArea spd) {\r
+        SpdHeader head = spd.getSpdHeader();\r
+        String name = head.getPackageName();\r
+        String guid = head.getGuidValue();\r
+        String version = head.getVersion();\r
+        PackageIdentification id = new PackageIdentification(name, guid, version, path);\r
+        return id;\r
+    }\r
+\r
+    public static PlatformIdentification getId(String path, PlatformSurfaceArea fpd) {\r
+        PlatformHeader head = fpd.getPlatformHeader();\r
+        String name = head.getPlatformName();\r
+        String guid = head.getGuidValue();\r
+        String version = head.getVersion();\r
+        PlatformIdentification id = new PlatformIdentification(name, guid, version, path);\r
+        return id;\r
+    }\r
 }\r