]> git.proxmox.com Git - mirror_edk2.git/blobdiff - Tools/Source/MigrationTools/org/tianocore/migration/Guid.java
Add MigrationTools
[mirror_edk2.git] / Tools / Source / MigrationTools / org / tianocore / migration / Guid.java
diff --git a/Tools/Source/MigrationTools/org/tianocore/migration/Guid.java b/Tools/Source/MigrationTools/org/tianocore/migration/Guid.java
new file mode 100644 (file)
index 0000000..5cdaf44
--- /dev/null
@@ -0,0 +1,49 @@
+package org.tianocore.migration;\r
+\r
+import java.util.regex.*;\r
+\r
+public class Guid {\r
+       Guid (String r8, String t, String n, String r9, String gv, String p) {\r
+               r8name = r8;\r
+               type = t;\r
+               name = n;\r
+               r9name = r9;\r
+               guidvalue = gv;\r
+               pack = p;\r
+       }\r
+       Guid (String[] linecontext, String t) {\r
+               r8name = linecontext[1];\r
+               type = t;\r
+               name = linecontext[0];\r
+               r9name = linecontext[2];\r
+               guidvalue = linecontext[3];\r
+               pack = linecontext[4];\r
+       }\r
+       public String r8name;\r
+       public String type;\r
+       public String name;\r
+       public String r9name;\r
+       public String guidvalue;\r
+       public String pack;\r
+\r
+       public static Pattern ptnguid = Pattern.compile("g\\w*Guid");\r
+\r
+       public static String register(Matcher mtr, ModuleInfo mi, Database db) {\r
+               String type = null;\r
+               String temp = null;\r
+               \r
+               temp = mtr.group();\r
+               if (db.hasGuid(temp)) {         // only changed guids registered, because both changed and not changed guids are included in database\r
+                       type = db.getGuidType(temp);\r
+                       if (type.matches("Protocol")) {\r
+                               mi.protocol.add(temp);\r
+                       } else if (type.matches("Ppi")) {\r
+                               mi.ppi.add(temp);\r
+                       } else if (type.matches("Guid")) {\r
+                               mi.guid.add(temp);\r
+                       }\r
+                       return temp;\r
+               }\r
+               return null;\r
+       }\r
+}
\ No newline at end of file