]> git.proxmox.com Git - mirror_edk2.git/blobdiff - Tools/Source/FrameworkWizard/src/org/tianocore/frameworkwizard/workspace/WorkspaceTools.java
1. Enhance Source Files selection in msa:
[mirror_edk2.git] / Tools / Source / FrameworkWizard / src / org / tianocore / frameworkwizard / workspace / WorkspaceTools.java
index dda8844495e07b054947554a0aac52a34e713343..16cfaad87a7307bc0b0943fe337823c71e8b2a05 100644 (file)
@@ -35,12 +35,15 @@ import org.tianocore.SpdHeaderDocument.SpdHeader;
 import org.tianocore.frameworkwizard.common.DataType;\r
 import org.tianocore.frameworkwizard.common.Log;\r
 import org.tianocore.frameworkwizard.common.SaveFile;\r
+import org.tianocore.frameworkwizard.common.Sort;\r
 import org.tianocore.frameworkwizard.common.Tools;\r
 import org.tianocore.frameworkwizard.common.Identifications.Identification;\r
 import org.tianocore.frameworkwizard.common.Identifications.OpenFile;\r
 import org.tianocore.frameworkwizard.far.FarHeader;\r
 import org.tianocore.frameworkwizard.far.FarIdentification;\r
 import org.tianocore.frameworkwizard.module.Identifications.ModuleIdentification;\r
+import org.tianocore.frameworkwizard.module.Identifications.PcdCoded.PcdIdentification;\r
+import org.tianocore.frameworkwizard.module.Identifications.PcdCoded.PcdVector;\r
 import org.tianocore.frameworkwizard.packaging.PackageIdentification;\r
 import org.tianocore.frameworkwizard.platform.PlatformIdentification;\r
 \r
@@ -77,39 +80,37 @@ public class WorkspaceTools {
     }\r
 \r
     public void addFarToDb(List<String> packageList, List<String> platformList, FarHeader far) {\r
-      FrameworkDatabase fdb = openFrameworkDb();\r
-      \r
-      for (int i = 0; i < packageList.size(); i++) {\r
-        DbPathAndFilename item = DbPathAndFilename.Factory.newInstance();\r
-        item.setFarGuid(far.getGuidValue());\r
-        item.setStringValue(packageList.get(i));\r
-        fdb.getPackageList().getFilenameList().add(item);\r
-      }\r
-      \r
-      for (int i = 0; i < platformList.size(); i++) {\r
-        DbPathAndFilename item = DbPathAndFilename.Factory.newInstance();\r
-        item.setFarGuid(far.getGuidValue());\r
-        item.setStringValue(platformList.get(i));\r
-        fdb.getPlatformList().getFilenameList().add(item);\r
-      }\r
-      \r
-      DbPathAndFilename farItem = DbPathAndFilename.Factory.newInstance();\r
-      farItem.setFarGuid(far.getGuidValue());\r
-      farItem.setStringValue(far.getFarName());\r
-      fdb.getFarList().getFilenameList().add(farItem);\r
-      \r
-      String strFrameworkDbFilePath = Workspace.getCurrentWorkspace() + Workspace.getStrWorkspaceDatabaseFile();\r
-      strFrameworkDbFilePath = Tools.convertPathToCurrentOsType(strFrameworkDbFilePath);\r
-      \r
-      try {\r
-        SaveFile.saveDbFile(strFrameworkDbFilePath, fdb);\r
-      }\r
-      catch (Exception e) {\r
-        e.printStackTrace();\r
-      }\r
+        FrameworkDatabase fdb = openFrameworkDb();\r
+\r
+        for (int i = 0; i < packageList.size(); i++) {\r
+            DbPathAndFilename item = DbPathAndFilename.Factory.newInstance();\r
+            item.setFarGuid(far.getGuidValue());\r
+            item.setStringValue(packageList.get(i));\r
+            fdb.getPackageList().getFilenameList().add(item);\r
+        }\r
+\r
+        for (int i = 0; i < platformList.size(); i++) {\r
+            DbPathAndFilename item = DbPathAndFilename.Factory.newInstance();\r
+            item.setFarGuid(far.getGuidValue());\r
+            item.setStringValue(platformList.get(i));\r
+            fdb.getPlatformList().getFilenameList().add(item);\r
+        }\r
+\r
+        DbPathAndFilename farItem = DbPathAndFilename.Factory.newInstance();\r
+        farItem.setFarGuid(far.getGuidValue());\r
+        farItem.setStringValue(far.getFarName());\r
+        fdb.getFarList().getFilenameList().add(farItem);\r
+\r
+        String strFrameworkDbFilePath = Workspace.getCurrentWorkspace() + Workspace.getStrWorkspaceDatabaseFile();\r
+        strFrameworkDbFilePath = Tools.convertPathToCurrentOsType(strFrameworkDbFilePath);\r
+\r
+        try {\r
+            SaveFile.saveDbFile(strFrameworkDbFilePath, fdb);\r
+        } catch (Exception e) {\r
+            e.printStackTrace();\r
+        }\r
     }\r
-    \r
-    \r
+\r
     public void removeFarFromDb(FarIdentification far) {\r
         FrameworkDatabase fdb = openFrameworkDb();\r
         //\r
@@ -118,90 +119,87 @@ public class WorkspaceTools {
         XmlCursor cursor = fdb.getPackageList().newCursor();\r
         cursor.toFirstChild();\r
         do {\r
-          DbPathAndFilename item = (DbPathAndFilename)cursor.getObject();\r
-          \r
-          if (item.getFarGuid() != null && item.getFarGuid().equalsIgnoreCase(far.getGuid())) {\r
-            cursor.removeXml();\r
-          }\r
+            DbPathAndFilename item = (DbPathAndFilename) cursor.getObject();\r
+\r
+            if (item.getFarGuid() != null && item.getFarGuid().equalsIgnoreCase(far.getGuid())) {\r
+                cursor.removeXml();\r
+            }\r
         } while (cursor.toNextSibling());\r
         cursor.dispose();\r
-        \r
+\r
         //\r
         // Remove Platforms\r
         //\r
         cursor = fdb.getPlatformList().newCursor();\r
         cursor.toFirstChild();\r
         do {\r
-          DbPathAndFilename item = (DbPathAndFilename)cursor.getObject();\r
-          if (item.getFarGuid() != null && item.getFarGuid().equalsIgnoreCase(far.getGuid())) {\r
-            cursor.removeXml();\r
-          }\r
+            DbPathAndFilename item = (DbPathAndFilename) cursor.getObject();\r
+            if (item.getFarGuid() != null && item.getFarGuid().equalsIgnoreCase(far.getGuid())) {\r
+                cursor.removeXml();\r
+            }\r
         } while (cursor.toNextSibling());\r
-        \r
+\r
         //\r
         // Remove Far\r
         //\r
         cursor = fdb.getFarList().newCursor();\r
         cursor.toFirstChild();\r
         do {\r
-          DbPathAndFilename item = (DbPathAndFilename)cursor.getObject();\r
-          if (item.getFarGuid() != null && item.getFarGuid().equalsIgnoreCase(far.getGuid())) {\r
-            cursor.removeXml();\r
-          }\r
+            DbPathAndFilename item = (DbPathAndFilename) cursor.getObject();\r
+            if (item.getFarGuid() != null && item.getFarGuid().equalsIgnoreCase(far.getGuid())) {\r
+                cursor.removeXml();\r
+            }\r
         } while (cursor.toNextSibling());\r
         cursor.dispose();\r
-        \r
+\r
         String strFrameworkDbFilePath = Workspace.getCurrentWorkspace() + Workspace.getStrWorkspaceDatabaseFile();\r
         strFrameworkDbFilePath = Tools.convertPathToCurrentOsType(strFrameworkDbFilePath);\r
         try {\r
-          SaveFile.saveDbFile(strFrameworkDbFilePath, fdb);\r
-        }\r
-        catch (Exception e) {\r
-          e.printStackTrace();\r
-        }\r
-    }\r
-    \r
-    public String getPackageFarGuid(PackageIdentification packageId) {\r
-      openFrameworkDb();\r
-      \r
-      for (int index = 0; index < fdb.getPackageList().getFilenameList().size(); index++) {\r
-        DbPathAndFilename item = fdb.getPackageList().getFilenameArray(index);\r
-        String path = Workspace.getCurrentWorkspace() + DataType.FILE_SEPARATOR\r
-                      + item.getStringValue();\r
-        File tempFile = new File(path);\r
-        if (tempFile.getPath().equalsIgnoreCase(packageId.getSpdFile().getPath())) {\r
-          return fdb.getPackageList().getFilenameArray(index).getFarGuid();\r
-        }\r
-      }\r
-      \r
-      return null;\r
-    }\r
-    \r
-    public String getPlatformFarGuid(PlatformIdentification platformId) {\r
-      openFrameworkDb();\r
-      \r
-      for (int index = 0; index < fdb.getPlatformList().getFilenameList().size(); index++) {\r
-        DbPathAndFilename item = fdb.getPlatformList().getFilenameArray(index);\r
-        String path = Workspace.getCurrentWorkspace() + DataType.FILE_SEPARATOR\r
-                      + item.getStringValue();\r
-        File tempFile = new File(path);\r
-        if (tempFile.getPath().equalsIgnoreCase(platformId.getFpdFile().getPath())) {\r
-          return fdb.getPlatformList().getFilenameArray(index).getFarGuid();\r
-        }\r
-      }\r
-      \r
-      return null;\r
-    }\r
-    \r
-    public String getModuleFarGuid(ModuleIdentification moduleId) {\r
-      PackageIdentification packageId = getPackageIdByModuleId(moduleId);\r
-      if (packageId != null) {\r
-          return getPackageFarGuid(packageId);\r
-      }\r
-      else {\r
+            SaveFile.saveDbFile(strFrameworkDbFilePath, fdb);\r
+        } catch (Exception e) {\r
+            e.printStackTrace();\r
+        }\r
+    }\r
+\r
+    public String getPackageFarGuid(Identification packageId) {\r
+        openFrameworkDb();\r
+\r
+        for (int index = 0; index < fdb.getPackageList().getFilenameList().size(); index++) {\r
+            DbPathAndFilename item = fdb.getPackageList().getFilenameArray(index);\r
+            String path = Workspace.getCurrentWorkspace() + DataType.FILE_SEPARATOR + item.getStringValue();\r
+            File tempFile = new File(path);\r
+            if (tempFile.getPath().equalsIgnoreCase(packageId.getPath())) {\r
+                return fdb.getPackageList().getFilenameArray(index).getFarGuid();\r
+            }\r
+        }\r
+\r
         return null;\r
-      }\r
     }\r
+\r
+    public String getPlatformFarGuid(Identification platformId) {\r
+        openFrameworkDb();\r
+\r
+        for (int index = 0; index < fdb.getPlatformList().getFilenameList().size(); index++) {\r
+            DbPathAndFilename item = fdb.getPlatformList().getFilenameArray(index);\r
+            String path = Workspace.getCurrentWorkspace() + DataType.FILE_SEPARATOR + item.getStringValue();\r
+            File tempFile = new File(path);\r
+            if (tempFile.getPath().equalsIgnoreCase(platformId.getPath())) {\r
+                return fdb.getPlatformList().getFilenameArray(index).getFarGuid();\r
+            }\r
+        }\r
+\r
+        return null;\r
+    }\r
+\r
+    public String getModuleFarGuid(Identification moduleId) {\r
+        PackageIdentification packageId = getPackageIdByModuleId(moduleId);\r
+        if (packageId != null) {\r
+            return getPackageFarGuid(packageId);\r
+        } else {\r
+            return null;\r
+        }\r
+    }\r
+\r
     /**\r
      Get all modules' paths from one package\r
      \r
@@ -229,34 +227,34 @@ public class WorkspaceTools {
         }\r
         return modulePath;\r
     }\r
-    \r
+\r
     /**\r
-    Get all Industry Std Includes' paths from one package\r
-    \r
-    @return a Vector with all paths\r
-    \r
-    **/\r
-   public Vector<String> getAllIndustryStdIncludesOfPackage(String path) {\r
-       Vector<String> includePath = new Vector<String>();\r
-       try {\r
-           IndustryStdIncludes files = OpenFile.openSpdFile(path).getIndustryStdIncludes();\r
-           if (files != null) {\r
-               for (int index = 0; index < files.getIndustryStdHeaderList().size(); index++) {\r
-                   String temp = files.getIndustryStdHeaderList().get(index).getName();\r
-                   temp = Tools.addFileSeparator(Tools.getFilePathOnly(path)) + temp;\r
-                   temp = Tools.convertPathToCurrentOsType(temp);\r
-                   includePath.addElement(temp);\r
-               }\r
-           }\r
-       } catch (IOException e) {\r
-\r
-       } catch (XmlException e) {\r
-\r
-       } catch (Exception e) {\r
-\r
-       }\r
-       return includePath;\r
-   }\r
+     Get all Industry Std Includes' paths from one package\r
+     \r
+     @return a Vector with all paths\r
+     \r
+     **/\r
+    public Vector<String> getAllIndustryStdIncludesOfPackage(String path) {\r
+        Vector<String> includePath = new Vector<String>();\r
+        try {\r
+            IndustryStdIncludes files = OpenFile.openSpdFile(path).getIndustryStdIncludes();\r
+            if (files != null) {\r
+                for (int index = 0; index < files.getIndustryStdHeaderList().size(); index++) {\r
+                    String temp = files.getIndustryStdHeaderList().get(index).getIncludeHeader();\r
+                    temp = Tools.addFileSeparator(Tools.getFilePathOnly(path)) + temp;\r
+                    temp = Tools.convertPathToCurrentOsType(temp);\r
+                    includePath.addElement(temp);\r
+                }\r
+            }\r
+        } catch (IOException e) {\r
+\r
+        } catch (XmlException e) {\r
+\r
+        } catch (Exception e) {\r
+\r
+        }\r
+        return includePath;\r
+    }\r
 \r
     /**\r
      Get all package basic information form the FrameworkDatabase.db file\r
@@ -288,95 +286,93 @@ public class WorkspaceTools {
 \r
             }\r
         }\r
-        Tools.sortPackages(vPackageList, DataType.SORT_TYPE_ASCENDING);\r
+        Sort.sortPackages(vPackageList, DataType.SORT_TYPE_ASCENDING);\r
         return vPackageList;\r
     }\r
 \r
     public Vector<FarIdentification> getAllFars() {\r
-      openFrameworkDb();\r
-      Vector<FarIdentification> v = new Vector<FarIdentification>();\r
-      for (int index = 0; index < fdb.getFarList().getFilenameList().size(); index++) {\r
-        DbPathAndFilename item = fdb.getFarList().getFilenameList().get(index);\r
-        FarIdentification far = new FarIdentification(item.getFarGuid(), item.getMd5Sum(), item.getStringValue());\r
-        v.addElement(far);\r
-      }\r
-      return v;\r
-    }\r
-    \r
+        openFrameworkDb();\r
+        Vector<FarIdentification> v = new Vector<FarIdentification>();\r
+        for (int index = 0; index < fdb.getFarList().getFilenameList().size(); index++) {\r
+            DbPathAndFilename item = fdb.getFarList().getFilenameList().get(index);\r
+            FarIdentification far = new FarIdentification(item.getFarGuid(), item.getMd5Sum(), item.getStringValue());\r
+            v.addElement(far);\r
+        }\r
+        return v;\r
+    }\r
+\r
     public Vector<PackageIdentification> getPackagesByFar(FarIdentification far) {\r
-      Identification id = null;\r
-      openFrameworkDb();\r
-      Vector<PackageIdentification> v = new Vector<PackageIdentification>();\r
-      \r
-      for (int index = 0; index < fdb.getPackageList().getFilenameList().size(); index++) {\r
-        DbPathAndFilename item = fdb.getPackageList().getFilenameArray(index);\r
-        String path = Workspace.getCurrentWorkspace() + DataType.FILE_SEPARATOR\r
-                      + item.getStringValue();\r
-        path = Tools.convertPathToCurrentOsType(path);\r
-        \r
-        if (item.getFarGuid() != null && item.getFarGuid().equalsIgnoreCase(far.getGuid())) {\r
-        \r
-          try {\r
-            id = getId(path, OpenFile.openSpdFile(path));\r
-            v.addElement(new PackageIdentification(id));\r
-          } catch (IOException e) {\r
-            Log.err("Open Package Surface Area " + path, e.getMessage());\r
-            e.printStackTrace();\r
-          } catch (XmlException e) {\r
-            Log.err("Open Package Surface Area " + path, e.getMessage());\r
-            e.printStackTrace();\r
-          } catch (Exception e) {\r
-            Log.err("Open Package Surface Area " + path, "Invalid file type");\r
-            e.printStackTrace();\r
-          }\r
+        Identification id = null;\r
+        openFrameworkDb();\r
+        Vector<PackageIdentification> v = new Vector<PackageIdentification>();\r
+\r
+        for (int index = 0; index < fdb.getPackageList().getFilenameList().size(); index++) {\r
+            DbPathAndFilename item = fdb.getPackageList().getFilenameArray(index);\r
+            String path = Workspace.getCurrentWorkspace() + DataType.FILE_SEPARATOR + item.getStringValue();\r
+            path = Tools.convertPathToCurrentOsType(path);\r
+\r
+            if (item.getFarGuid() != null && item.getFarGuid().equalsIgnoreCase(far.getGuid())) {\r
+\r
+                try {\r
+                    id = getId(path, OpenFile.openSpdFile(path));\r
+                    v.addElement(new PackageIdentification(id));\r
+                } catch (IOException e) {\r
+                    Log.err("Open Package Surface Area " + path, e.getMessage());\r
+                    e.printStackTrace();\r
+                } catch (XmlException e) {\r
+                    Log.err("Open Package Surface Area " + path, e.getMessage());\r
+                    e.printStackTrace();\r
+                } catch (Exception e) {\r
+                    Log.err("Open Package Surface Area " + path, "Invalid file type");\r
+                    e.printStackTrace();\r
+                }\r
+            }\r
         }\r
-      }\r
-      return v;\r
+        return v;\r
     }\r
-    \r
+\r
     public Vector<PlatformIdentification> getPlatformsByFar(FarIdentification far) {\r
-      Identification id = null;\r
-      openFrameworkDb();\r
-      Vector<PlatformIdentification> v = new Vector<PlatformIdentification>();\r
-      \r
-      for (int index = 0; index < fdb.getPlatformList().getFilenameList().size(); index++) {\r
-        DbPathAndFilename item = fdb.getPlatformList().getFilenameArray(index);\r
-        String path = Workspace.getCurrentWorkspace() + DataType.FILE_SEPARATOR\r
-                      + item.getStringValue();\r
-        path = Tools.convertPathToCurrentOsType(path);\r
-        \r
-        if (item.getFarGuid() != null && item.getFarGuid().equalsIgnoreCase(far.getGuid())) {\r
-          try {\r
-            id = getId(path, OpenFile.openFpdFile(path));\r
-            v.addElement(new PlatformIdentification(id));\r
-          } catch (IOException e) {\r
-            Log.err("Open Platform Surface Area " + path, e.getMessage());\r
-            e.printStackTrace();\r
-          } catch (XmlException e) {\r
-            Log.err("Open Platform Surface Area " + path, e.getMessage());\r
-            e.printStackTrace();\r
-          } catch (Exception e) {\r
-            Log.err("Open Platform Surface Area " + path, "Invalid file type");\r
-            e.printStackTrace();\r
-          }\r
+        Identification id = null;\r
+        openFrameworkDb();\r
+        Vector<PlatformIdentification> v = new Vector<PlatformIdentification>();\r
+\r
+        for (int index = 0; index < fdb.getPlatformList().getFilenameList().size(); index++) {\r
+            DbPathAndFilename item = fdb.getPlatformList().getFilenameArray(index);\r
+            String path = Workspace.getCurrentWorkspace() + DataType.FILE_SEPARATOR + item.getStringValue();\r
+            path = Tools.convertPathToCurrentOsType(path);\r
+\r
+            if (item.getFarGuid() != null && item.getFarGuid().equalsIgnoreCase(far.getGuid())) {\r
+                try {\r
+                    id = getId(path, OpenFile.openFpdFile(path));\r
+                    v.addElement(new PlatformIdentification(id));\r
+                } catch (IOException e) {\r
+                    Log.err("Open Platform Surface Area " + path, e.getMessage());\r
+                    e.printStackTrace();\r
+                } catch (XmlException e) {\r
+                    Log.err("Open Platform Surface Area " + path, e.getMessage());\r
+                    e.printStackTrace();\r
+                } catch (Exception e) {\r
+                    Log.err("Open Platform Surface Area " + path, "Invalid file type");\r
+                    e.printStackTrace();\r
+                }\r
+            }\r
         }\r
-    }\r
-      return v;\r
+        return v;\r
     }\r
 \r
     /**\r
      Get all module basic information from a package\r
-    \r
+     \r
      @param id Package id\r
      @return A vector includes all modules' basic information\r
-    \r
-    **/\r
+     \r
+     **/\r
     public Vector<ModuleIdentification> getAllModules(PackageIdentification pid) {\r
         Vector<ModuleIdentification> v = new Vector<ModuleIdentification>();\r
         Vector<String> modulePaths = this.getAllModulesOfPackage(pid.getPath());\r
         Identification id = null;\r
         String modulePath = null;\r
-        \r
+\r
         for (int index = 0; index < modulePaths.size(); index++) {\r
             try {\r
                 modulePath = modulePaths.get(index);\r
@@ -390,9 +386,9 @@ public class WorkspaceTools {
             }\r
             v.addElement(new ModuleIdentification(id, pid));\r
         }\r
-        Tools.sortModules(v, DataType.SORT_TYPE_ASCENDING);\r
+        Sort.sortModules(v, DataType.SORT_TYPE_ASCENDING);\r
         return v;\r
-        \r
+\r
     }\r
 \r
     /**\r
@@ -418,7 +414,7 @@ public class WorkspaceTools {
         for (int indexI = 0; indexI < vPackageList.size(); indexI++) {\r
             packagePath = vPackageList.elementAt(indexI).getPath();\r
             modulePaths = this.getAllModulesOfPackage(packagePath);\r
-            \r
+\r
             for (int indexJ = 0; indexJ < modulePaths.size(); indexJ++) {\r
                 try {\r
                     modulePath = modulePaths.get(indexJ);\r
@@ -433,7 +429,7 @@ public class WorkspaceTools {
                 }\r
             }\r
         }\r
-        Tools.sortModules(vModuleList, DataType.SORT_TYPE_ASCENDING);\r
+        Sort.sortModules(vModuleList, DataType.SORT_TYPE_ASCENDING);\r
         return vModuleList;\r
     }\r
 \r
@@ -464,7 +460,7 @@ public class WorkspaceTools {
                 Log.err("Open Platform Surface Area " + path, "Invalid file type");\r
             }\r
         }\r
-        Tools.sortPlatforms(vPlatformList, DataType.SORT_TYPE_ASCENDING);\r
+        Sort.sortPlatforms(vPlatformList, DataType.SORT_TYPE_ASCENDING);\r
         return vPlatformList;\r
     }\r
 \r
@@ -482,7 +478,7 @@ public class WorkspaceTools {
                 }\r
             }\r
         }\r
-        Tools.sortVectorString(vector, DataType.SORT_TYPE_ASCENDING);\r
+        Sort.sortVectorString(vector, DataType.SORT_TYPE_ASCENDING);\r
         return vector;\r
     }\r
 \r
@@ -500,7 +496,7 @@ public class WorkspaceTools {
                 }\r
             }\r
         }\r
-        Tools.sortVectorString(vector, DataType.SORT_TYPE_ASCENDING);\r
+        Sort.sortVectorString(vector, DataType.SORT_TYPE_ASCENDING);\r
         return vector;\r
     }\r
 \r
@@ -518,7 +514,7 @@ public class WorkspaceTools {
                 }\r
             }\r
         }\r
-        Tools.sortVectorString(vector, DataType.SORT_TYPE_ASCENDING);\r
+        Sort.sortVectorString(vector, DataType.SORT_TYPE_ASCENDING);\r
         return vector;\r
     }\r
 \r
@@ -536,7 +532,7 @@ public class WorkspaceTools {
                 }\r
             }\r
         }\r
-        Tools.sortVectorString(vector, DataType.SORT_TYPE_ASCENDING);\r
+        Sort.sortVectorString(vector, DataType.SORT_TYPE_ASCENDING);\r
         return vector;\r
     }\r
 \r
@@ -545,16 +541,22 @@ public class WorkspaceTools {
      \r
      @return Vector\r
      **/\r
-    public Vector<String> getAllPcdDeclarationsFromPackage(PackageSurfaceArea spd) {\r
-        Vector<String> vector = new Vector<String>();\r
+    public PcdVector getAllPcdDeclarationsFromPackage(PackageSurfaceArea spd) {\r
+        PcdVector vector = new PcdVector();\r
         if (spd.getPcdDeclarations() != null) {\r
             if (spd.getPcdDeclarations().getPcdEntryList().size() > 0) {\r
                 for (int index = 0; index < spd.getPcdDeclarations().getPcdEntryList().size(); index++) {\r
-                    vector.addElement(spd.getPcdDeclarations().getPcdEntryList().get(index).getCName());\r
+                    String name = spd.getPcdDeclarations().getPcdEntryList().get(index).getCName();\r
+                    String guidCName = spd.getPcdDeclarations().getPcdEntryList().get(index).getTokenSpaceGuidCName();\r
+                    String help = spd.getPcdDeclarations().getPcdEntryList().get(index).getHelpText();\r
+                    Vector<String> type = Tools.convertListToVector(spd.getPcdDeclarations().getPcdEntryList()\r
+                                                                       .get(index).getValidUsage());\r
+\r
+                    vector.addPcd(new PcdIdentification(name, guidCName, help, type));\r
                 }\r
             }\r
         }\r
-        Tools.sortVectorString(vector, DataType.SORT_TYPE_ASCENDING);\r
+        Sort.sortPcds(vector, DataType.SORT_TYPE_ASCENDING);\r
         return vector;\r
     }\r
 \r
@@ -582,7 +584,7 @@ public class WorkspaceTools {
                 // TODO Auto-generated catch block\r
             }\r
         }\r
-        Tools.sortVectorString(vector, DataType.SORT_TYPE_ASCENDING);\r
+        Sort.sortVectorString(vector, DataType.SORT_TYPE_ASCENDING);\r
         return vector;\r
     }\r
 \r
@@ -608,7 +610,7 @@ public class WorkspaceTools {
                 // TODO Auto-generated catch block\r
             }\r
         }\r
-        Tools.sortVectorString(vector, DataType.SORT_TYPE_ASCENDING);\r
+        Sort.sortVectorString(vector, DataType.SORT_TYPE_ASCENDING);\r
         return vector;\r
     }\r
 \r
@@ -634,7 +636,7 @@ public class WorkspaceTools {
                 // TODO Auto-generated catch block\r
             }\r
         }\r
-        Tools.sortVectorString(vector, DataType.SORT_TYPE_ASCENDING);\r
+        Sort.sortVectorString(vector, DataType.SORT_TYPE_ASCENDING);\r
         return vector;\r
     }\r
 \r
@@ -660,21 +662,20 @@ public class WorkspaceTools {
                 // TODO Auto-generated catch block\r
             }\r
         }\r
-        Tools.sortVectorString(vector, DataType.SORT_TYPE_ASCENDING);\r
+        Sort.sortVectorString(vector, DataType.SORT_TYPE_ASCENDING);\r
         return vector;\r
     }\r
 \r
-    public Vector<String> getAllPcdDeclarationsFromWorkspace() {\r
+    public PcdVector getAllPcdDeclarationsFromWorkspace() {\r
         //\r
         // First get all packages\r
         //\r
         this.getAllPackages();\r
 \r
-        Vector<String> vector = new Vector<String>();\r
+        PcdVector vector = new PcdVector();\r
         for (int index = 0; index < this.vPackageList.size(); index++) {\r
             try {\r
-                Vector<String> v = getAllPcdDeclarationsFromPackage(OpenFile.openSpdFile(vPackageList.get(index)\r
-                                                                                                     .getPath()));\r
+                PcdVector v = getAllPcdDeclarationsFromPackage(OpenFile.openSpdFile(vPackageList.get(index).getPath()));\r
                 if (v != null && v.size() > 0) {\r
                     vector.addAll(v);\r
                 }\r
@@ -686,7 +687,7 @@ public class WorkspaceTools {
                 // TODO Auto-generated catch block\r
             }\r
         }\r
-        Tools.sortVectorString(vector, DataType.SORT_TYPE_ASCENDING);\r
+        Sort.sortPcds(vector, DataType.SORT_TYPE_ASCENDING);\r
         return vector;\r
     }\r
 \r
@@ -723,7 +724,7 @@ public class WorkspaceTools {
                 } catch (IOException e) {\r
 \r
                 } catch (XmlException e) {\r
-                \r
+\r
                 } catch (Exception e) {\r
 \r
                 }\r
@@ -877,7 +878,7 @@ public class WorkspaceTools {
         // First add package\r
         //\r
         v.addElement(path);\r
-        \r
+\r
         //\r
         // Add the package's industry std includes one by one\r
         //\r
@@ -886,7 +887,7 @@ public class WorkspaceTools {
         for (int index = 0; index < f1.size(); index++) {\r
             v.addElement(f1.get(index));\r
         }\r
-        \r
+\r
         //\r
         // Add module's files one by one\r
         //\r