class
MdfPackage
- Module
- MDF
- Header
#include "mdf/mdf_package.h"- Namespace
MDF
Properties
| Type | Name | Description |
|---|---|---|
std::string | Class | |
std::string | Id | |
uint32_t | FormatVersion | Default MPKG_VERSION. |
std::map<std::string, uint32_t> | Versions | Subsystem -> version of the data it wrote (UE's custom versions): a mesh loader asks for "mesh", an animation loader for "anim", and each decides alone what an older version means. Keys are identifiers ([A-Za-z0-9_]): they are written as property keys. |
std::map<std::string, std::string> | Tags | Registry tags, sorted by key — the content browser filters on these without loading the asset. |
std::vector<MdfPackageImport> | Imports | |
std::vector<MdfPackageExport> | Exports | Filled by the readers from the payload (text) or the summary (binary). |
MdfDocument | Payload | The objects, one root node each. |
std::vector<MdfPackageBulk> | Bulk | |
MdfPackageThumbnail | Thumbnail | Binary encoding only. A text package never carries one: a re-render on another GPU would rewrite the line and every merge of a material would conflict on a picture nobody edited. |
Public functions
| Returns | Name | Description |
|---|---|---|
const MdfPackageBulk* | FindBulk | |
bool | IsBinary | |
std::vector<uint8_t> | WriteBinary | The binary encoding (.mesh, .tex, .anim, ...). |
bool | WriteText | The text encoding (.mat, .prefab, .mmap, ...). |
bool | Read | Either encoding, sniffed by the magic. |
bool | ReadSummary | The summary alone: class, id, versions, tags, imports, exports and the bulk table (offsets, not bytes). |
std::string | Dump | A whole package rendered as text, bulk chunks listed by tag and size — the textconv git runs over a binary asset so a diff and a review read it. |
Function details
FindBulk
C++
const MdfPackageBulk* FindBulk(const std::string& tag) constIsBinary
C++
static bool IsBinary(const uint8_t* data, size_t size)WriteBinary
C++
inline std::vector<uint8_t> WriteBinary() constThe binary encoding (.mesh, .tex, .anim, ...).
WriteText
C++
inline bool WriteText(std::string& out, std::string* error = nullptr) constThe text encoding (.mat, .prefab, .mmap, ...). False with error set when the package carries bulk data: such a type is binary by definition.
Read
C++
static inline bool Read(const uint8_t* data, size_t size, MdfPackage& out, std::string* error = nullptr)Either encoding, sniffed by the magic.
ReadSummary
C++
static inline bool ReadSummary(const uint8_t* data, size_t size, MdfPackage& out, std::string* error = nullptr, uint64_t fileSize = 0)The summary alone: class, id, versions, tags, imports, exports and the bulk table (offsets, not bytes). Never decodes the payload of a binary package — this is the registry's read. fileSize > size says data is only the front of a binary file (header and summary), so a browser reads a thumbnail without pulling a mesh's geometry off disk.
Dump
C++
inline std::string Dump() constA whole package rendered as text, bulk chunks listed by tag and size — the textconv git runs over a binary asset so a diff and a review read it.
Generated from mdf/mdf_package.h via mdf.json · Oct 26, 2026Version 1.0.0