PolicyLoader.hpp

1. Overview

The PolicyLoader.hpp header declares the parser that converts RootGuard INI-style policy text into a validated Policy structure.

The file integrates the following components, APIs, or runtime concepts:

  • Policy.hpp – output data model
  • PolicySecurity – secure file reading used by the source implementation

2. File Loading API

load(path) reads and parses a policy from disk. The implementation delegates file opening to PolicySecurity before parsing.


3. In-Memory Parsing API

loadFromText(content, source) parses policy text already held in memory. The optional source path is incorporated into validation errors and defaults to <memory>.


4. Runtime and Security Considerations

  • Validation is part of loading: callers receive either a coherent policy or an exception, never a knowingly invalid partial configuration.