summaryrefslogtreecommitdiff
path: root/Tools/Source/GenBuild/org/tianocore/build/pcd/entity/Token.java
diff options
context:
space:
mode:
Diffstat (limited to 'Tools/Source/GenBuild/org/tianocore/build/pcd/entity/Token.java')
-rw-r--r--Tools/Source/GenBuild/org/tianocore/build/pcd/entity/Token.java41
1 files changed, 35 insertions, 6 deletions
diff --git a/Tools/Source/GenBuild/org/tianocore/build/pcd/entity/Token.java b/Tools/Source/GenBuild/org/tianocore/build/pcd/entity/Token.java
index f5765e1..bce2ec9 100644
--- a/Tools/Source/GenBuild/org/tianocore/build/pcd/entity/Token.java
+++ b/Tools/Source/GenBuild/org/tianocore/build/pcd/entity/Token.java
@@ -540,6 +540,28 @@ public class Token {
return null;
}
+
+ /**
+ Get default value for a token, For HII type, HiiDefaultValue of default
+ SKU 0 will be returned; For Default type, the defaultvalue of default SKU
+ 0 will be returned.
+
+ @return String
+ */
+ public String getDynamicDefaultValue() {
+ DynamicTokenValue dynamicData = getDefaultSku();
+ if (hasDefaultValue()) {
+ switch (dynamicData.type) {
+ case HII_TYPE:
+ return dynamicData.hiiDefaultValue;
+ case DEFAULT_TYPE:
+ return dynamicData.value;
+ }
+ }
+
+ return null;
+ }
+
//
// BugBug: We need change this algorithm accordingly when schema is updated
// to support no default value.
@@ -616,13 +638,20 @@ public class Token {
return false;
}
- public boolean isStringType () {
- String str = getDefaultSku().value;
+ /**
+ Judege whether current value is UNICODE string type.
+ @return boolean
+ */
+ public boolean isUnicodeStringType () {
+ String str = getDynamicDefaultValue();
+
+ if (str == null) {
+ return false;
+ }
- //
- // BUGBUG: need scott confirmation.
- //
- if (datumType == Token.DATUM_TYPE.POINTER) {
+ if (datumType == Token.DATUM_TYPE.POINTER &&
+ str.startsWith("L\"") &&
+ str.endsWith("\"")) {
return true;
}