rigProject 0.1.1
RigKit pack API - rigProject
Loading...
Searching...
No Matches
ContractImport.h File Reference

Read a Contract document into the ECS and report what arrived. More...

#include <array>
#include <entt/entt.hpp>
#include <optional>
#include <string>
#include <unordered_map>
#include <vector>
#include "core/U_core.h"
#include "ComponentSerializerRegistry.h"
Include dependency graph for ContractImport.h:

Classes

struct  rigkit::project::ContractImportResult
 Contract JSON (rig.* keys) to host POD import report. More...

Functions

std::optional< float > rigkit::project::contractGetFloat (MEcs &ecs, const ContractImportResult &doc, const std::string &entityId, const std::string &propertyKey)
 Read a float from the live entity via GetProperties (not a sidecar).
ContractImportResult rigkit::project::importContractJson (MEcs &ecs, const std::string &jsonText, const std::string &sourceLabel={})
 Import without a codec table (hand-written fallback).
ContractImportResult rigkit::project::importContractJson (MEcs &ecs, const std::string &jsonText, const std::string &sourceLabel, const ComponentSerializerRegistry &codecs)
 Import using registered document codecs for component blobs.

Detailed Description

Read a Contract document into the ECS and report what arrived.

Writes CUiPanel / CUiGroup / CUiControl / CUiAction onto the imported entities. The report rows list what arrived; values stay on the target POD.

Function Documentation

◆ importContractJson() [1/2]

ContractImportResult rigkit::project::importContractJson ( MEcs & ecs,
const std::string & jsonText,
const std::string & sourceLabel,
const ComponentSerializerRegistry & codecs )

Import using registered document codecs for component blobs.

Relationship still remaps by Contract document id (not eN handles). CUi* refs resolve from those ids. paint.solid present fallback and material to fill stay special.

◆ importContractJson() [2/2]

ContractImportResult rigkit::project::importContractJson ( MEcs & ecs,
const std::string & jsonText,
const std::string & sourceLabel = {} )

Import without a codec table (hand-written fallback).

Prefer the codecs overload.