Files

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

157 lines
3.3 KiB
Python
Raw Permalink Normal View History

## @file
2018-07-05 17:40:04 +08:00
# This file is used to define common class objects for INF file.
# It will consumed by InfParser
#
2018-07-05 17:40:04 +08:00
# Copyright (c) 2011 - 2018, Intel Corporation. All rights reserved.<BR>
#
# SPDX-License-Identifier: BSD-2-Clause-Patent
'''
InfCommonObject
'''
## InfLineCommentObject
2018-07-05 17:40:04 +08:00
#
# Comment Object for any line in the INF file
#
# #
# # HeaderComment
# #
# Line # TailComment
#
class InfLineCommentObject():
def __init__(self):
self.HeaderComments = ''
self.TailComments = ''
2018-07-05 17:40:04 +08:00
def SetHeaderComments(self, HeaderComments):
self.HeaderComments = HeaderComments
2018-07-05 17:40:04 +08:00
def GetHeaderComments(self):
return self.HeaderComments
2018-07-05 17:40:04 +08:00
def SetTailComments(self, TailComments):
self.TailComments = TailComments
def GetTailComments(self):
2018-07-05 17:40:04 +08:00
return self.TailComments
## CurrentLine
2018-07-05 17:40:04 +08:00
#
class CurrentLine():
def __init__(self):
self.LineNo = ''
self.LineString = ''
self.FileName = ''
## SetLineNo
2018-07-05 17:40:04 +08:00
#
# @param LineNo: LineNo
#
def SetLineNo(self, LineNo):
self.LineNo = LineNo
2018-07-05 17:40:04 +08:00
## GetLineNo
2018-07-05 17:40:04 +08:00
#
def GetLineNo(self):
return self.LineNo
## SetLineString
2018-07-05 17:40:04 +08:00
#
# @param LineString: Line String content
#
def SetLineString(self, LineString):
self.LineString = LineString
2018-07-05 17:40:04 +08:00
## GetLineString
2018-07-05 17:40:04 +08:00
#
def GetLineString(self):
return self.LineString
## SetFileName
2018-07-05 17:40:04 +08:00
#
# @param FileName: File Name
2018-07-05 17:40:04 +08:00
#
def SetFileName(self, FileName):
self.FileName = FileName
2018-07-05 17:40:04 +08:00
## GetFileName
2018-07-05 17:40:04 +08:00
#
def GetFileName(self):
return self.FileName
2018-07-05 17:40:04 +08:00
##
# Inf Section common data
#
class InfSectionCommonDef():
def __init__(self):
#
2018-07-05 17:40:04 +08:00
# #
# # HeaderComments at here
# #
# [xxSection] TailComments at here
# data
#
self.HeaderComments = ''
self.TailComments = ''
#
# The support arch list of this section
#
self.SupArchList = []
2018-07-05 17:40:04 +08:00
#
# Store all section content
# Key is supported Arch
#
self.AllContent = {}
## SetHeaderComments
2018-07-05 17:40:04 +08:00
#
# @param HeaderComments: HeaderComments
2018-07-05 17:40:04 +08:00
#
def SetHeaderComments(self, HeaderComments):
self.HeaderComments = HeaderComments
## GetHeaderComments
2018-07-05 17:40:04 +08:00
#
def GetHeaderComments(self):
return self.HeaderComments
## SetTailComments
2018-07-05 17:40:04 +08:00
#
# @param TailComments: TailComments
2018-07-05 17:40:04 +08:00
#
def SetTailComments(self, TailComments):
self.TailComments = TailComments
## GetTailComments
2018-07-05 17:40:04 +08:00
#
def GetTailComments(self):
return self.TailComments
## SetSupArchList
2018-07-05 17:40:04 +08:00
#
# @param Arch: Arch
2018-07-05 17:40:04 +08:00
#
def SetSupArchList(self, Arch):
if Arch not in self.SupArchList:
self.SupArchList.append(Arch)
## GetSupArchList
2018-07-05 17:40:04 +08:00
#
def GetSupArchList(self):
return self.SupArchList
## SetAllContent
2018-07-05 17:40:04 +08:00
#
# @param ArchList: ArchList
# @param Content: Content
2018-07-05 17:40:04 +08:00
#
def SetAllContent(self, Content):
self.AllContent = Content
2018-07-05 17:40:04 +08:00
## GetAllContent
2018-07-05 17:40:04 +08:00
#
def GetAllContent(self):
return self.AllContent