|
Petrichor
|
Petrichor consumer-level interface. More...
#include <petrichor.h>
Public Member Functions | |
| virtual void | log (PetrichorLogLevel level, const char *tag, const char *msg) const =0 |
| Writes a log message through the host. | |
| virtual const char * | mods_dir () const =0 |
| Returns the root directory containing installed packages. | |
| virtual const char * | temp_dir () const =0 |
| Returns the host's temporary working directory. | |
| virtual const char * | store_dir () const |
| Returns the directory used for persistent package storage. | |
| virtual const char * | version () const |
| Returns the current project version. | |
| virtual void | mod_ctx_enter (const char *dir, const char *id) |
| Notifies the host that a mod's context is becoming active. | |
| virtual void | mod_ctx_exit () |
| Notifies the host that the current mod context is ending. | |
| virtual const char * | project_name () const |
| Returns the current project name. | |
| virtual | ~IPetrichorHost ()=default |
| Virtual destructor. | |
Petrichor consumer-level interface.
Implemented by the host application and passed to Augment during initialization. Provides logging, memory allocation, symbol resolution, event registration, and access to host-specific services required by modules.
|
pure virtual |
Writes a log message through the host.
| level | Log severity. |
| tag | Source or subsystem name. |
| msg | Null-terminated message. |
|
inlinevirtual |
Notifies the host that a mod's context is becoming active.
Called before invoking into a mod's Luau code (e.g. lifecycle callbacks like tick/save/shutdown), so the host can attribute subsequent behavior (logging, crash reports, stack traces) to the correct mod. Paired with a matching mod_ctx_exit() call once the mod invocation completes.
| dir | Filesystem directory of the mod entering context. |
| id | Unique identifier of the mod entering context. |
|
inlinevirtual |
Notifies the host that the current mod context is ending.
Called after a mod invocation started by mod_ctx_enter() completes, so the host can clear any active-mod attribution state.
|
inlinevirtual |
Returns the current project name.
Hosts should ALWAYS include a project name. It is used for error outputs.
|
inlinevirtual |
Returns the directory used for persistent package storage.
Hosts that do not provide persistent storage should return nullptr.
|
inlinevirtual |
Returns the current project version.
Hosts should ALWAYS include a version. It is recommended to generate it from your CMake once and use it all over. Used for automatic version checking