26 std::mt19937& masterSeeder)
34 throw XmlException(
"Failed to load main XML file: " + filename);
37 const std::filesystem::path main_dir = std::filesystem::path(filename).parent_path();
62 std::mt19937& masterSeeder)
70 throw XmlException(
"Failed to parse XML from memory string.");
85 const std::filesystem::path base_dir =
".";
Class for managing XML documents.
bool loadFile(std::string_view filename)
Load an XML file into the document.
bool loadString(const std::string &content)
Load an XML document from a string in memory.
Exception class for handling XML-related errors.
The World class manages the simulator environment.
void clear() noexcept
Clears all objects and assets from the simulation world.
Wrapper for managing XML documents and elements using libxml2.
Header file for the logging system.
@ DEBUG
Debug level for general debugging information.
bool addIncludeFilesToMainDocument(const XmlDocument &mainDoc, const fs::path ¤tDir)
void processParsedDocument(const XmlDocument &doc, ParserContext &ctx)
Coordinates the full parsing of a validated XML document tree.
void validateXml(const bool didCombine, const XmlDocument &mainDoc)
Validates an XML document against the embedded DTD and XSD schemas.
AssetLoaders createDefaultAssetLoaders()
Creates an AssetLoaders struct populated with standard file-I/O implementations.
void parseSimulation(const std::string &filename, core::World *world, const bool validate, std::mt19937 &masterSeeder)
Parses a simulation configuration from an XML file.
void parseSimulationFromString(const std::string &xmlContent, core::World *world, const bool validate, std::mt19937 &masterSeeder)
Parses a simulation configuration directly from an XML string in memory.
Defines the Parameters struct and provides methods for managing simulation parameters.
void reset() noexcept
Resets the parameters to their default-constructed state.
Encapsulates the state required during the XML parsing process.
core::World * world
Pointer to the World where parsed objects are inserted.
std::mt19937 * master_seeder
RNG used to generate independent seeds for simulated objects.
std::filesystem::path base_dir
The directory of the main XML file (used to resolve relative asset paths).
params::Parameters parameters
An isolated copy of the simulation parameters being built.
AssetLoaders loaders
The injected asset loaders for external files.
Header file for the World class in the simulator.
High-level facade for parsing XML configuration files into the FERS simulation environment.
Core utility layer for parsing FERS XML scenario files.