Skip to main content

generate_cpp

Function generate_cpp 

Source
pub fn generate_cpp(schema: &Schema) -> Result<String>
Expand description

Compile a schema to a single self-contained C++ header of structs with to_verit / from_verit, over the header-only veritate.hpp port. Like the other emitters it maps each struct to/from the dynamic Value/reader form and supports every schema shape (all struct modes, all list element types). Fields are std::optional<T> (absent = std::nullopt). The embedded canonical schema + 128-bit id are the cross-language contract.