]> git.proxmox.com Git - mirror_edk2.git/blame_incremental - Tools/Java/Source/MigrationTools/org/tianocore/migration/Guid.java
Enhance MsaOwner.java
[mirror_edk2.git] / Tools / Java / Source / MigrationTools / org / tianocore / migration / Guid.java
... / ...
CommitLineData
1/** @file\r
2 \r
3 Copyright (c) 2006, Intel Corporation\r
4 All rights reserved. This program and the accompanying materials\r
5 are licensed and made available under the terms and conditions of the BSD License\r
6 which accompanies this distribution. The full text of the license may be found at\r
7 http://opensource.org/licenses/bsd-license.php\r
8 \r
9 THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,\r
10 WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.\r
11 \r
12 **/\r
13package org.tianocore.migration;\r
14\r
15import java.util.regex.*;\r
16\r
17import org.tianocore.UsageTypes;\r
18\r
19public class Guid {\r
20 Guid (String r8, String t, String n, String r9, String gv, String p) {\r
21 r8name = r8;\r
22 type = t;\r
23 name = n;\r
24 r9name = r9;\r
25 guidvalue = gv;\r
26 pack = p;\r
27 }\r
28 Guid (String[] linecontext, String t) {\r
29 r8name = linecontext[1];\r
30 type = t;\r
31 name = linecontext[0];\r
32 r9name = linecontext[2];\r
33 guidvalue = linecontext[3];\r
34 pack = linecontext[4];\r
35 }\r
36 public String r8name;\r
37 public String type;\r
38 public String name;\r
39 public String r9name;\r
40 public String guidvalue;\r
41 public String pack;\r
42\r
43 public static Pattern ptnguid = Pattern.compile("g\\w*Guid");\r
44\r
45 public static String register(Matcher mtr, ModuleInfo mi, Database db) {\r
46 String type = null;\r
47 String temp = null;\r
48 \r
49 temp = mtr.group();\r
50 if (MigrationTool.db.hasGuid(temp)) { // only changed guids registered, because both changed and not changed guids are included in database\r
51 type = MigrationTool.db.getGuidType(temp);\r
52 if (type.matches("Protocol")) {\r
53 mi.addProtocol(temp, UsageTypes.ALWAYS_CONSUMED);\r
54 //mi.protocols.add(temp);\r
55 } else if (type.matches("Ppi")) {\r
56 mi.addPpi(temp, UsageTypes.ALWAYS_CONSUMED);\r
57 //mi.ppis.add(temp);\r
58 } else if (type.matches("Guid")) {\r
59 mi.addGuid(temp, UsageTypes.ALWAYS_CONSUMED);\r
60 //mi.guids.add(temp);\r
61 }\r
62 return temp;\r
63 }\r
64 return null;\r
65 }\r
66}