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