Commit | Line | Data |
---|---|---|
4234283c | 1 | ## @file\r |
f7496d71 | 2 | # This file is used to define common class objects for INF file.\r |
4234283c LG |
3 | # It will consumed by InfParser\r |
4 | #\r | |
f7496d71 | 5 | # Copyright (c) 2011 - 2018, Intel Corporation. All rights reserved.<BR>\r |
4234283c | 6 | #\r |
f7496d71 LG |
7 | # This program and the accompanying materials are licensed and made available\r |
8 | # under the terms and conditions of the BSD License which accompanies this\r | |
9 | # distribution. The full text of the license may be found at\r | |
4234283c LG |
10 | # http://opensource.org/licenses/bsd-license.php\r |
11 | #\r | |
12 | # THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,\r | |
13 | # WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.\r | |
14 | \r | |
15 | '''\r | |
16 | InfCommonObject\r | |
17 | '''\r | |
18 | \r | |
19 | ## InfLineCommentObject\r | |
f7496d71 LG |
20 | #\r |
21 | # Comment Object for any line in the INF file\r | |
22 | #\r | |
4234283c LG |
23 | # #\r |
24 | # # HeaderComment\r | |
25 | # #\r | |
26 | # Line # TailComment\r | |
27 | #\r | |
28 | class InfLineCommentObject():\r | |
29 | def __init__(self):\r | |
30 | self.HeaderComments = ''\r | |
31 | self.TailComments = ''\r | |
f7496d71 | 32 | \r |
4234283c LG |
33 | def SetHeaderComments(self, HeaderComments):\r |
34 | self.HeaderComments = HeaderComments\r | |
f7496d71 | 35 | \r |
4234283c LG |
36 | def GetHeaderComments(self):\r |
37 | return self.HeaderComments\r | |
f7496d71 | 38 | \r |
4234283c LG |
39 | def SetTailComments(self, TailComments):\r |
40 | self.TailComments = TailComments\r | |
41 | \r | |
42 | def GetTailComments(self):\r | |
f7496d71 LG |
43 | return self.TailComments\r |
44 | \r | |
4234283c | 45 | ## CurrentLine\r |
f7496d71 | 46 | #\r |
4234283c LG |
47 | class CurrentLine():\r |
48 | def __init__(self):\r | |
49 | self.LineNo = ''\r | |
50 | self.LineString = ''\r | |
51 | self.FileName = ''\r | |
52 | \r | |
53 | ## SetLineNo\r | |
f7496d71 LG |
54 | #\r |
55 | # @param LineNo: LineNo\r | |
56 | #\r | |
4234283c LG |
57 | def SetLineNo(self, LineNo):\r |
58 | self.LineNo = LineNo\r | |
f7496d71 | 59 | \r |
4234283c | 60 | ## GetLineNo\r |
f7496d71 | 61 | #\r |
4234283c LG |
62 | def GetLineNo(self):\r |
63 | return self.LineNo\r | |
64 | \r | |
65 | ## SetLineString\r | |
f7496d71 LG |
66 | #\r |
67 | # @param LineString: Line String content\r | |
68 | #\r | |
4234283c LG |
69 | def SetLineString(self, LineString):\r |
70 | self.LineString = LineString\r | |
f7496d71 | 71 | \r |
4234283c | 72 | ## GetLineString\r |
f7496d71 | 73 | #\r |
4234283c LG |
74 | def GetLineString(self):\r |
75 | return self.LineString\r | |
76 | \r | |
77 | ## SetFileName\r | |
f7496d71 | 78 | #\r |
4234283c | 79 | # @param FileName: File Name\r |
f7496d71 | 80 | #\r |
4234283c LG |
81 | def SetFileName(self, FileName):\r |
82 | self.FileName = FileName\r | |
f7496d71 | 83 | \r |
4234283c | 84 | ## GetFileName\r |
f7496d71 | 85 | #\r |
4234283c LG |
86 | def GetFileName(self):\r |
87 | return self.FileName\r | |
f7496d71 LG |
88 | \r |
89 | ##\r | |
4234283c LG |
90 | # Inf Section common data\r |
91 | #\r | |
92 | class InfSectionCommonDef():\r | |
93 | def __init__(self):\r | |
94 | #\r | |
f7496d71 | 95 | # #\r |
4234283c LG |
96 | # # HeaderComments at here\r |
97 | # #\r | |
98 | # [xxSection] TailComments at here\r | |
99 | # data\r | |
100 | #\r | |
101 | self.HeaderComments = ''\r | |
102 | self.TailComments = ''\r | |
103 | #\r | |
104 | # The support arch list of this section\r | |
105 | #\r | |
106 | self.SupArchList = []\r | |
f7496d71 | 107 | \r |
4234283c LG |
108 | #\r |
109 | # Store all section content\r | |
110 | # Key is supported Arch\r | |
111 | #\r | |
112 | self.AllContent = {}\r | |
113 | \r | |
114 | ## SetHeaderComments\r | |
f7496d71 | 115 | #\r |
4234283c | 116 | # @param HeaderComments: HeaderComments\r |
f7496d71 | 117 | #\r |
4234283c LG |
118 | def SetHeaderComments(self, HeaderComments):\r |
119 | self.HeaderComments = HeaderComments\r | |
120 | \r | |
121 | ## GetHeaderComments\r | |
f7496d71 | 122 | #\r |
4234283c LG |
123 | def GetHeaderComments(self):\r |
124 | return self.HeaderComments\r | |
125 | \r | |
126 | ## SetTailComments\r | |
f7496d71 | 127 | #\r |
4234283c | 128 | # @param TailComments: TailComments\r |
f7496d71 | 129 | #\r |
4234283c LG |
130 | def SetTailComments(self, TailComments):\r |
131 | self.TailComments = TailComments\r | |
132 | \r | |
133 | ## GetTailComments\r | |
f7496d71 | 134 | #\r |
4234283c LG |
135 | def GetTailComments(self):\r |
136 | return self.TailComments\r | |
137 | \r | |
138 | ## SetSupArchList\r | |
f7496d71 | 139 | #\r |
4234283c | 140 | # @param Arch: Arch\r |
f7496d71 | 141 | #\r |
4234283c LG |
142 | def SetSupArchList(self, Arch):\r |
143 | if Arch not in self.SupArchList:\r | |
144 | self.SupArchList.append(Arch)\r | |
145 | \r | |
146 | ## GetSupArchList\r | |
f7496d71 | 147 | #\r |
4234283c LG |
148 | def GetSupArchList(self):\r |
149 | return self.SupArchList\r | |
150 | \r | |
151 | ## SetAllContent\r | |
f7496d71 | 152 | #\r |
4234283c LG |
153 | # @param ArchList: ArchList\r |
154 | # @param Content: Content\r | |
f7496d71 | 155 | #\r |
4234283c LG |
156 | def SetAllContent(self, Content):\r |
157 | self.AllContent = Content\r | |
f7496d71 | 158 | \r |
4234283c | 159 | ## GetAllContent\r |
f7496d71 | 160 | #\r |
4234283c LG |
161 | def GetAllContent(self):\r |
162 | return self.AllContent\r |