Sign in

    moonbitlang/ooxml/uri does not have a README file

    PartNameConflict

    pub(all) enum PartNameConflict {
    Equivalent(String)
    Derivable(String)
    }

    The collision reported while registering a logical OPC PartName.

    PartNameRegistry

    pub struct PartNameRegistry {
    // private fields
    }

    A segment trie for OPC PartName identity and non-derivability checks. Storage and work are linear in aggregate PartName length; in particular, a deeply segmented ZIP name never materializes every growing prefix.

    PartNameRegistry::new

    Creates an empty PartName registry.

    PartNameRegistry::register

    fn PartNameRegistry::register(self : PartNameRegistry, name : StringView, display : String) -> PartNameConflict?

    Registers name, using display in any returned conflict. Identity is ASCII-case-insensitive and a name conflicts when either side is derivable from the other by appending one or more path segments.

    is_absolute_relationship_type

    fn is_absolute_relationship_type(value : StringView) -> Bool

    is_relationship_part_name

    fn is_relationship_part_name(name : String) -> Bool

    Returns whether the last two path segments have the reserved OPC Relationships-part shape. A .rels suffix elsewhere is an ordinary part.

    is_valid_external_relationship_target

    fn is_valid_external_relationship_target(value : StringView) -> Bool

    is_valid_part_segment

    fn is_valid_part_segment(segment : StringView) -> Bool

    Reports whether one logical OPC part-name segment is a canonical IRI segment. Literal RFC 3987 ucschar values are valid. Percent escapes must be complete, must not encode / or \\, and must not encode an iunreserved character, including a non-ASCII scalar such as é. OPC also forbids a segment whose final character is ..

    logical_part_name_from_zip_item_name

    fn logical_part_name_from_zip_item_name(name : StringView) -> String?

    Maps an ASCII ZIP item name to its logical OPC part name (without the leading slash used by the abstract syntax). Physical ZIP names percent- encode non-ASCII scalars; logical part names contain those scalars literally. Returns None for directory records, reserved metadata, and physical names that do not map to a canonical part name.

    part_name_key

    fn part_name_key(name : StringView) -> String

    Returns the OPC logical-identity key. Part and logical-item equivalence is ASCII-case-insensitive only; non-ASCII scalars remain case-sensitive.

    relationship_source_part_name

    fn relationship_source_part_name(name : String) -> String?

    Derives the package-root or part source represented by a Relationships-part name. Only the final _rels/<filename>.rels pair is structural; earlier _rels segments belong to the source PartName.

    relationships_part_name_for_source

    fn relationships_part_name_for_source(source : String) -> String

    Returns the logical Relationships-part name for a package-root or part source. Earlier _rels path segments remain ordinary source-name segments.

    resolve_part_target

    fn resolve_part_target(base : String, target : StringView) -> String?

    Resolves an internal OPC relationship target and rejects any result that is not a canonical logical PartName. This boundary deliberately operates on IRIs, not physical ZIP item names.

    resolve_target

    fn resolve_target(base : String, target : String) -> String?

    Resolves one internal relationship target against an archive-directory base. Package-rooted targets (/word/media/x.png) and relative targets use the same dot-segment normalization. Empty segments, URI schemes, query/fragment text, backslashes, empty results, and any traversal above the package root fail closed instead of being silently clamped.

    zip_item_name_from_logical_part_name

    fn zip_item_name_from_logical_part_name(name : StringView) -> String?

    Maps a canonical logical OPC part name (without its leading slash) to the ASCII ZIP item spelling required by ECMA-376. Existing legal percent escapes remain intact; every literal non-ASCII scalar is UTF-8 percent- encoded with uppercase hexadecimal digits.