]>
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, Intel Corporation. All rights reserved.<BR>
7 # This program and the accompanying materials are licensed and made available
8 # under the terms and conditions of the BSD License which accompanies this
9 # distribution. The full text of the license may be found at
10 # http://opensource.org/licenses/bsd-license.php
12 # THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
13 # WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
19 ## InfLineCommentObject
21 # Comment Object for any line in the INF file
28 class InfLineCommentObject():
30 self
.HeaderComments
= ''
31 self
.TailComments
= ''
33 def SetHeaderComments(self
, HeaderComments
):
34 self
.HeaderComments
= HeaderComments
36 def GetHeaderComments(self
):
37 return self
.HeaderComments
39 def SetTailComments(self
, TailComments
):
40 self
.TailComments
= TailComments
42 def GetTailComments(self
):
43 return self
.TailComments
55 # @param LineNo: LineNo
57 def SetLineNo(self
, LineNo
):
67 # @param LineString: Line String content
69 def SetLineString(self
, LineString
):
70 self
.LineString
= LineString
74 def GetLineString(self
):
75 return self
.LineString
79 # @param FileName: File Name
81 def SetFileName(self
, FileName
):
82 self
.FileName
= FileName
86 def GetFileName(self
):
90 # Inf Section common data
92 class InfSectionCommonDef():
96 # # HeaderComments at here
98 # [xxSection] TailComments at here
101 self
.HeaderComments
= ''
102 self
.TailComments
= ''
104 # The support arch list of this section
106 self
.SupArchList
= []
109 # Store all section content
110 # Key is supported Arch
116 # @param HeaderComments: HeaderComments
118 def SetHeaderComments(self
, HeaderComments
):
119 self
.HeaderComments
= HeaderComments
123 def GetHeaderComments(self
):
124 return self
.HeaderComments
128 # @param TailComments: TailComments
130 def SetTailComments(self
, TailComments
):
131 self
.TailComments
= TailComments
135 def GetTailComments(self
):
136 return self
.TailComments
142 def SetSupArchList(self
, Arch
):
143 if Arch
not in self
.SupArchList
:
144 self
.SupArchList
.append(Arch
)
148 def GetSupArchList(self
):
149 return self
.SupArchList
153 # @param ArchList: ArchList
154 # @param Content: Content
156 def SetAllContent(self
, Content
):
157 self
.AllContent
= Content
161 def GetAllContent(self
):
162 return self
.AllContent