-def BuildOptionPcdValueFormat(TokenSpaceGuidCName, TokenCName, PcdDatumType, Value):\r
- if PcdDatumType not in [TAB_UINT8, TAB_UINT16, TAB_UINT32, TAB_UINT64,'BOOLEAN']:\r
- if Value.startswith('L') or Value.startswith('"'):\r
- if not Value[1]:\r
- EdkLogger.error("build", FORMAT_INVALID, 'For Void* type PCD, when specify the Value in the command line, please use the following format: "string", L"string", H"{...}"')\r
- Value = Value\r
- elif Value.startswith('H'):\r
- if not Value[1]:\r
- EdkLogger.error("build", FORMAT_INVALID, 'For Void* type PCD, when specify the Value in the command line, please use the following format: "string", L"string", H"{...}"')\r
- Value = Value[1:]\r
- else:\r
- if not Value[0]:\r
- EdkLogger.error("build", FORMAT_INVALID, 'For Void* type PCD, when specify the Value in the command line, please use the following format: "string", L"string", H"{...}"')\r
- Value = '"' + Value + '"'\r
-\r
- IsValid, Cause = CheckPcdDatum(PcdDatumType, Value)\r
- if not IsValid:\r
- EdkLogger.error("build", FORMAT_INVALID, Cause, ExtraData="%s.%s" % (TokenSpaceGuidCName, TokenCName))\r
- if PcdDatumType == 'BOOLEAN':\r
- Value = Value.upper()\r
- if Value == 'TRUE' or Value == '1':\r
- Value = '1'\r
- elif Value == 'FALSE' or Value == '0':\r
- Value = '0'\r
- return Value\r