From 82a6a9605c35f814bd6187979980258ed1b75abd Mon Sep 17 00:00:00 2001 From: Bob Feng Date: Fri, 10 Apr 2015 06:59:47 +0000 Subject: BaseTools/Build: Add SDL support 1.BaseTool add ATTRIBUTE (+/-RT, RO) support in PCD declaration in DSC file 2.BaseTool collect valid PCD value in DEC file and generate data base for runtime sanity check 3.BaseTool support SetPcd error. Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: "Bob Feng" Reviewed-by: "Chen, Hesheng" Reviewed-by: "Liu, Yingke D" git-svn-id: https://svn.code.sf.net/p/edk2/code/trunk/edk2@17158 6f19259b-4bc3-4df7-8a09-765794883524 --- BaseTools/Source/Python/Workspace/MetaFileTable.py | 22 +++++++++++++++++++++- 1 file changed, 21 insertions(+), 1 deletion(-) (limited to 'BaseTools/Source/Python/Workspace/MetaFileTable.py') diff --git a/BaseTools/Source/Python/Workspace/MetaFileTable.py b/BaseTools/Source/Python/Workspace/MetaFileTable.py index 607225a0ef..89a12cd228 100644 --- a/BaseTools/Source/Python/Workspace/MetaFileTable.py +++ b/BaseTools/Source/Python/Workspace/MetaFileTable.py @@ -1,7 +1,7 @@ ## @file # This file is used to create/update/query/erase a meta file table # -# Copyright (c) 2008, Intel Corporation. All rights reserved.
+# Copyright (c) 2008 - 2015, Intel Corporation. All rights reserved.
# This program and the accompanying materials # are licensed and made available under the terms and conditions of the BSD License # which accompanies this distribution. The full text of the license may be found at @@ -225,6 +225,26 @@ class PackageTable(MetaFileTable): SqlCommand = "SELECT %s FROM %s WHERE %s" % (ValueString, self.Table, ConditionString) return self.Exec(SqlCommand) + def GetValidExpression(self, TokenSpaceGuid, PcdCName): + SqlCommand = "select Value1 from %s WHERE Value2='%s' and Value3='%s'" % (self.Table, TokenSpaceGuid, PcdCName) + self.Cur.execute(SqlCommand) + validateranges = [] + validlists = [] + expressions = [] + for row in self.Cur: + comment = row[0] + comment = comment.strip("#") + comment = comment.strip() + if comment.startswith("@ValidRange"): + comment = comment.replace("@ValidRange", "", 1) + validateranges.append(comment.split("|")[1].strip()) + if comment.startswith("@ValidList"): + comment = comment.replace("@ValidList", "", 1) + validlists.append(comment.split("|")[1].strip()) + if comment.startswith("@Expression"): + comment = comment.replace("@Expression", "", 1) + expressions.append(comment.split("|")[1].strip()) + return set(validateranges), set(validlists), set(expressions) ## Python class representation of table storing platform data class PlatformTable(MetaFileTable): _COLUMN_ = ''' -- cgit v1.2.3