Fabian Meyer | 92e372b | 2024-05-06 16:54:48 +0200 | [diff] [blame^] | 1 | package ebg |
| 2 | |
| 3 | import "review.coreboot.org/coreboot.git/util/intelp2m/platforms/common" |
| 4 | |
| 5 | type 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 |
| 15 | func (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 |
| 24 | func (platform PlatformSpecific) KeywordCheck(line string) bool { |
| 25 | isIncluded, _ := common.KeywordsCheck(line, "GPP_", "GPPC_") |
| 26 | return isIncluded |
| 27 | } |