Skip to main content

Crate dream_ini

Crate dream_ini 

Source
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§

ImportOptions
ImportReport
ImportResult
IniImporter
ParsedIni
PluginHeader
PreservedCfgUpdate
Import changes that should be applied to a preserving openmw.cfg document.

Enums§

Game
ImportError
ImportEvent
ImportWarning
PluginFormat
TextEncoding

Functions§

apply_preserved_cfg_update
Applies imported cfg values to an existing preserving openmw-config document.
known_fallback_keys
load_cfg_document
Loads an OpenMW cfg 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 OpenMW directory semantics while preserving authored path spelling.
save_preserved_cfg_document_to_path
Writes the cfg layer that was loaded from source_path without flattening inherited configs.
save_resolved_cfg_to_path
Writes cfg entries with OpenMW directory semantics and resolved directory paths.
save_resolved_configuration_to_path
Writes an openmw-config document with resolved paths without persisting composed engine VFS data directories.
serialize_cfg
serialize_cfg_output
Serializes cfg entries with OpenMW directory semantics while preserving authored path spelling.
serialize_preserved_cfg_document
serialize_resolved_cfg
Serializes cfg entries with OpenMW directory semantics and resolved directory paths.
serialize_resolved_configuration

Type Aliases§

MultiMap