## @file
# This file is used to define comment generating interface
#
# 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.
#
'''
CommentGenerating
'''
##
# Import Modules
#
## GenTailCommentLines
#
# @param TailCommentLines: the tail comment lines that need to be generated
# @param LeadingSpaceNum: the number of leading space needed for non-first
# line tail comment
#
EndOfLine = "\n"
return CommentStr
## GenGenericComment
#
# @param CommentLines: Generic comment Text, maybe Multiple Lines
#
if not CommentLines:
return ''
EndOfLine = "\n"
return CommentStr
## GenGenericCommentF
#
# similar to GenGenericComment but will remove <EOL> at end of comment once,
# and for line with only <EOL>, '#\n' will be generated instead of '# \n'
#
# @param CommentLines: Generic comment Text, maybe Multiple Lines
# @return CommentStr: Generated comment line
#
if not CommentLines:
return ''
EndOfLine = "\n"
#
# if comment end with '\n', then remove it to prevent one extra line
# generate later on
#
CommentStr = ''
for Line in CommentLineList:
if Line == '':
else:
return CommentStr
## GenHeaderCommentSection
#
# Generate Header comment sections
#
# @param Abstract One line of abstract
# @param Description multiple lines of Description
# @param Copyright possible multiple copyright lines
# @param License possible multiple license lines
#
EndOfLine = '\n'
Content = ''
if Abstract:
else:
if Description:
(Description, '\n'))
#
# There is no '#\n' line to separate multiple copyright lines in code base
#
if Copyright:
if License:
(License, '\n'))
return Content
## GenInfPcdTailComment
# Generate Pcd tail comment for Inf, this would be one line comment
#
# @param Usage: Usage type
# @param TailCommentText: Comment text for tail comment
#
return ''
return GenTailCommentLines(CommentLine)
## GenInfProtocolPPITailComment
#
# @param Usage: Usage type
# @param TailCommentText: Comment text for tail comment
#
return ''
if Notify:
else:
CommentLine = ''
return GenTailCommentLines(CommentLine)
## GenInfGuidTailComment
# Generate Guid tail comment for Inf
#
# @param Usage: Usage type
# @param TailCommentText: Comment text for tail comment
#
(not TailCommentText):
return ''
if GuidType == TAB_INF_GUIDTYPE_VAR:
return GenTailCommentLines(CommentLine)
## GenDecGuidTailComment
#
# @param SupModuleList: Supported module type list
#
return GenTailCommentLines(CommentLine)
## _GetHelpStr
# get HelpString from a list of HelpTextObject, the priority refer to
# related HLD
#
# @param HelpTextObjList: List of HelpTextObject
#
# @return HelpStr: the help text string found, '' means no help text found
#
HelpStr = ''
for HelpObj in HelpTextObjList:
return HelpStr
for HelpObj in HelpTextObjList:
return HelpStr
for HelpObj in HelpTextObjList:
return HelpStr
return HelpStr