+ /**\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
+ PcdCodedDocument.PcdCoded.PcdEntry[] pcdEntries = null;\r
+ String[] results;\r
+ int index;\r
+ String[] xPath = new String[] {"/PcdEntry"};\r
+ Object[] returns = get ("PcdCoded", xPath);\r
+\r
+ if (returns == null) {\r
+ return new String[0];\r
+ }\r
+\r
+ pcdEntries = (PcdCodedDocument.PcdCoded.PcdEntry[])returns;\r
+ results = new String[pcdEntries.length];\r
+\r
+ for (index = 0; index < pcdEntries.length; index ++) {\r
+ results[index] = pcdEntries[index].getCName();\r
+ }\r
+ return results;\r
+ }\r
+\r
+ /**\r
+ Search in a List for a given string\r
+\r
+ @return boolean\r
+ **/\r
+ public static boolean contains(List list, String str) {\r
+ if (list == null || list.size()== 0) {\r
+ return true;\r
+ }\r
+ Iterator it = list.iterator();\r
+ while (it.hasNext()) {\r
+ String s = (String)it.next();\r
+ if (s.equalsIgnoreCase(str)) {\r
+ return true;\r
+ }\r
+ }\r
+\r
+ return false;\r
+ }\r
+\r
+ public static boolean isHaveTianoR8FlashMap(){\r
+ String[] xPath = new String[] {"/"};\r
+ Object[] returns = get ("Externs", xPath);\r
+\r
+ if (returns == null) {\r
+ return false;\r
+ }\r
+\r
+ ExternsDocument.Externs ext = (ExternsDocument.Externs)returns[0];\r
+ \r
+ if (ext.getTianoR8FlashMapH()){\r
+ return true;\r
+ }else {\r
+ return false;\r
+ }\r
+ }\r