rigProject 0.1.1
RigKit pack API - rigProject
Loading...
Searching...
No Matches
rigkit::rigProject Class Reference

Document/page data + JSON document load/save systems. More...

#include <rigProject/src/rigProject.h>

Public Member Functions

void setFileExtension (std::string ext)
 Preferred document file extension (with or without leading dot).
const std::string & fileExtension () const
 Normalized extension including leading dot (default .rig).
std::string documentPath (const std::string &stemOrPath) const
 Build a path using the preferred extension when stemOrPath has none.
void requestSave (const std::string &path={})
 Queue a save on the next Update.
void requestLoad (const std::string &path)
 Queue a load on the next Update.
void registerSerializer (project::ComponentSerializer serializer)
 Register a component codec owned by another pack (or the app).

Detailed Description

Document/page data + JSON document load/save systems.

Depends on rigComponent for registration order. Default file extension is .rig (override with setFileExtension, e.g. "rigdoc"). Reads and writes the JSON document. A .rigz is a ZIP with one .rig at the archive root plus data/, and data/ may contain further .rig files. openPackage / writeRigz handle that ZIP.

Member Function Documentation

◆ documentPath()

std::string rigkit::rigProject::documentPath ( const std::string & stemOrPath) const

Build a path using the preferred extension when stemOrPath has none.

Parameters
stemOrPathAbsolute/relative path or bare stem (show to show.rig).

◆ registerSerializer()

void rigkit::rigProject::registerSerializer ( project::ComponentSerializer serializer)

Register a component codec owned by another pack (or the app).

Prefer project::addSerializer<T>(...) then this, or pass the filled ComponentSerializer. Owning packs register their portable PODs here; this pack only walks the registry on save/load.

◆ requestLoad()

void rigkit::rigProject::requestLoad ( const std::string & path)

Queue a load on the next Update.

Parameters
pathSource path (required). Bare stems get fileExtension() appended.

◆ requestSave()

void rigkit::rigProject::requestSave ( const std::string & path = {})

Queue a save on the next Update.

Parameters
pathTarget path; empty uses CProject::path when set. Bare stems get fileExtension() appended.

◆ setFileExtension()

void rigkit::rigProject::setFileExtension ( std::string ext)

Preferred document file extension (with or without leading dot).

Parameters
exte.g. "rig", ".rig", "rigdoc". Empty resets to .rig.

The documentation for this class was generated from the following file:
  • packs/rigProject/src/rigProject.h