]> git.proxmox.com Git - mirror_edk2.git/blob - BaseTools/Source/Python/UPT/Object/POM/ModuleObject.py
BaseTools: Clean up source files
[mirror_edk2.git] / BaseTools / Source / Python / UPT / Object / POM / ModuleObject.py
1 ## @file
2 # This file is used to define a class object to describe a module
3 #
4 # Copyright (c) 2011 - 2018, Intel Corporation. All rights reserved.<BR>
5 #
6 # This program and the accompanying materials are licensed and made available
7 # under the terms and conditions of the BSD License which accompanies this
8 # distribution. The full text of the license may be found at
9 # http://opensource.org/licenses/bsd-license.php
10 #
11 # THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
12 # WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
13
14 '''
15 ModuleObject
16 '''
17
18 ##
19 # Import Modules
20 #
21 from Object.POM.CommonObject import CommonPropertiesObject
22 from Object.POM.CommonObject import IdentificationObject
23 from Object.POM.CommonObject import CommonHeaderObject
24 from Object.POM.CommonObject import BinaryHeaderObject
25 from Object.POM.CommonObject import HelpTextListObject
26 from Object.POM.CommonObject import GuidVersionObject
27
28
29 ##
30 # BootModeObject
31 #
32 class BootModeObject(CommonPropertiesObject, HelpTextListObject):
33 def __init__(self):
34 self.SupportedBootModes = ''
35 CommonPropertiesObject.__init__(self)
36 HelpTextListObject.__init__(self)
37
38 def SetSupportedBootModes(self, SupportedBootModes):
39 self.SupportedBootModes = SupportedBootModes
40
41 def GetSupportedBootModes(self):
42 return self.SupportedBootModes
43
44 ##
45 # EventObject
46 #
47 class EventObject(CommonPropertiesObject, HelpTextListObject):
48 def __init__(self):
49 self.EventType = ''
50 CommonPropertiesObject.__init__(self)
51 HelpTextListObject.__init__(self)
52
53 def SetEventType(self, EventType):
54 self.EventType = EventType
55
56 def GetEventType(self):
57 return self.EventType
58
59 ##
60 # HobObject
61 #
62 class HobObject(CommonPropertiesObject, HelpTextListObject):
63 def __init__(self):
64 self.HobType = ''
65 CommonPropertiesObject.__init__(self)
66 HelpTextListObject.__init__(self)
67
68 def SetHobType(self, HobType):
69 self.HobType = HobType
70
71 def GetHobType(self):
72 return self.HobType
73
74 ##
75 # SpecObject
76 #
77 class SpecObject(object):
78 def __init__(self):
79 self.Spec = ''
80 self.Version = ''
81
82 def SetSpec(self, Spec):
83 self.Spec = Spec
84
85 def GetSpec(self):
86 return self.Spec
87
88 def SetVersion(self, Version):
89 self.Version = Version
90
91 def GetVersion(self):
92 return self.Version
93
94 ## ModuleHeaderObject
95 #
96 # This class defined header items used in Module file
97 #
98 class ModuleHeaderObject(IdentificationObject, CommonHeaderObject, BinaryHeaderObject):
99 def __init__(self):
100 self.IsLibrary = False
101 self.IsLibraryModList = []
102 self.ModuleType = ''
103 self.BinaryModule = False
104 self.PcdIsDriver = ''
105 self.PiSpecificationVersion = ''
106 self.UefiSpecificationVersion = ''
107 self.UNIFlag = False
108 self.ModuleUniFile = ''
109 #
110 # SpecObject
111 #
112 self.SpecList = []
113 #
114 # BootModeObject
115 #
116 self.BootModeList = []
117 #
118 # EventObject
119 #
120 self.EventList = []
121 #
122 # HobObject
123 #
124 self.HobList = []
125 #
126 # LibraryClassObject
127 #
128 self.LibraryClassList = []
129 self.SupArchList = []
130 IdentificationObject.__init__(self)
131 CommonHeaderObject.__init__(self)
132 BinaryHeaderObject.__init__(self)
133
134 def SetIsLibrary(self, IsLibrary):
135 self.IsLibrary = IsLibrary
136
137 def GetIsLibrary(self):
138 return self.IsLibrary
139
140 def SetIsLibraryModList(self, IsLibraryModList):
141 self.IsLibraryModList = IsLibraryModList
142
143 def GetIsLibraryModList(self):
144 return self.IsLibraryModList
145
146 def SetModuleType(self, ModuleType):
147 self.ModuleType = ModuleType
148
149 def GetModuleType(self):
150 return self.ModuleType
151
152 def SetBinaryModule(self, BinaryModule):
153 self.BinaryModule = BinaryModule
154
155 def GetBinaryModule(self):
156 return self.BinaryModule
157
158 def SetPcdIsDriver(self, PcdIsDriver):
159 self.PcdIsDriver = PcdIsDriver
160
161 def GetPcdIsDriver(self):
162 return self.PcdIsDriver
163
164 def SetPiSpecificationVersion(self, PiSpecificationVersion):
165 self.PiSpecificationVersion = PiSpecificationVersion
166
167 def GetPiSpecificationVersion(self):
168 return self.PiSpecificationVersion
169
170 def SetUefiSpecificationVersion(self, UefiSpecificationVersion):
171 self.UefiSpecificationVersion = UefiSpecificationVersion
172
173 def GetUefiSpecificationVersion(self):
174 return self.UefiSpecificationVersion
175
176 def SetSpecList(self, SpecList):
177 self.SpecList = SpecList
178
179 def GetSpecList(self):
180 return self.SpecList
181
182 def SetBootModeList(self, BootModeList):
183 self.BootModeList = BootModeList
184
185 def GetBootModeList(self):
186 return self.BootModeList
187
188 def SetEventList(self, EventList):
189 self.EventList = EventList
190
191 def GetEventList(self):
192 return self.EventList
193
194 def SetHobList(self, HobList):
195 self.HobList = HobList
196
197 def GetHobList(self):
198 return self.HobList
199
200 def SetLibraryClassList(self, LibraryClassList):
201 self.LibraryClassList = LibraryClassList
202
203 def GetLibraryClassList(self):
204 return self.LibraryClassList
205
206 def SetSupArchList(self, SupArchList):
207 self.SupArchList = SupArchList
208
209 def GetSupArchList(self):
210 return self.SupArchList
211
212 def SetModuleUniFile(self, ModuleUniFile):
213 self.ModuleUniFile = ModuleUniFile
214
215 def GetModuleUniFile(self):
216 return self.ModuleUniFile
217 ##
218 # SourceFileObject
219 #
220 class SourceFileObject(CommonPropertiesObject):
221 def __init__(self):
222 CommonPropertiesObject.__init__(self)
223 self.SourceFile = ''
224 self.TagName = ''
225 self.ToolCode = ''
226 self.Family = ''
227 self.FileType = ''
228
229 def SetSourceFile(self, SourceFile):
230 self.SourceFile = SourceFile
231
232 def GetSourceFile(self):
233 return self.SourceFile
234
235 def SetTagName(self, TagName):
236 self.TagName = TagName
237
238 def GetTagName(self):
239 return self.TagName
240
241 def SetToolCode(self, ToolCode):
242 self.ToolCode = ToolCode
243
244 def GetToolCode(self):
245 return self.ToolCode
246
247 def SetFamily(self, Family):
248 self.Family = Family
249
250 def GetFamily(self):
251 return self.Family
252
253 def SetFileType(self, FileType):
254 self.FileType = FileType
255
256 def GetFileType(self):
257 return self.FileType
258
259
260 ##
261 # BinaryFileObject
262 #
263 class BinaryFileObject(CommonPropertiesObject):
264 def __init__(self):
265 self.FileNamList = []
266 self.AsBuiltList = []
267 CommonPropertiesObject.__init__(self)
268
269 def SetFileNameList(self, FileNamList):
270 self.FileNamList = FileNamList
271
272 def GetFileNameList(self):
273 return self.FileNamList
274
275 def SetAsBuiltList(self, AsBuiltList):
276 self.AsBuiltList = AsBuiltList
277
278 def GetAsBuiltList(self):
279 return self.AsBuiltList
280
281
282 ##
283 # AsBuildLibraryClassObject
284 #
285 class AsBuildLibraryClassObject(object):
286 def __init__(self):
287 self.LibGuid = ''
288 self.LibVersion = ''
289 self.SupArchList = []
290
291 def SetLibGuid(self, LibGuid):
292 self.LibGuid = LibGuid
293 def GetLibGuid(self):
294 return self.LibGuid
295
296 def SetLibVersion(self, LibVersion):
297 self.LibVersion = LibVersion
298 def GetLibVersion(self):
299 return self.LibVersion
300
301 def SetSupArchList(self, SupArchList):
302 self.SupArchList = SupArchList
303 def GetSupArchList(self):
304 return self.SupArchList
305
306 ##
307 # AsBuiltObject
308 #
309 class AsBuiltObject(object):
310 def __init__(self):
311 #
312 # list of PcdObject
313 #
314 self.PatchPcdList = []
315 #
316 # list of PcdObject
317 #
318 self.PcdExValueList = []
319 #
320 # list of GuidVersionObject
321 #
322 self.LibraryInstancesList = []
323 #
324 # List of BinaryBuildFlag object
325 #
326 self.BinaryBuildFlagList = []
327
328 def SetPatchPcdList(self, PatchPcdList):
329 self.PatchPcdList = PatchPcdList
330
331 def GetPatchPcdList(self):
332 return self.PatchPcdList
333
334 def SetPcdExList(self, PcdExValueList):
335 self.PcdExValueList = PcdExValueList
336
337 def GetPcdExList(self):
338 return self.PcdExValueList
339
340 def SetLibraryInstancesList(self, LibraryInstancesList):
341 self.LibraryInstancesList = LibraryInstancesList
342
343 def GetLibraryInstancesList(self):
344 return self.LibraryInstancesList
345
346 def SetBuildFlagsList(self, BinaryBuildFlagList):
347 self.BinaryBuildFlagList = BinaryBuildFlagList
348
349 def GetBuildFlagsList(self):
350 return self.BinaryBuildFlagList
351
352 ##
353 # BinaryBuildFlag, this object will include those fields that are not
354 # covered by the UPT Spec BinaryFile field
355 #
356 class BinaryBuildFlagObject(object):
357 def __init__(self):
358 self.Target = ''
359 self.TagName = ''
360 self.Family = ''
361 self.AsBuiltOptionFlags = ''
362
363 def SetTarget(self, Target):
364 self.Target = Target
365
366 def GetTarget(self):
367 return self.Target
368
369 def SetTagName(self, TagName):
370 self.TagName = TagName
371
372 def GetTagName(self):
373 return self.TagName
374
375 def SetFamily(self, Family):
376 self.Family = Family
377
378 def GetFamily(self):
379 return self.Family
380
381 def SetAsBuiltOptionFlags(self, AsBuiltOptionFlags):
382 self.AsBuiltOptionFlags = AsBuiltOptionFlags
383 def GetAsBuiltOptionFlags(self):
384 return self.AsBuiltOptionFlags
385
386 ##
387 # ExternObject
388 #
389 class ExternObject(CommonPropertiesObject):
390 def __init__(self):
391 self.EntryPoint = ''
392 self.UnloadImage = ''
393 self.Constructor = ''
394 self.Destructor = ''
395 self.SupModList = []
396 CommonPropertiesObject.__init__(self)
397
398 def SetEntryPoint(self, EntryPoint):
399 self.EntryPoint = EntryPoint
400
401 def GetEntryPoint(self):
402 return self.EntryPoint
403
404 def SetUnloadImage(self, UnloadImage):
405 self.UnloadImage = UnloadImage
406
407 def GetUnloadImage(self):
408 return self.UnloadImage
409
410 def SetConstructor(self, Constructor):
411 self.Constructor = Constructor
412
413 def GetConstructor(self):
414 return self.Constructor
415
416 def SetDestructor(self, Destructor):
417 self.Destructor = Destructor
418
419 def GetDestructor(self):
420 return self.Destructor
421
422 def SetSupModList(self, SupModList):
423 self.SupModList = SupModList
424 def GetSupModList(self):
425 return self.SupModList
426
427 ##
428 # DepexObject
429 #
430 class DepexObject(CommonPropertiesObject):
431 def __init__(self):
432 self.Depex = ''
433 self.ModuelType = ''
434 CommonPropertiesObject.__init__(self)
435
436 def SetDepex(self, Depex):
437 self.Depex = Depex
438
439 def GetDepex(self):
440 return self.Depex
441
442 def SetModuleType(self, ModuleType):
443 self.ModuelType = ModuleType
444
445 def GetModuleType(self):
446 return self.ModuelType
447
448 ##
449 # PackageDependencyObject
450 #
451 class PackageDependencyObject(GuidVersionObject, CommonPropertiesObject):
452 def __init__(self):
453 self.Package = ''
454 self.PackageFilePath = ''
455 GuidVersionObject.__init__(self)
456 CommonPropertiesObject.__init__(self)
457
458 def SetPackageFilePath(self, PackageFilePath):
459 self.PackageFilePath = PackageFilePath
460
461 def GetPackageFilePath(self):
462 return self.PackageFilePath
463
464 def SetPackage(self, Package):
465 self.Package = Package
466
467 def GetPackage(self):
468 return self.Package
469
470 ##
471 # BuildOptionObject
472 #
473 class BuildOptionObject(CommonPropertiesObject):
474 def __init__(self):
475 CommonPropertiesObject.__init__(self)
476 self.BuildOption = ''
477
478 def SetBuildOption(self, BuildOption):
479 self.BuildOption = BuildOption
480
481 def GetBuildOption(self):
482 return self.BuildOption
483
484 ##
485 # ModuleObject
486 #
487 class ModuleObject(ModuleHeaderObject):
488 def __init__(self):
489 #
490 # {Arch : ModuleHeaderObject}
491 #
492 self.HeaderDict = {}
493 #
494 # LibraryClassObject
495 #
496 self.LibraryClassList = []
497 #
498 # SourceFileObject
499 #
500 self.SourceFileList = []
501 #
502 # BinaryFileObject
503 #
504 self.BinaryFileList = []
505 #
506 # PackageDependencyObject
507 #
508 self.PackageDependencyList = []
509 #
510 # DepexObject
511 #
512 self.PeiDepex = []
513 #
514 # DepexObject
515 #
516 self.DxeDepex = []
517 #
518 # DepexObject
519 #
520 self.SmmDepex = []
521 #
522 # ProtocolObject
523 #
524 self.ProtocolList = []
525 #
526 # PpiObject
527 #
528 self.PpiList = []
529 #
530 # GuidObject
531 #
532 self.GuidList = []
533 #
534 # PcdObject
535 #
536 self.PcdList = []
537 #
538 # ExternObject
539 #
540 self.ExternList = []
541 #
542 # BuildOptionObject
543 #
544 self.BuildOptionList = []
545 #
546 # UserExtensionObject
547 #
548 self.UserExtensionList = []
549 #
550 # MiscFileObject
551 #
552 self.MiscFileList = []
553 #
554 # ClonedFromObject
555 #
556 self.ClonedFrom = None
557
558 ModuleHeaderObject.__init__(self)
559
560 def SetHeaderDict(self, HeaderDict):
561 self.HeaderDict = HeaderDict
562
563 def GetHeaderDict(self):
564 return self.HeaderDict
565
566 def SetLibraryClassList(self, LibraryClassList):
567 self.LibraryClassList = LibraryClassList
568
569 def GetLibraryClassList(self):
570 return self.LibraryClassList
571
572 def SetSourceFileList(self, SourceFileList):
573 self.SourceFileList = SourceFileList
574
575 def GetSourceFileList(self):
576 return self.SourceFileList
577
578 def SetBinaryFileList(self, BinaryFileList):
579 self.BinaryFileList = BinaryFileList
580
581 def GetBinaryFileList(self):
582 return self.BinaryFileList
583
584 def SetPackageDependencyList(self, PackageDependencyList):
585 self.PackageDependencyList = PackageDependencyList
586
587 def GetPackageDependencyList(self):
588 return self.PackageDependencyList
589
590 def SetPeiDepex(self, PeiDepex):
591 self.PeiDepex = PeiDepex
592
593 def GetPeiDepex(self):
594 return self.PeiDepex
595
596 def SetDxeDepex(self, DxeDepex):
597 self.DxeDepex = DxeDepex
598
599 def GetDxeDepex(self):
600 return self.DxeDepex
601
602 def SetSmmDepex(self, SmmDepex):
603 self.SmmDepex = SmmDepex
604
605 def GetSmmDepex(self):
606 return self.SmmDepex
607
608 def SetPpiList(self, PpiList):
609 self.PpiList = PpiList
610
611 def GetPpiList(self):
612 return self.PpiList
613
614 def SetProtocolList(self, ProtocolList):
615 self.ProtocolList = ProtocolList
616
617 def GetProtocolList(self):
618 return self.ProtocolList
619
620 def SetPcdList(self, PcdList):
621 self.PcdList = PcdList
622
623 def GetPcdList(self):
624 return self.PcdList
625
626 def SetGuidList(self, GuidList):
627 self.GuidList = GuidList
628
629 def GetGuidList(self):
630 return self.GuidList
631
632 def SetExternList(self, ExternList):
633 self.ExternList = ExternList
634
635 def GetExternList(self):
636 return self.ExternList
637
638 def SetBuildOptionList(self, BuildOptionList):
639 self.BuildOptionList = BuildOptionList
640
641 def GetBuildOptionList(self):
642 return self.BuildOptionList
643
644 def SetUserExtensionList(self, UserExtensionList):
645 self.UserExtensionList = UserExtensionList
646
647 def GetUserExtensionList(self):
648 return self.UserExtensionList
649
650 def SetMiscFileList(self, MiscFileList):
651 self.MiscFileList = MiscFileList
652
653 def GetMiscFileList(self):
654 return self.MiscFileList
655
656 def SetClonedFrom(self, ClonedFrom):
657 self.ClonedFrom = ClonedFrom
658
659 def GetClonedFrom(self):
660 return self.ClonedFrom