import StringIO\r
import StringTable as st\r
import array\r
+import re\r
\r
from struct import *\r
import Common.EdkLogger as EdkLogger\r
line = line.rstrip(os.linesep)\r
\r
# Skip the comment line\r
- if (not line.startswith("#")) and len(line) > 1 : \r
- self.FileLinesList[count] = line.split('|')\r
+ if (not line.startswith("#")) and len(line) > 1 :\r
+ #\r
+ # Enhanced for support "|" character in the string.\r
+ #\r
+ ValueList = ['', '', '', ''] \r
+ \r
+ ValueRe = re.compile(r'\s*L?\".*\|.*\"\s*$')\r
+ PtrValue = ValueRe.findall(line)\r
+ \r
+ ValueUpdateFlag = False\r
+ \r
+ if len(PtrValue) >= 1:\r
+ line = re.sub(ValueRe, '', line)\r
+ ValueUpdateFlag = True \r
+ \r
+ TokenList = line.split('|')\r
+ ValueList[0:len(TokenList)] = TokenList\r
+ \r
+ if ValueUpdateFlag:\r
+ ValueList[3] = PtrValue[0] \r
+ self.FileLinesList[count] = ValueList\r
# Store the line number\r
self.FileLinesList[count].append(str(count+1))\r
elif len(line) <= 1 :\r
if lenOfUnfixedList != 0 :\r
countOfUnfixedList = 0\r
while(countOfUnfixedList < lenOfUnfixedList) : \r
- #needFixPcdCName, needFixPcdOffset, needFixPcdSize, needFixPcdValue, needFixUnpackValue = self.PcdUnknownOffsetList[countOfUnfixedList][0:6]\r
eachUnfixedPcd = self.PcdUnknownOffsetList[countOfUnfixedList]\r
needFixPcdSize = eachUnfixedPcd.PcdBinSize\r
- needFixPcdOffset = eachUnfixedPcd.PcdOffset\r
# Not been fixed\r
if eachUnfixedPcd.PcdOffset == '*' :\r
# The offset un-fixed pcd can write into this free space\r
FixOffsetSizeListCount += 1\r
\r
# Decrease the un-fixed pcd offset list's length\r
- countOfUnfixedList += 1\r
lenOfUnfixedList -= 1\r
\r
# Modify the last offset value \r
- LastOffset += needFixPcdSize\r
- continue \r
+ LastOffset += needFixPcdSize \r
else :\r
- # It can not insert into those two pcds, need to check stiil has other space can store it.\r
+ # It can not insert into those two pcds, need to check still has other space can store it.\r
+ LastOffset = NowOffset + self.PcdFixedOffsetSizeList[FixOffsetSizeListCount].PcdBinSize\r
FixOffsetSizeListCount += 1\r
- break \r
- else :\r
- continue\r
+ break\r
+ \r
# Set the FixOffsetSizeListCount = lenOfList for quit the loop\r
else :\r
FixOffsetSizeListCount = lenOfList \r