]>
Commit | Line | Data |
---|---|---|
4234283c LG |
1 | ## @file\r |
2 | # This file is used to define common class objects for INF file. \r | |
3 | # It will consumed by InfParser\r | |
4 | #\r | |
5 | # Copyright (c) 2011, Intel Corporation. All rights reserved.<BR>\r | |
6 | #\r | |
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 | |
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 | |
20 | # \r | |
21 | # Comment Object for any line in the INF file \r | |
22 | # \r | |
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 | |
32 | \r | |
33 | def SetHeaderComments(self, HeaderComments):\r | |
34 | self.HeaderComments = HeaderComments\r | |
35 | \r | |
36 | def GetHeaderComments(self):\r | |
37 | return self.HeaderComments\r | |
38 | \r | |
39 | def SetTailComments(self, TailComments):\r | |
40 | self.TailComments = TailComments\r | |
41 | \r | |
42 | def GetTailComments(self):\r | |
43 | return self.TailComments \r | |
44 | \r | |
45 | ## CurrentLine\r | |
46 | # \r | |
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 | |
54 | # \r | |
55 | # @param LineNo: LineNo \r | |
56 | # \r | |
57 | def SetLineNo(self, LineNo):\r | |
58 | self.LineNo = LineNo\r | |
59 | \r | |
60 | ## GetLineNo\r | |
61 | # \r | |
62 | def GetLineNo(self):\r | |
63 | return self.LineNo\r | |
64 | \r | |
65 | ## SetLineString\r | |
66 | # \r | |
67 | # @param LineString: Line String content \r | |
68 | # \r | |
69 | def SetLineString(self, LineString):\r | |
70 | self.LineString = LineString\r | |
71 | \r | |
72 | ## GetLineString\r | |
73 | # \r | |
74 | def GetLineString(self):\r | |
75 | return self.LineString\r | |
76 | \r | |
77 | ## SetFileName\r | |
78 | # \r | |
79 | # @param FileName: File Name\r | |
80 | # \r | |
81 | def SetFileName(self, FileName):\r | |
82 | self.FileName = FileName\r | |
83 | \r | |
84 | ## GetFileName\r | |
85 | # \r | |
86 | def GetFileName(self):\r | |
87 | return self.FileName\r | |
88 | \r | |
89 | ## \r | |
90 | # Inf Section common data\r | |
91 | #\r | |
92 | class InfSectionCommonDef():\r | |
93 | def __init__(self):\r | |
94 | #\r | |
95 | # # \r | |
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 | |
107 | \r | |
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 | |
115 | # \r | |
116 | # @param HeaderComments: HeaderComments\r | |
117 | # \r | |
118 | def SetHeaderComments(self, HeaderComments):\r | |
119 | self.HeaderComments = HeaderComments\r | |
120 | \r | |
121 | ## GetHeaderComments\r | |
122 | # \r | |
123 | def GetHeaderComments(self):\r | |
124 | return self.HeaderComments\r | |
125 | \r | |
126 | ## SetTailComments\r | |
127 | # \r | |
128 | # @param TailComments: TailComments\r | |
129 | # \r | |
130 | def SetTailComments(self, TailComments):\r | |
131 | self.TailComments = TailComments\r | |
132 | \r | |
133 | ## GetTailComments\r | |
134 | # \r | |
135 | def GetTailComments(self):\r | |
136 | return self.TailComments\r | |
137 | \r | |
138 | ## SetSupArchList\r | |
139 | # \r | |
140 | # @param Arch: Arch\r | |
141 | # \r | |
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 | |
147 | # \r | |
148 | def GetSupArchList(self):\r | |
149 | return self.SupArchList\r | |
150 | \r | |
151 | ## SetAllContent\r | |
152 | # \r | |
153 | # @param ArchList: ArchList\r | |
154 | # @param Content: Content\r | |
155 | # \r | |
156 | def SetAllContent(self, Content):\r | |
157 | self.AllContent = Content\r | |
158 | \r | |
159 | ## GetAllContent\r | |
160 | # \r | |
161 | def GetAllContent(self):\r | |
162 | return self.AllContent\r |