## @file DecPomAlignment.py
# This file contained the adapter for convert INF parser object to POM Object
#
# Copyright (c) 2011, Intel Corporation. All rights reserved.<BR>
#
# This program and the accompanying materials are licensed and made available
# under the terms and conditions of the BSD License which accompanies this
# distribution. The full text of the license may be found at
#
# THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
# WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
#
'''
DecPomAlignment
'''
##
# Import Modules
#
import platform
## DecPomAlignment
#
# Inherited from PackageObject
#
#
# Load Dec file
#
#
# Transfer to Package Object if IsToPackage is True
#
## Load Dec file
#
# Load the file if it exists
#
# @param Filename: Input value for filename of Dec file
#
#
# Insert a record for file
#
self.SetPackagePath(Path[Path.upper().find(self.WorkspaceDir.upper()) + len(self.WorkspaceDir) + 1:])
self.SetCombinePath(Filename[Filename.upper().find(self.WorkspaceDir.upper()) + len(self.WorkspaceDir) + 1:])
## Transfer to Package Object
#
# Transfer all contents of a Dec file to a standard Package Object
#
#
# Init global information for the file
#
#
# Generate Package Header
#
#
# Generate Includes
#
#
# Generate Guids
#
#
# Generate Protocols
#
#
# Generate Ppis
#
#
# Generate LibraryClasses
#
#
# Generate Pcds
#
#
# Generate Module File list, will be used later on to generate
# distribution
#
#
# Generate user extensions
#
## Generate user extention
#
#
if not Item.UserString:
continue
)
)
## Generate Package Header
#
# Gen Package Header of Dec as <Key> = <Value>
#
# @param ContainerFile: The Dec file full path
#
DefinesDict = {}
#
# Update all defines item in database
#
#
# put items into Dict except for PackageName, Guid, Version, DEC_SPECIFICATION
#
continue
# self.SetName(DefObj.GetPackageName() + ' Version ' + \
# DefObj.GetPackageVersion())
if DefinesDict:
)
#
# Get All header comment section information
#
## GenIncludes
#
# Gen Includes of Dec
#
# @param ContainerFile: The Dec file full path
#
if ContainerFile:
pass
IncludesDict = Sdict()
if IncludePath in IncludesDict:
else:
else:
#
# get the standardIncludeFileList(industry), packageIncludeFileList
# (others) for PackageObject
#
IncludePathList = \
#
# get a non-overlap set of include path, IncludePathList should be
# sorted, and path should be end with path seperator '\'
#
NonOverLapList = []
for Path1 in IncludePathList:
for Path2 in NonOverLapList:
break
else:
#
# revert the list so the longest path shown first in list, also need
# to remove the extra path seperator '\'
# as this list is used to search the supported Arch info
#
#
# save the include path list for later usage
#
IncludeFileList = []
for Path in NonOverLapList:
for Includefile in IncludeFileList:
Include = IncludeObject()
for Path in IncludePathList:
break
else:
#
# put include path into the PackageIncludeFileList
#
PackagePathList = []
Include = IncludeObject()
## GenPpis
#
# Gen Ppis of Dec
# <CName>=<GuidValue>
#
# @param ContainerFile: The Dec file full path
#
if ContainerFile:
pass
Obj = None
Factory = None
def CreateGuidObject():
Object = GuidObject()
return Object
elif Type == TAB_PROTOCOLS:
def CreateProtocolObject():
return ProtocolObject()
def CreatePpiObject():
return PpiObject()
else:
#
# Should not be here
#
return
DeclarationsList = []
#
# Go through each arch
#
ListObject = Factory()
if HelpTxt:
#
#GuidTypeList is abstracted from help
#
elif Type == TAB_PROTOCOLS:
## GenLibraryClasses
#
# Gen LibraryClasses of Dec
# <CName>=<GuidValue>
#
# @param ContainerFile: The Dec file full path
#
if ContainerFile:
pass
if HelpTxt:
## GenPcds
#
# Gen Pcds of Dec
# <TokenSpcCName>.<TokenCName>|<Value>|<DatumType>|<Token>
#
# @param ContainerFile: The Dec file full path
#
#
# Get all Pcds
#
PcdDeclarations = []
IterList = [
(TAB_PCDS_FIXED_AT_BUILD_NULL, 'FixedPcd'),
(TAB_PCDS_PATCHABLE_IN_MODULE_NULL, 'PatchPcd'),
(TAB_PCDS_FEATURE_FLAG_NULL, 'FeaturePcd'),
(TAB_PCDS_DYNAMIC_EX_NULL, 'PcdEx'),
(TAB_PCDS_DYNAMIC_NULL, 'Pcd')]
#
# For each PCD type
#
#
# Go through all archs
#
# for Arch in self.SupArchList + [TAB_ARCH_COMMON]:
#
'')
)
## GenModuleFileList
#
ModuleFileList = []
if Item == ContainerFileName:
continue
Item))
## Show detailed information of Package
#
# Print all members and their values of Package class
#
print '\nStandardIncludes = %d ' \
print '\nPackageIncludes = %d \n' \
print FileObjectItem.GetURI()
print '****************\n'
## GenPcdDeclaration
#
# @param ContainerFile: File name of the DEC file
# @param PcdInfo: Pcd information, of format (TokenGuidCName,
# TokenName, Value, DatumType, Token, Type,
# GenericComment, TailComment, Arch)
#
HelpStr = ''
TailHelpStr = ''
#
# MaxDatumSize is required field for 'VOID*' PCD
#
if DatumType == TAB_PTR_TYPE_PCD:
SupArchList = [Arch]
if GenericComment:
if PcdErr:
if TailComment:
if SupModuleList:
HelpStr += '\n'
if HelpStr:
HelpTxtObj = TextObject()
return Pcd