-
Notifications
You must be signed in to change notification settings - Fork 0
C++ API
Leonard Ramminger edited this page Aug 31, 2026
·
1 revision
Headers ship with the engine install or source tree under include/.
Best for one-shot or file-based rendering with variables and CLI-like behavior.
#include "PrebyteEngine.h"
int main() {
prebyte::Prebyte prebyte;
prebyte.set_variable("name", "Ada");
prebyte.add_argument("first-extra");
std::string output = prebyte.process("Hello {{ name }}\n");
}Best for compile-once, render-many workflows.
#include "Engine.h"
prebyte::Engine engine;
prebyte::CompiledTemplate tpl = engine.compile("Hello {{ name }}\n");
prebyte::RenderContext ctx;
ctx.set("name", "Ada");
std::string output = engine.render(tpl, ctx);-
render()wrapsrender_to() -
RenderContextsupports scalar and structuredValue -
compile_file(path)uses path as source and logical path -
load_compiled_file(path)loads top-level.pbc
find_package(prebyte-engine CONFIG REQUIRED)
target_link_libraries(my_app PRIVATE prebyte::engine_static)For other languages, use the C API in C API (prebyte_engine.h, libprebyte_engine_c).