- private String r8only = "EfiLibInstallDriverBinding " +\r
- "EfiLibInstallAllDriverProtocols " +\r
- "EfiLibCompareLanguage " +\r
- "BufToHexString " +\r
- "EfiStrTrim " +\r
- "EfiValueToHexStr " +\r
- "HexStringToBuf " +\r
- "IsHexDigit " +\r
- "NibbleToHexChar " +\r
- "GetHob " +\r
- "GetHobListSize " +\r
- "GetHobVersion " +\r
- "GetHobBootMode " +\r
- "GetCpuHobInfo " +\r
- "GetDxeCoreHobInfo " +\r
- "GetNextFirmwareVolumeHob " +\r
- "GetNextGuidHob " +\r
- "GetPalEntryHobInfo " +\r
- "GetIoPortSpaceAddressHobInfo ";\r
- \r
- public void flush() throws Exception {\r
- PrintWriter outfile;\r
- String temp = null;\r
- if (ui.yesOrNo("Change Source Code is to be doing . See details ?")) {\r
- showdetails = true;\r
- }\r
- File tempdir = new File(modulepath + File.separator + "result" + File.separator);\r
- if (!tempdir.exists()) tempdir.mkdir();\r
- String[] list = new File(modulepath + File.separator + "temp").list(); //what I change is the non-local .h commented-out files\r
- for (int i = 0 ; i < list.length ; i++) {\r
- if (list[i].contains(".c")) {\r
- ui.println("\nModifying file : " + list[i]);\r
- outfile = new PrintWriter(new BufferedWriter(new FileWriter(modulepath + File.separator + "result" + File.separator + list[i])));\r
- outfile.append(sourcefilereplace(modulepath + File.separator + "temp" + File.separator + list[i]));\r
- outfile.flush();\r
- outfile.close();\r
- } else {\r
- if (list[i].contains(".h")) {\r
- temp = list[i];\r
- } else if (list[i].contains(".C")) {\r
- temp = list[i].replaceFirst(".C", ".c");\r
- } else if (list[i].contains(".H")) {\r
- temp = list[i].replaceFirst(".H", ".h");\r
+ public static final void flush(ModuleInfo moduleinfo) throws Exception {\r
+ \r
+ mi = moduleinfo;\r
+ \r
+ String outname = null;\r
+ String inname = null;\r
+\r
+ showdetails = true; // set this as default now, may be changed in the future\r
+ \r
+ Iterator<String> di = mi.localmodulesources.iterator();\r
+ while (di.hasNext()) {\r
+ inname = di.next();\r
+ if (inname.contains(".c") || inname.contains(".C")) {\r
+ if (inname.contains(".C")) {\r
+ outname = inname.replaceFirst(".C", ".c");\r
+ } else {\r
+ outname = inname;\r
+ }\r
+ MigrationTool.ui.println("\nModifying file: " + inname);\r
+ Common.string2file(sourcefilereplace(mi.modulepath + File.separator + "temp" + File.separator + inname), MigrationTool.ModuleInfoMap.get(mi) + File.separator + "Migration_" + mi.modulename + File.separator + outname);\r
+ } else if (inname.contains(".h") || inname.contains(".H") || inname.contains(".dxs") || inname.contains(".uni")) {\r
+ if (inname.contains(".H")) {\r
+ outname = inname.replaceFirst(".H", ".h");\r