]> git.proxmox.com Git - mirror_edk2.git/blob - Tools/Source/MigrationTools/org/tianocore/migration/Guid.java
5cdaf44781a67243576652b011d08e40902cae57
[mirror_edk2.git] / Tools / Source / MigrationTools / org / tianocore / migration / Guid.java
1 package org.tianocore.migration;
2
3 import java.util.regex.*;
4
5 public class Guid {
6 Guid (String r8, String t, String n, String r9, String gv, String p) {
7 r8name = r8;
8 type = t;
9 name = n;
10 r9name = r9;
11 guidvalue = gv;
12 pack = p;
13 }
14 Guid (String[] linecontext, String t) {
15 r8name = linecontext[1];
16 type = t;
17 name = linecontext[0];
18 r9name = linecontext[2];
19 guidvalue = linecontext[3];
20 pack = linecontext[4];
21 }
22 public String r8name;
23 public String type;
24 public String name;
25 public String r9name;
26 public String guidvalue;
27 public String pack;
28
29 public static Pattern ptnguid = Pattern.compile("g\\w*Guid");
30
31 public static String register(Matcher mtr, ModuleInfo mi, Database db) {
32 String type = null;
33 String temp = null;
34
35 temp = mtr.group();
36 if (db.hasGuid(temp)) { // only changed guids registered, because both changed and not changed guids are included in database
37 type = db.getGuidType(temp);
38 if (type.matches("Protocol")) {
39 mi.protocol.add(temp);
40 } else if (type.matches("Ppi")) {
41 mi.ppi.add(temp);
42 } else if (type.matches("Guid")) {
43 mi.guid.add(temp);
44 }
45 return temp;
46 }
47 return null;
48 }
49 }