Expand description
Library support for importing Morrowind INI settings into OpenMW-style configuration data.
The crate exposes the same core importer used by the dream-ini CLI. Configuration data is
represented as a multimap (key -> Vec<value>) so duplicate cfg keys such as data, content,
and fallback are preserved without special cases.
Path values exposed through cfg text, Lua tables, and import events are UTF-8 strings;
non-UTF-8 operating-system paths are outside the supported API contract.
§Example
use std::path::Path;
use dream_ini::{ImportOptions, IniImporter};
let importer = IniImporter::new(ImportOptions::default());
let result = importer.import_optional_cfg_path(
Path::new("Morrowind.ini"),
Some(Path::new("openmw.cfg")),
)?;
for warning in &result.warnings {
eprintln!("Warning: {warning}");
}Enable the lua feature to expose an embedding-oriented Lua API via [lua::create_module].
Structs§
- Import
Options - Import
Report - Import
Result - IniImporter
- Parsed
Ini - Plugin
Header - Preserved
CfgUpdate - Import changes that should be applied to a preserving
openmw.cfgdocument.
Enums§
Functions§
- apply_
preserved_ cfg_ update - Applies imported cfg values to an existing preserving
openmw-configdocument. - known_
fallback_ keys - load_
cfg_ document - Loads an
OpenMWcfg document without flattening it through resolved serialization. - parse_
cfg_ str - parse_
ini_ bytes - parse_
ini_ bytes_ with_ warnings - parse_
ini_ str - parse_
ini_ str_ with_ warnings - read_
plugin_ header - Reads the dependency header from a plugin file.
- save_
cfg_ output_ to_ path - Writes cfg entries with
OpenMWdirectory semantics while preserving authored path spelling. - save_
preserved_ cfg_ document_ to_ path - Writes the cfg layer that was loaded from
source_pathwithout flattening inherited configs. - save_
resolved_ cfg_ to_ path - Writes cfg entries with
OpenMWdirectory semantics and resolved directory paths. - save_
resolved_ configuration_ to_ path - Writes an
openmw-configdocument with resolved paths without persisting composed engine VFS data directories. - serialize_
cfg - serialize_
cfg_ output - Serializes cfg entries with
OpenMWdirectory semantics while preserving authored path spelling. - serialize_
preserved_ cfg_ document - serialize_
resolved_ cfg - Serializes cfg entries with
OpenMWdirectory semantics and resolved directory paths. - serialize_
resolved_ configuration