Skip to main content

Crate dream_path

Crate dream_path 

Source
Expand description

Byte-first normalized virtual resource paths.

dream-path owns the path normalization shared by archive readers, VFS, resource loading, rendering-side resource lookup, and tooling. The rules are intentionally the boring OpenMW-style virtual path rules:

  • \ becomes /
  • ASCII uppercase letters become lowercase
  • repeated separators collapse
  • leading separators are discarded
  • arbitrary non-UTF-8 bytes are preserved

The rules are byte-literal: /// normalizes to an empty byte string, while a non-leading trailing separator is kept (foo/ stays foo/).

It does not decode legacy filename encodings, perform Unicode normalization, case-fold non-ASCII text, interpret host filesystem paths, or compute archive-format hashes. Those are separate jobs. Mixing them into the path type would be a small architectural crime, so naturally we avoid doing that.

§Lua API

Lua bindings are available behind the lua feature. Build documentation with --features standalone-lua to include links to the embedded Lua API.

The lua feature does not choose a Lua backend. Engine/application crates should enable exactly one shared mlua runtime for the final dependency graph. DreamWeave recommends LuaJIT in 5.2 compatibility mode and does not currently test these bindings against other Lua runtimes.

Re-exports§

pub use bstr;

Structs§

NormalizedPath
A byte-first normalized virtual resource path.

Functions§

extension_normalized
Return the extension of the final component of an already-normalized virtual path, without the dot.
file_name_normalized
Return the final non-empty component of an already-normalized virtual path.
is_normalized_path
Return true if path already matches this crate’s normalized spelling.
normalize_path
Normalize a virtual resource path into owned bytes.
normalize_path_in_place
Normalize an owned virtual resource path in place.
normalize_path_into
Normalize a virtual resource path into an existing buffer.
normalize_path_owned
Normalize an owned virtual resource path, reusing its allocation.
parent_normalized
Return the parent portion of an already-normalized virtual path.