## @file\r
# This file contained the parser for sections in INF file \r
#\r
-# Copyright (c) 2011, Intel Corporation. All rights reserved.<BR>\r
+# Copyright (c) 2011 - 2018, Intel Corporation. All rights reserved.<BR>\r
#\r
# This program and the accompanying materials are licensed and made available \r
# under the terms and conditions of the BSD License which accompanies this \r
from copy import deepcopy\r
import re\r
\r
-from Library.String import GetSplitValueList\r
+from Library.StringUtils import GetSplitValueList\r
from Library.CommentParsing import ParseHeaderCommentSection\r
from Library.CommentParsing import ParseComment\r
\r
self.InfSmmDepexSection = InfDepexObject()\r
self.InfBinariesSection = InfBinariesObject()\r
self.InfHeader = InfHeaderObject()\r
+ self.InfBinaryHeader = InfHeaderObject()\r
self.InfSpecialCommentSection = InfSpecialCommentObject()\r
\r
#\r
#\r
# File Header content parser\r
# \r
- def InfHeaderParser(self, Content, InfHeaderObject2, FileName):\r
- (Abstract, Description, Copyright, License) = ParseHeaderCommentSection(Content, FileName)\r
+ def InfHeaderParser(self, Content, InfHeaderObject2, FileName, IsBinaryHeader = False):\r
+ if IsBinaryHeader:\r
+ (Abstract, Description, Copyright, License) = ParseHeaderCommentSection(Content, FileName, True)\r
+ if not Abstract or not Description or not Copyright or not License:\r
+ Logger.Error('Parser',\r
+ FORMAT_INVALID,\r
+ ST.ERR_INVALID_BINARYHEADER_FORMAT,\r
+ File=FileName)\r
+ else:\r
+ (Abstract, Description, Copyright, License) = ParseHeaderCommentSection(Content, FileName)\r
#\r
# Not process file name now, for later usage.\r
#\r