]>
git.proxmox.com Git - mirror_edk2.git/blob - BaseTools/Source/Python/UPT/Object/Parser/InfCommonObject.py
2 # This file is used to define common class objects for INF file.
3 # It will consumed by InfParser
5 # Copyright (c) 2011 - 2018, Intel Corporation. All rights reserved.<BR>
7 # SPDX-License-Identifier: BSD-2-Clause-Patent
13 ## InfLineCommentObject
15 # Comment Object for any line in the INF file
22 class InfLineCommentObject():
24 self
.HeaderComments
= ''
25 self
.TailComments
= ''
27 def SetHeaderComments(self
, HeaderComments
):
28 self
.HeaderComments
= HeaderComments
30 def GetHeaderComments(self
):
31 return self
.HeaderComments
33 def SetTailComments(self
, TailComments
):
34 self
.TailComments
= TailComments
36 def GetTailComments(self
):
37 return self
.TailComments
49 # @param LineNo: LineNo
51 def SetLineNo(self
, LineNo
):
61 # @param LineString: Line String content
63 def SetLineString(self
, LineString
):
64 self
.LineString
= LineString
68 def GetLineString(self
):
69 return self
.LineString
73 # @param FileName: File Name
75 def SetFileName(self
, FileName
):
76 self
.FileName
= FileName
80 def GetFileName(self
):
84 # Inf Section common data
86 class InfSectionCommonDef():
90 # # HeaderComments at here
92 # [xxSection] TailComments at here
95 self
.HeaderComments
= ''
96 self
.TailComments
= ''
98 # The support arch list of this section
100 self
.SupArchList
= []
103 # Store all section content
104 # Key is supported Arch
110 # @param HeaderComments: HeaderComments
112 def SetHeaderComments(self
, HeaderComments
):
113 self
.HeaderComments
= HeaderComments
117 def GetHeaderComments(self
):
118 return self
.HeaderComments
122 # @param TailComments: TailComments
124 def SetTailComments(self
, TailComments
):
125 self
.TailComments
= TailComments
129 def GetTailComments(self
):
130 return self
.TailComments
136 def SetSupArchList(self
, Arch
):
137 if Arch
not in self
.SupArchList
:
138 self
.SupArchList
.append(Arch
)
142 def GetSupArchList(self
):
143 return self
.SupArchList
147 # @param ArchList: ArchList
148 # @param Content: Content
150 def SetAllContent(self
, Content
):
151 self
.AllContent
= Content
155 def GetAllContent(self
):
156 return self
.AllContent