EngineExport.h header
#include <ew/app/EngineExport.h>
Namespace ew::app
Functions
QJsonObject ew::app::publishing::exportEngineSlice(const ew::core::project::Project &project, const ew::app::library::MountedLibraries &libraries, DataSliceKind kind)
Wraps a data slice in the versioned envelope an engine consumes.
The bare array the existing export emits cannot say what it is. A game engine reading it has no way to tell an entity list from a timeline, or version 1 from version 4 – so a schema change on our side becomes a silent misread on theirs, discovered as wrong behaviour in a shipped build rather than as an error at import.
The envelope carries the format version, the generator that wrote it, the slice's own name, the row count, and the rows. The count is written even though the array knows its own length, because a consumer that streams the file can check it against what it actually read and catch a truncated download – the failure that otherwise looks like a project with fewer entities.
QString ew::app::publishing::toEngineCsv(const QJsonObject &slice)
Renders slice as CSV: one header row of column names, then one row per record.
Columns are the union of every key present, sorted, because the records in a slice do not all carry the same fields – an entity with no lifespan simply omits it – and a column set taken from the first record would silently drop every field only later records use. Sorted so two exports of the same project produce the same column order, which is what makes them diffable.
Nested values are written as compact JSON rather than flattened, so nothing is lost and the cell stays machine-readable.
Constants
int ew::app::publishing::kEngineExportVersion = 1
The version of the engine-export contract this build emits.
A version is only useful if there is a rule for when it changes, so here is the rule: it increments when a consumer that understood the previous version could MISREAD the new one – a field removed, renamed, or given a different meaning. Adding a field does NOT increment it, because a consumer reading by name is unharmed by a key it ignores. Without that rule a version number becomes decoration, bumped when someone remembers and trusted by nobody.