Skip to content

[Feature]: Read Archive from a buffer of bytes #7

@alardev

Description

@alardev

Prerequisites

Problem Statement

Unable to read an mpq file from a buffer of bytes directly (Vec etc)

Proposed Solution

implement a load function for Archive struct that can work directly with a buffer, instead of relying on a provided path to read from filesystem.

Alternatives Considered

https://github.com/msierks/mpq-rust/blob/c0bdb2863dbc3d7583e69ea7692d47a0bf42a4de/src/archive.rs#L155

There is a similar function in a related crate, which could serve as a good example. However that crate lacks several features needed for my use-case.

Feature Type

API improvement

Priority

High - Blocking my use case

Affected Components

  • MPQ archives
  • DBC/DB2 databases
  • BLP textures
  • M2 models
  • WMO world objects
  • ADT terrain
  • WDT/WDL world data
  • CLI interface
  • FFI/C bindings
  • Documentation
  • Build system
  • Cross-cutting/multiple components

Use Cases

I need to be able to read a file directly from Buffers, as there is no support for std::fs::File in wasm32 env.

Technical Considerations

No response

Examples

No response

Additional Context

No response

Implementation

  • I'm willing to implement this feature myself
  • I can help with testing and feedback
  • I can provide domain expertise/consultation
  • I can help with documentation
  • I'm looking for someone else to implement this

Metadata

Metadata

Labels

enhancementNew feature or request

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions