import java.io.*;\r
import java.util.*;\r
\r
-public class Database {\r
- Database() throws Exception {\r
- if (System.getenv("WORKSPACE") == null) {\r
- DatabasePath = "C:" + File.separator + "tianocore" + File.separator + "edk2" + File.separator + "Tools" + File.separator + "Conf" + File.separator + "Migration";\r
- } else {\r
- DatabasePath = System.getenv("WORKSPACE") + File.separator + "Tools" + File.separator + "Conf" + File.separator + "Migration";\r
- }\r
+public final class Database {\r
+ Database(String path) throws Exception {\r
+ DatabasePath = path;\r
\r
importDBLib("Library.csv");\r
importDBGuid("Guid.csv", "Guid");\r
public String getR9Macro(String r8macro) {\r
return hashmacro.get(r8macro).r9name; // the verification job of if the macro exists in the database is done when registering it\r
}\r
- \r
+\r
public String getR9Guidname(String r8Guid) {\r
String temp = null;\r
try {\r
}\r
return temp;\r
}\r
- \r
+\r
public String getGuidType(String r8Guid) {\r
String temp = null;\r
try {\r
}\r
return temp;\r
}\r
+\r
+ public static Database init() throws Exception {\r
+ if (System.getenv("WORKSPACE") == null) {\r
+ return new Database("C:" + File.separator + "tianocore" + File.separator + "edk2" + File.separator + "Tools" + File.separator + "Conf" + File.separator + "Migration");\r
+ } else {\r
+ return new Database(System.getenv("WORKSPACE") + File.separator + "Tools" + File.separator + "Conf" + File.separator + "Migration");\r
+ }\r
+ }\r
}\r