class

MdfPackage

Module
MDF
Header
#include "mdf/mdf_package.h"
Namespace
MDF

Properties

TypeNameDescription
std::stringClass
std::stringId
uint32_tFormatVersionDefault MPKG_VERSION.
std::map<std::string, uint32_t>VersionsSubsystem -> 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>TagsRegistry tags, sorted by key — the content browser filters on these without loading the asset.
std::vector<MdfPackageImport>Imports
std::vector<MdfPackageExport>ExportsFilled by the readers from the payload (text) or the summary (binary).
MdfDocumentPayloadThe objects, one root node each.
std::vector<MdfPackageBulk>Bulk
MdfPackageThumbnailThumbnailBinary 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

ReturnsNameDescription
const MdfPackageBulk*FindBulk
boolIsBinary
std::vector<uint8_t>WriteBinaryThe binary encoding (.mesh, .tex, .anim, ...).
boolWriteTextThe text encoding (.mat, .prefab, .mmap, ...).
boolReadEither encoding, sniffed by the magic.
boolReadSummaryThe summary alone: class, id, versions, tags, imports, exports and the bulk table (offsets, not bytes).
std::stringDumpA 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) const

IsBinary

C++
static bool IsBinary(const uint8_t* data, size_t size)

WriteBinary

C++
inline std::vector<uint8_t> WriteBinary() const

The binary encoding (.mesh, .tex, .anim, ...).

WriteText

C++
inline bool WriteText(std::string& out, std::string* error = nullptr) const

The 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() const

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.

Generated from mdf/mdf_package.h via mdf.json · Oct 26, 2026Version 1.0.0