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.

Modules§

lua
Embedded Lua bindings for byte-first path normalization.

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.