]> git.proxmox.com Git - mirror_edk2.git/blobdiff - Tools/Source/MigrationTools/org/tianocore/migration/Database.java
Fix one bug in PeiMain to make it output correct ImageStartAddress. And in DxeIplX64P...
[mirror_edk2.git] / Tools / Source / MigrationTools / org / tianocore / migration / Database.java
index a07fe16f038a5d3f54af0dec3d6d6b29d0c069d1..a4b0d47872f374c599e8dc69b8eb2b5e6d167fab 100644 (file)
@@ -1,15 +1,23 @@
+/** @file\r
\r
+ Copyright (c) 2006, Intel Corporation\r
+ All rights reserved. This program and the accompanying materials\r
+ are licensed and made available under the terms and conditions of the BSD License\r
+ which accompanies this distribution.  The full text of the license may be found at\r
+ http://opensource.org/licenses/bsd-license.php\r
\r
+ THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,\r
+ WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.\r
\r
+ **/\r
 package org.tianocore.migration;\r
 \r
 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
@@ -34,7 +42,7 @@ public class Database {
                Func lf;\r
                \r
                if (rd.ready()) {\r
-                       System.out.println("Found " + filename + " , Importing Library Database");\r
+                       System.out.println("Found " + filename + ", Importing Library Database.");\r
                        while ((line = rd.readLine()) != null) {\r
                                if (line.length() != 0) {\r
                                        linecontext = line.split(",");\r
@@ -52,7 +60,7 @@ public class Database {
                Guid gu;\r
                \r
                if (rd.ready()) {\r
-                       System.out.println("Found " + filename + " , Importing " + type + " Database");\r
+                       System.out.println("Found " + filename + ", Importing " + type + " Database.");\r
                        while ((line = rd.readLine()) != null) {\r
                                if (line.length() != 0) {\r
                                        linecontext = line.split(",");\r
@@ -70,7 +78,7 @@ public class Database {
                Macro mc;\r
                \r
                if (rd.ready()) {\r
-                       System.out.println("Found " + filename + " , Importing Macro Database");\r
+                       System.out.println("Found " + filename + ", Importing Macro Database.");\r
                        while ((line = rd.readLine()) != null) {\r
                                if (line.length() != 0) {\r
                                        linecontext = line.split(",");\r
@@ -112,7 +120,7 @@ public class Database {
        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
@@ -122,7 +130,7 @@ public class Database {
                }\r
                return temp;\r
        }\r
-       \r
+\r
        public String getGuidType(String r8Guid) {\r
                String temp = null;\r
                try {\r
@@ -132,4 +140,12 @@ public class Database {
                }\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