Skip to content

Fdf parser

fdf_parser

Code to help parse EDK2 Fdf files.

FdfParser

FDF parser object that represents an FDF file.

Attributes:

Name Type Description
Parsed bool

Whether the object contains a parsed FDF file

Lines list[str]

an ordered list of each line in the FDF file

Dict dict

dict of form: {"VariableName": Value}

FVs dict

dict of form: {"sectionName": {"Dict": {}, "Infs": [], "Files": {}}}

FDs dict

dict of form: {"sectionName": {}}

CurrentSection list

all lines in current section

Path str

path to FDF file

__init__

__init__() -> HashFileParser

Inits an empty FDF parser.

GetNextLine

GetNextLine() -> str

Returns the next line to parse.

Performs manipulation on the line like replacing variables, processing conditionals, etc.

InsertLinesFromFile

InsertLinesFromFile(file_path: str) -> None

Adds additional lines to the Lines Attribute from the provided file.

ParseFile

ParseFile(filepath: str) -> None

Parses the provided FDF file.