]> git.proxmox.com Git - mirror_edk2.git/blobdiff - Tools/Source/GenBuild/org/tianocore/build/global/SurfaceAreaQuery.java
1) Fix a bug for PCD autogen tools, see track#115 in PVCS: Module's PCD informtion...
[mirror_edk2.git] / Tools / Source / GenBuild / org / tianocore / build / global / SurfaceAreaQuery.java
index 03c8d4328d6e8a4fef1f33b90bee6039a3c16074..ed6d0a2f183364970d6440a046f6b8d2bbdaddb3 100644 (file)
@@ -43,7 +43,7 @@ import org.tianocore.OutputDirectoryDocument;
 import org.tianocore.PPIsDocument;\r
 import org.tianocore.PackageNameDocument;\r
 import org.tianocore.ProtocolsDocument;\r
-import org.tianocore.PCDsDocument.PCDs;\r
+import org.tianocore.PcdCodedDocument.PcdCoded;\r
 \r
 /**\r
   SurfaceAreaQuery class is used to query Surface Area information from msa, mbd,\r
@@ -1029,81 +1029,27 @@ public class SurfaceAreaQuery {
     }\r
     \r
     /**\r
-     Retrieve PCD tokens\r
-\r
-     @returns   CName/ItemType pairs list   if elements are found at the known xpath\r
-     @returns   null                        if nothing is there\r
-     **/\r
-    public static String[][] getPcdTokenArray() {\r
-        String[] xPath = new String[] {"/PcdData"};\r
-        \r
-        XmlObject[] returns = get("PCDs", xPath);\r
-        if (returns == null || returns.length == 0) {\r
+       Get name array of PCD in a module. In one module, token space\r
+       is same, and token name should not be conflicted.\r
+       \r
+       @return String[]\r
+    **/\r
+    public static String[] getModulePcdEntryNameArray() {\r
+        PcdCoded.PcdEntry[] pcdEntries  = null;\r
+        String[]            results;\r
+        int                 index;\r
+        String[]            xPath       = new String[] {"/PcdEntry"};\r
+        XmlObject[]         returns     = get ("PcdCoded", xPath);\r
+        if (returns == null) {\r
             return null;\r
         }\r
-        \r
-        PCDs.PcdData[] pcds = (PCDs.PcdData[]) returns;\r
-        String[][] result = new String[pcds.length][2];\r
-        for (int i = 0; i < returns.length; ++i) {\r
-            if (pcds[i].getItemType() != null) {\r
-                result[i][1] = pcds[i].getItemType().toString();\r
-            } else {\r
-                result[i][1] = null;\r
-            }\r
-            result[i][0] = pcds[i].getCName();\r
-        }\r
-            \r
-        return result;\r
-    }\r
 \r
-    /**\r
-     Get the PcdToken array from module's surface area document.\r
-     The array should contains following data:\r
-     <p>-------------------------------------------------------------------</p>\r
-     <p>CName | ItemType | TokenspaceName | DefaultValue | Usage | HelpText</p>\r
-     <p>-------------------------------------------------------------------</p>\r
-     <p>Note: Until new schema applying, now we can only get CName, ItemType,</p>\r
-     \r
-     @return  2-array table contains all information of PCD token retrieved from MSA.\r
-     **/\r
-    public static Object[][] getModulePCDTokenArray () {\r
-      int             index;\r
-      Object[][]      result;\r
-      PCDs.PcdData[]  pcds;\r
-      String[]        xPath   = new String[] {"/PcdData"};\r
-      XmlObject[]     returns = get ("PCDs", xPath);\r
-\r
-      if ((returns == null) || (returns.length == 0)) {\r
-        return null;\r
-      }\r
-\r
-      pcds     = (PCDs.PcdData[]) returns;\r
-      result   = new Object[pcds.length][6];\r
-      for (index = 0; index < pcds.length; index ++) {\r
-        //\r
-        // Get CName\r
-        //\r
-        result [index][0] = pcds[index].getCName();\r
-        //\r
-        // Get ItemType: FEATURE_FLAG, FIXED_AT_BUILD, PATCHABLE_IN_MODLE, DYNAMIC, DYNAMIC_EX\r
-        //\r
-        if (pcds[index].getItemType() != null) {\r
-          result [index][1] = pcds[index].getItemType().toString();\r
-        } else {\r
-          result [index][1] = null;\r
-        }\r
+        pcdEntries = (PcdCoded.PcdEntry[])returns;\r
+        results    = new String[pcdEntries.length];\r
         \r
-        //\r
-        // BUGBUG: following field can *not* be got from current MSA until schema changed.\r
-        //\r
-        //result [index][2] = pcds[index].getTokenSpaceName();\r
-        result [index][2] = null;\r
-        result [index][3] = pcds[index].getDefaultValue();\r
-        //result [index][4] = pcds[index].getUsage ();\r
-        result [index][4] = null;\r
-        //result [index][5] = pcds[index].getHelpText ();\r
-        result [index][5] = null;\r
-      }\r
-      return result;\r
+        for (index = 0; index < pcdEntries.length; index ++) {\r
+            results[index] = pcdEntries[index].getCName();\r
+        }\r
+        return results;\r
     }\r
 }\r