Parse configuration file. Args: filepath: Path to rtconfig.h Returns: Dictionary of configuration options
(self, filepath: str)
| 76 | self.conditions: List[str] = [] |
| 77 | |
| 78 | def parse_file(self, filepath: str) -> Dict[str, ConfigOption]: |
| 79 | """ |
| 80 | Parse configuration file. |
| 81 | |
| 82 | Args: |
| 83 | filepath: Path to rtconfig.h |
| 84 | |
| 85 | Returns: |
| 86 | Dictionary of configuration options |
| 87 | """ |
| 88 | if not os.path.exists(filepath): |
| 89 | raise FileNotFoundError(f"Configuration file not found: {filepath}") |
| 90 | |
| 91 | with open(filepath, 'r', encoding='utf-8') as f: |
| 92 | content = f.read() |
| 93 | |
| 94 | return self.parse_content(content) |
| 95 | |
| 96 | def parse_content(self, content: str) -> Dict[str, ConfigOption]: |
| 97 | """ |
no test coverage detected