blob: 0ec9bc31a83c2cfc826f93ccc4f78ab0e90980ab [file] [log] [blame]
Fabian Meyer92e372b2024-05-06 16:54:48 +02001package ebg
2
3import "review.coreboot.org/coreboot.git/util/intelp2m/platforms/common"
4
5type InheritanceTemplate interface {
6 GroupNameExtract(line string) (bool, string)
7 KeywordCheck(line string) bool
8}
9
10// GroupNameExtract - This function extracts the group ID, if it exists in a row
11// line : string from the configuration file
12// return
13// bool : true if the string contains a group identifier
14// string : group identifier
15func (platform PlatformSpecific) GroupNameExtract(line string) (bool, string) {
16 return common.KeywordsCheck(line,
17 "GPPC_A", "GPPC_B", "GPPC_S", "GPPC_C", "GPP_D", "GPP_E", "GPPC_H", "GPP_J",
18 "GPP_I", "GPP_L", "GPP_M", "GPP_N")
19}
20
21// KeywordCheck - This function is used to filter parsed lines of the configuration file and
22// returns true if the keyword is contained in the line.
23// line : string from the configuration file
24func (platform PlatformSpecific) KeywordCheck(line string) bool {
25 isIncluded, _ := common.KeywordsCheck(line, "GPP_", "GPPC_")
26 return isIncluded
27}