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

Open a .rig or .rigz package and resolve the asset paths inside it. More...

#include <string>
Include dependency graph for Rigz.h:

Classes

struct  rigkit::project::PackageOpen
 Result of opening a .rig or .rigz package for import. More...

Functions

bool rigkit::project::isRigzPath (const std::string &path)
PackageOpen rigkit::project::openPackage (const std::string &path)
 Prepare a document path for importContractFile.
void rigkit::project::releasePackage (PackageOpen &opened)
 Delete a temporary extract from openPackage (no-op if not temp).
bool rigkit::project::writeRigz (const std::string &destPath, const std::string &rigPath, const std::string &packetRoot, std::string *error=nullptr)
 Write a .rigz with exactly one .rig at the archive root.
std::string rigkit::project::resolvePacketAssetPath (const std::string &packetRoot, const std::string &assetPath)
 Resolve a sidecar or host-root asset_ref.path against a packet root.

Detailed Description

Open a .rig or .rigz package and resolve the asset paths inside it.

A .rigz unzips to a temp directory, so pair every openPackage with releasePackage.

Function Documentation

◆ isRigzPath()

bool rigkit::project::isRigzPath ( const std::string & path)
Returns
true when path ends with .rigz (case-insensitive).

◆ openPackage()

PackageOpen rigkit::project::openPackage ( const std::string & path)

Prepare a document path for importContractFile.

.rig to packet root = parent directory. .rigz to unzip to a temp dir (one root .rig + optional data/). Other extensions fail.

◆ resolvePacketAssetPath()

std::string rigkit::project::resolvePacketAssetPath ( const std::string & packetRoot,
const std::string & assetPath )

Resolve a sidecar or host-root asset_ref.path against a packet root.

Tries packetRoot/data/<path> first (Contract), then packetRoot/<path> (loose / legacy data/... prefixes). Absolute paths pass through unchanged.

◆ writeRigz()

bool rigkit::project::writeRigz ( const std::string & destPath,
const std::string & rigPath,
const std::string & packetRoot,
std::string * error = nullptr )

Write a .rigz with exactly one .rig at the archive root.

Optional sidecars under packetRoot (data/, assets/) are stored with those prefixes. data/ may contain further .rig files. rigPath is the JSON document embedded at the archive root.