Change return value of getGuidInfo from globaldata. Now only guid string is returned.

git-svn-id: https://edk2.svn.sourceforge.net/svnroot/edk2/trunk/edk2@1195 6f19259b-4bc3-4df7-8a09-765794883524
This commit is contained in:
klu2 2006-08-06 08:18:32 +00:00
parent e55d8a3c6b
commit 20c5c53fd7
3 changed files with 24 additions and 26 deletions

View File

@ -779,8 +779,8 @@ public class GlobalData {
//
// For PCD get tokenSpaceGUid
//
public synchronized static String[] getGuidInfoFromCname(String cName){
String cNameGuid[] = null;
public synchronized static String getGuidInfoFromCname(String cName){
String cNameGuid = null;
String guid = null;
Set set = spdTable.keySet();
Iterator iter = set.iterator();
@ -793,9 +793,7 @@ public class GlobalData {
Spd spd = (Spd) spdTable.get(iter.next());
guid = spd.getGuidFromCname(cName);
if (guid != null){
cNameGuid = new String[2];
cNameGuid[0] = cName;
cNameGuid[1] = guid;
cNameGuid = guid;
break;
}
}

View File

@ -161,12 +161,12 @@ public class PlatformPcdPreprocessActionForBuilding extends PlatformPcdPreproces
@param guidCName Guid CName string.
@return String[] Guid information from SPD file.
@return String Guid information from SPD file.
@throws PlatformPcdPreprocessException
Fail to get Guid information from SPD file.
**/
public String[] getGuidInfoFromSpd(String guidCName) throws PlatformPcdPreprocessException {
String[] tokenSpaceStrRet = null;
public String getGuidInfoFromSpd(String guidCName) throws PlatformPcdPreprocessException {
String tokenSpaceStrRet = null;
try {
tokenSpaceStrRet = GlobalData.getGuidInfoFromCname(guidCName);
} catch ( Exception e ) {
@ -590,7 +590,7 @@ public class PlatformPcdPreprocessActionForBuilding extends PlatformPcdPreproces
String dynamicPrimaryKey = null;
DynamicPcdBuildDefinitions dynamicPcdBuildDefinitions = null;
List<DynamicPcdBuildDefinitions.PcdBuildData> dynamicPcdBuildDataArray = null;
String[] tokenSpaceStrRet = null;
String tokenSpaceStrRet = null;
//
// If FPD document is not be opened, open and initialize it.
@ -618,7 +618,7 @@ public class PlatformPcdPreprocessActionForBuilding extends PlatformPcdPreproces
dynamicPcdBuildDataArray = dynamicPcdBuildDefinitions.getPcdBuildDataList();
for (index = 0; index < dynamicPcdBuildDataArray.size(); index ++) {
tokenSpaceStrRet = this.getGuidInfoFromSpd(dynamicPcdBuildDataArray.get(index).getTokenSpaceGuidCName());
tokenSpaceStrRet = getGuidInfoFromSpd(dynamicPcdBuildDataArray.get(index).getTokenSpaceGuidCName());
if (tokenSpaceStrRet == null) {
exceptionString = "Fail to get token space guid for token " + dynamicPcdBuildDataArray.get(index).getCName();
@ -627,7 +627,7 @@ public class PlatformPcdPreprocessActionForBuilding extends PlatformPcdPreproces
}
dynamicPrimaryKey = Token.getPrimaryKeyString(dynamicPcdBuildDataArray.get(index).getCName(),
tokenSpaceStrRet[1]);
tokenSpaceStrRet);
if (dynamicPrimaryKey.equalsIgnoreCase(token.getPrimaryKeyString())) {
return dynamicPcdBuildDataArray.get(index);
}

View File

@ -96,11 +96,11 @@ public abstract class PlatformPcdPreprocessAction {
@param guidCName the CName of GUID
@return String[] Guid information from SPD file.
@return String Guid information from SPD file.
@throws PlatformPcdPreprocessException
Fail to get Guid information from SPD file.
**/
public abstract String[] getGuidInfoFromSpd(String guidCName)
public abstract String getGuidInfoFromSpd(String guidCName)
throws PlatformPcdPreprocessException;
/**
@ -188,7 +188,7 @@ public abstract class PlatformPcdPreprocessAction {
String moduleName = null;
String datum = null;
int maxDatumSize = 0;
String[] tokenSpaceStrRet = null;
String tokenSpaceStrRet = null;
//
// ----------------------------------------------
@ -239,7 +239,7 @@ public abstract class PlatformPcdPreprocessAction {
continue;
}
primaryKey = Token.getPrimaryKeyString(pcdBuildData.getCName(), tokenSpaceStrRet[1]);
primaryKey = Token.getPrimaryKeyString(pcdBuildData.getCName(), tokenSpaceStrRet);
pcdType = Token.getPcdTypeFromString(pcdBuildData.getItemType().toString());
datumType = Token.getdatumTypeFromString(pcdBuildData.getDatumType().toString());
tokenNumber = Long.decode(pcdBuildData.getToken().toString());
@ -408,7 +408,7 @@ public abstract class PlatformPcdPreprocessAction {
// If the token is not in database, create a new token instance and add
// a usage instance into this token in database.
//
tokenSpaceStrRet = this.getGuidInfoFromSpd(pcdBuildData.getTokenSpaceGuidCName());
tokenSpaceStrRet = getGuidInfoFromSpd(pcdBuildData.getTokenSpaceGuidCName());
if (tokenSpaceStrRet == null) {
putError("Fail to get Token space guid for token" + token.cName +
@ -420,7 +420,7 @@ public abstract class PlatformPcdPreprocessAction {
continue;
}
token = new Token(pcdBuildData.getCName(), tokenSpaceStrRet[1]);
token = new Token(pcdBuildData.getCName(), tokenSpaceStrRet);
token.datumType = datumType;
token.tokenNumber = tokenNumber;
@ -512,7 +512,7 @@ public abstract class PlatformPcdPreprocessAction {
boolean hasSkuId0 = false;
long tokenNumber = 0;
String hiiDefaultValue = null;
String[] variableGuidString = null;
String variableGuidString = null;
List<DynamicPcdBuildDefinitions.PcdBuildData.SkuInfo> skuInfoList = null;
DynamicPcdBuildDefinitions.PcdBuildData dynamicInfo = null;
@ -687,7 +687,7 @@ public abstract class PlatformPcdPreprocessAction {
}
skuInstance.value.setHiiData(varNameList,
translateSchemaStringToUUID(variableGuidString[1]),
translateSchemaStringToUUID(variableGuidString),
skuInfoList.get(index).getVariableOffset(),
skuInfoList.get(index).getHiiDefaultValue().toString());
token.skuData.add(skuInstance);
@ -738,8 +738,8 @@ public abstract class PlatformPcdPreprocessAction {
String temp;
String exceptionString;
String hiiDefaultValue;
String tokenSpaceStrRet[];
String variableGuidString[];
String tokenSpaceStrRet;
String variableGuidString;
dynamicPcdBuildDataArray = getAllDynamicPcdInfoFromFpd();
if (dynamicPcdBuildDataArray == null) {
@ -748,7 +748,7 @@ public abstract class PlatformPcdPreprocessAction {
for (index2 = 0; index2 < dynamicPcdBuildDataArray.size(); index2++) {
pcdBuildData = dynamicPcdBuildDataArray.get(index2);
tokenSpaceStrRet = this.getGuidInfoFromSpd(pcdBuildData.getTokenSpaceGuidCName());
tokenSpaceStrRet = getGuidInfoFromSpd(pcdBuildData.getTokenSpaceGuidCName());
if (tokenSpaceStrRet == null) {
putError("Fail to get Token space guid for token" + pcdBuildData.getCName());
@ -756,7 +756,7 @@ public abstract class PlatformPcdPreprocessAction {
}
primaryKey = Token.getPrimaryKeyString(pcdBuildData.getCName(),
tokenSpaceStrRet[1]);
tokenSpaceStrRet);
if (pcdDbManager.isTokenInDatabase(primaryKey)) {
continue;
@ -772,7 +772,7 @@ public abstract class PlatformPcdPreprocessAction {
//
// Create new token for unreference dynamic PCD token
//
token = new Token(pcdBuildData.getCName(), tokenSpaceStrRet[1]);
token = new Token(pcdBuildData.getCName(), tokenSpaceStrRet);
token.datumSize = pcdBuildData.getMaxDatumSize();
@ -886,7 +886,7 @@ public abstract class PlatformPcdPreprocessAction {
//
// Get variable guid string according to the name of guid which will be mapped into a GUID in SPD file.
//
variableGuidString = this.getGuidInfoFromSpd(skuInfoList.get(index).getVariableGuid().toString());
variableGuidString = getGuidInfoFromSpd(skuInfoList.get(index).getVariableGuid().toString());
if (variableGuidString == null) {
exceptionString = String.format("In FPD file, for dynamic PCD %s, the variable guid %s can be found in all SPD file!",
token.cName,
@ -904,7 +904,7 @@ public abstract class PlatformPcdPreprocessAction {
}
skuInstance.value.setHiiData(varNameList,
translateSchemaStringToUUID(variableGuidString[1]),
translateSchemaStringToUUID(variableGuidString),
skuInfoList.get(index).getVariableOffset(),
skuInfoList.get(index).getHiiDefaultValue().toString());
token.skuData.add(skuInstance);