]> git.proxmox.com Git - mirror_edk2.git/blame - Tools/Java/Source/MigrationTools/org/tianocore/migration/Guid.java
Coding Style
[mirror_edk2.git] / Tools / Java / Source / MigrationTools / org / tianocore / migration / Guid.java
CommitLineData
b0282412 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
0dc8c589 13package org.tianocore.migration;\r
14\r
71f30e51 15import java.util.regex.Matcher;\r
16import java.util.regex.Pattern;\r
0dc8c589 17\r
8270b34d 18import org.tianocore.UsageTypes;\r
19\r
0dc8c589 20public class Guid {\r
71f30e51 21 Guid(String r8, String t, String n, String r9, String gv, String p) {\r
22 r8name = r8;\r
23 type = t;\r
24 name = n;\r
25 r9name = r9;\r
26 guidvalue = gv;\r
27 pack = p;\r
28 }\r
0dc8c589 29\r
71f30e51 30 Guid(String[] linecontext, String t) {\r
31 r8name = linecontext[1];\r
32 type = t;\r
33 name = linecontext[0];\r
34 r9name = linecontext[2];\r
35 guidvalue = linecontext[3];\r
36 pack = linecontext[4];\r
37 }\r
0dc8c589 38\r
71f30e51 39 public String r8name;\r
40\r
41 public String type;\r
42\r
43 public String name;\r
44\r
45 public String r9name;\r
46\r
47 public String guidvalue;\r
48\r
49 public String pack;\r
50\r
51 public static Pattern ptnguid = Pattern.compile("g\\w*Guid");\r
52\r
53 public static String register(Matcher mtr, ModuleInfo mi, Database db) {\r
54 String type = null;\r
55 String temp = null;\r
56\r
57 temp = mtr.group();\r
58 if (MigrationTool.db.hasGuid(temp)) { // only changed guids\r
59 // registered, because both\r
60 // changed and not changed guids\r
61 // are included in database\r
62 type = MigrationTool.db.getGuidType(temp);\r
63 if (type.matches("Protocol")) {\r
64 mi.addProtocol(temp, UsageTypes.ALWAYS_CONSUMED);\r
65 // mi.protocols.add(temp);\r
66 } else if (type.matches("Ppi")) {\r
67 mi.addPpi(temp, UsageTypes.ALWAYS_CONSUMED);\r
68 // mi.ppis.add(temp);\r
69 } else if (type.matches("Guid")) {\r
70 mi.addGuid(temp, UsageTypes.ALWAYS_CONSUMED);\r
71 // mi.guids.add(temp);\r
72 }\r
73 return temp;\r
74 }\r
75 return null;\r
76 }\r
0dc8c589 77}