\r
import java.io.File;\r
import java.util.HashMap;\r
-import java.util.Iterator;\r
import java.util.Map;\r
import java.util.Set;\r
\r
///\r
///\r
Map<ModuleIdentification, File> msaInfo = new HashMap<ModuleIdentification, File>();\r
-\r
- ///\r
- /// Map of module info. \r
- /// Key : moduletype\r
- /// Value: moduletype related include file\r
- ///\r
- Map<String, String> packageHeaderInfo = new HashMap<String, String>();\r
-\r
- ///\r
- /// Map of PPI info.\r
- /// Key : PPI name\r
- /// value: String[] a. PPI C_NAME; b. PPI GUID;\r
- ///\r
- Map<String, String[]> ppiInfo = new HashMap<String, String[]>();\r
-\r
- ///\r
- /// Map of Protocol info.\r
- /// Key : Protocol name\r
- /// value: String[] a. Protocol C_NAME; b. Protocol GUID;\r
- ///\r
- Map<String, String[]> protocolInfo = new HashMap<String, String[]>();\r
-\r
- ///\r
- /// Map of Guid info.\r
- /// Key : Guid name\r
- /// value: String[] a. Guid C_NAME; b. Guid's GUID;\r
- ///\r
- Map<String, String[]> guidInfo = new HashMap<String, String[]>();\r
-\r
- ///\r
- /// Map of library class and its exposed header file.\r
- /// Key : library class name\r
- /// value : library class corresponding header file\r
- ///\r
- Map<String, String[]> libClassHeaderList = new HashMap<String, String[]>();\r
-\r
+ \r
//\r
// Xml Doc of Spd file, Msa file\r
//\r
String[] msaFilenames = SurfaceAreaQuery.getSpdMsaFile();\r
for (int i = 0; i < msaFilenames.length; i++){\r
File msaFile = new File(packageId.getPackageDir() + File.separatorChar + msaFilenames[i]);\r
- Map<String, XmlObject> msaDoc = GlobalData.getNativeMsa( msaFile );\r
+ if (!msaFile.exists()) {\r
+ continue;\r
+ }\r
+ Map<String, XmlObject> msaDoc = WorkspaceProfile.getNativeMsa( msaFile );\r
SurfaceAreaQuery.push(msaDoc);\r
ModuleIdentification moduleId = SurfaceAreaQuery.getMsaHeader();\r
SurfaceAreaQuery.pop();\r
msaInfo.put(moduleId, msaFile);\r
msaDocMap.put(moduleId, msaDoc.get("ModuleSurfaceArea"));\r
}\r
- //\r
- // initialize Package header files\r
- //\r
-// Map<String, String> packageHeaders = SurfaceAreaQuery.getSpdPackageHeaderFiles();\r
-// Set keys = packageHeaders.keySet();\r
-// Iterator iter = keys.iterator();\r
-// while (iter.hasNext()){\r
-// String moduleType = (String)iter.next();\r
-// String header = packageId.getPackageRelativeDir() + File.separatorChar + packageHeaders.get(moduleType);\r
-// //\r
-// // Change path seperator to system-dependent path separator\r
-// //\r
-// File file = new File (header);\r
-// header = file.getParent();\r
-// packageHeaderInfo.put(moduleType, header);\r
-// }\r
- //\r
- // initialize Guid Info\r
- //\r
- guidInfo.putAll(SurfaceAreaQuery.getSpdGuid());\r
- //\r
- // initialize PPI info\r
- //\r
- ppiInfo.putAll(SurfaceAreaQuery.getSpdPpi());\r
- //\r
- // initialize Protocol info\r
- //\r
- protocolInfo.putAll(SurfaceAreaQuery.getSpdProtocol());\r
- //\r
- // initialize library class declaration\r
- //\r
- Map<String, String[]> libraryClassHeaders = SurfaceAreaQuery.getSpdLibraryClasses();\r
- Set<String> keys = libraryClassHeaders.keySet();\r
- Iterator iter = keys.iterator();\r
- while (iter.hasNext()){\r
- String libraryClassName = (String)iter.next();\r
- String[] headerFiles = libraryClassHeaders.get(libraryClassName);\r
- for (int i = 0; i < headerFiles.length; i++){\r
- headerFiles[i] = packageId.getPackageRelativeDir() + File.separatorChar + headerFiles[i];\r
- \r
- //\r
- // Change path separator to system system-dependent path separator. \r
- //\r
- File file = new File (headerFiles[i]);\r
- headerFiles[i] = file.getPath();\r
- }\r
- libClassHeaderList.put(libraryClassName, headerFiles);\r
- }\r
+ \r
}\r
catch (Exception e) {\r
- e.setStackTrace(e.getStackTrace());\r
+ \r
throw new Exception("Parse package description file [" + packageId.getSpdFile() + "] Error.\n"\r
+ e.getMessage());\r
}\r
public Set<ModuleIdentification> getModules(){\r
return msaInfo.keySet();\r
}\r
-\r
- /**\r
- return two value {CName, Guid}. If not found, return null.\r
- **/\r
- public String[] getPpi(String ppiName) {\r
- return ppiInfo.get(ppiName);\r
- }\r
-\r
- /**\r
- return two value {CName, Guid}. If not found, return null.\r
- **/\r
- public String[] getProtocol(String protocolName) {\r
- return protocolInfo.get(protocolName);\r
- }\r
-\r
- /**\r
- return two value {CName, Guid}. If not found, return null.\r
- **/\r
- public String[] getGuid(String guidName) {\r
- return guidInfo.get(guidName);\r
- }\r
-\r
- /**\r
- getLibClassInclude \r
- \r
- This function is to get the library exposed header file name according \r
- library class name.\r
- \r
- @param libName Name of library class \r
- @return Name of header file\r
- **/\r
- String[] getLibClassIncluder(String libName) {\r
- return libClassHeaderList.get(libName);\r
- }\r
-\r
- /**\r
- getModuleTypeIncluder\r
\r
- This function is to get the header file name from module info map \r
- according to module type.\r
- \r
- @param moduleType Module type.\r
- @return Name of header file.\r
- **/\r
- String getPackageIncluder(String moduleType) {\r
- return packageHeaderInfo.get(moduleType);\r
- }\r
}\r