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 |
13 | package org.tianocore.migration;\r |
14 | \r |
15 | import java.util.regex.*;\r |
16 | \r |
17 | public class Guid {\r |
18 | Guid (String r8, String t, String n, String r9, String gv, String p) {\r |
19 | r8name = r8;\r |
20 | type = t;\r |
21 | name = n;\r |
22 | r9name = r9;\r |
23 | guidvalue = gv;\r |
24 | pack = p;\r |
25 | }\r |
26 | Guid (String[] linecontext, String t) {\r |
27 | r8name = linecontext[1];\r |
28 | type = t;\r |
29 | name = linecontext[0];\r |
30 | r9name = linecontext[2];\r |
31 | guidvalue = linecontext[3];\r |
32 | pack = linecontext[4];\r |
33 | }\r |
34 | public String r8name;\r |
35 | public String type;\r |
36 | public String name;\r |
37 | public String r9name;\r |
38 | public String guidvalue;\r |
39 | public String pack;\r |
40 | \r |
41 | public static Pattern ptnguid = Pattern.compile("g\\w*Guid");\r |
42 | \r |
43 | public static String register(Matcher mtr, ModuleInfo mi, Database db) {\r |
44 | String type = null;\r |
45 | String temp = null;\r |
46 | \r |
47 | temp = mtr.group();\r |
48 | if (db.hasGuid(temp)) { // only changed guids registered, because both changed and not changed guids are included in database\r |
49 | type = db.getGuidType(temp);\r |
50 | if (type.matches("Protocol")) {\r |
51 | mi.protocol.add(temp);\r |
52 | } else if (type.matches("Ppi")) {\r |
53 | mi.ppi.add(temp);\r |
54 | } else if (type.matches("Guid")) {\r |
55 | mi.guid.add(temp);\r |
56 | }\r |
57 | return temp;\r |
58 | }\r |
59 | return null;\r |
60 | }\r |
61 | } |