## @file\r
# This file is used to create/update/query/erase a meta file table\r
#\r
-# Copyright (c) 2008 - 2016, Intel Corporation. All rights reserved.<BR>\r
+# Copyright (c) 2008 - 2018, Intel Corporation. All rights reserved.<BR>\r
# This program and the accompanying materials\r
# are licensed and made available under the terms and conditions of the BSD License\r
# which accompanies this distribution. The full text of the license may be found at\r
# @param EndColumn: EndColumn of a Inf item\r
# @param Enabled: If this item enabled\r
#\r
- def Insert(self, Model, Value1, Value2, Value3, Scope1='COMMON', Scope2='COMMON',\r
+ def Insert(self, Model, Value1, Value2, Value3, Scope1=TAB_ARCH_COMMON, Scope2=TAB_COMMON,\r
BelongsToItem=-1, StartLine=-1, StartColumn=-1, EndLine=-1, EndColumn=-1, Enabled=0):\r
(Value1, Value2, Value3, Scope1, Scope2) = ConvertToSqlString((Value1, Value2, Value3, Scope1, Scope2))\r
return Table.Insert(\r
ConditionString = "Model=%s AND Enabled>=0" % Model\r
ValueString = "Value1,Value2,Value3,Scope1,Scope2,ID,StartLine"\r
\r
- if Arch is not None and Arch != 'COMMON':\r
+ if Arch is not None and Arch != TAB_ARCH_COMMON:\r
ConditionString += " AND (Scope1='%s' OR Scope1='COMMON')" % Arch\r
- if Platform is not None and Platform != 'COMMON':\r
+ if Platform is not None and Platform != TAB_COMMON:\r
ConditionString += " AND (Scope2='%s' OR Scope2='COMMON' OR Scope2='DEFAULT')" % Platform\r
if BelongsToItem is not None:\r
ConditionString += " AND BelongsToItem=%s" % BelongsToItem\r
# @param EndColumn: EndColumn of a Dec item\r
# @param Enabled: If this item enabled\r
#\r
- def Insert(self, Model, Value1, Value2, Value3, Scope1='COMMON', Scope2='COMMON',\r
+ def Insert(self, Model, Value1, Value2, Value3, Scope1=TAB_ARCH_COMMON, Scope2=TAB_COMMON,\r
BelongsToItem=-1, StartLine=-1, StartColumn=-1, EndLine=-1, EndColumn=-1, Enabled=0):\r
(Value1, Value2, Value3, Scope1, Scope2) = ConvertToSqlString((Value1, Value2, Value3, Scope1, Scope2))\r
return Table.Insert(\r
ConditionString = "Model=%s AND Enabled>=0" % Model\r
ValueString = "Value1,Value2,Value3,Scope1,Scope2,ID,StartLine"\r
\r
- if Arch is not None and Arch != 'COMMON':\r
+ if Arch is not None and Arch != TAB_ARCH_COMMON:\r
ConditionString += " AND (Scope1='%s' OR Scope1='COMMON')" % Arch\r
\r
SqlCommand = "SELECT %s FROM %s WHERE %s" % (ValueString, self.Table, ConditionString)\r
# @param EndColumn: EndColumn of a Dsc item\r
# @param Enabled: If this item enabled\r
#\r
- def Insert(self, Model, Value1, Value2, Value3, Scope1='COMMON', Scope2='COMMON', Scope3=TAB_DEFAULT_STORES_DEFAULT,BelongsToItem=-1,\r
+ def Insert(self, Model, Value1, Value2, Value3, Scope1=TAB_ARCH_COMMON, Scope2=TAB_COMMON, Scope3=TAB_DEFAULT_STORES_DEFAULT,BelongsToItem=-1,\r
FromItem=-1, StartLine=-1, StartColumn=-1, EndLine=-1, EndColumn=-1, Enabled=1):\r
(Value1, Value2, Value3, Scope1, Scope2,Scope3) = ConvertToSqlString((Value1, Value2, Value3, Scope1, Scope2,Scope3))\r
return Table.Insert(\r
ConditionString = "Model=%s AND Enabled>0" % Model\r
ValueString = "Value1,Value2,Value3,Scope1,Scope2,Scope3,ID,StartLine"\r
\r
- if Scope1 is not None and Scope1 != 'COMMON':\r
+ if Scope1 is not None and Scope1 != TAB_ARCH_COMMON:\r
ConditionString += " AND (Scope1='%s' OR Scope1='COMMON')" % Scope1\r
- if Scope2 is not None and Scope2 != 'COMMON':\r
+ if Scope2 is not None and Scope2 != TAB_COMMON:\r
# Cover the case that CodeBase is 'COMMON' for BuildOptions section\r
if '.' in Scope2:\r
Index = Scope2.index('.')\r
- NewScope = 'COMMON'+ Scope2[Index:]\r
+ NewScope = TAB_COMMON + Scope2[Index:]\r
ConditionString += " AND (Scope2='%s' OR Scope2='COMMON' OR Scope2='DEFAULT' OR Scope2='%s')" % (Scope2, NewScope)\r
else:\r
ConditionString += " AND (Scope2='%s' OR Scope2='COMMON' OR Scope2='DEFAULT')" % Scope2\r