Add ComponentCompiler::build_from_path

This commit is contained in:
Simon Hausmann 2021-03-19 17:26:19 +01:00
parent fd9d154b27
commit 9eecdefb35
5 changed files with 57 additions and 0 deletions

View file

@ -502,6 +502,18 @@ public:
return {};
}
}
std::optional<ComponentDefinition> build_from_path(std::string_view path)
{
cbindgen_private::ComponentDefinitionOpaque result;
if (cbindgen_private::sixtyfps_interpreter_component_compiler_build_from_path(
&inner, sixtyfps::private_api::string_to_slice(path), &result)) {
return ComponentDefinition(result);
} else {
return {};
}
}
};
}