templates/cpp_stubs
library
Functions
-
autoRegisterPlatformGuard({required bool isNativeCpp, required bool isAndroidCpp, required bool iosIsCpp, required bool macosIsCpp, bool windowsIsCpp = false})
→ String
-
Builds the
#if guard condition for the auto-register call inside a
src/HybridXxx.cpp stub.
-
cppImplStubContent({required String lib, required String className, required bool isNativeCpp, bool isAndroidCpp = false, required bool iosIsCpp, required bool macosIsCpp, bool windowsIsCpp = false})
→ String
-
Returns the content of a
src/Hybrid${className}.cpp implementation stub.
-
linuxCppStubContent({required String lib, required String className})
→ String
-
Returns the content of a
linux/src/Hybrid${className}.cpp stub.
-
webCppSeededContent({required String lib, required String className, required String implClass, required String starterBody})
→ String
-
web/src/Hybrid<Class>.cpp seeded from the generator's interface-complete
starter (<lib>.impl.g.cpp). starterBody is that file from its ownership
conventions onward — its quick-start (CMakeLists, plugin-init registration)
does not apply to a wasm module, so the header here replaces it. The
shared-impl marker line keeps web on src/ until the author deletes it.
-
webCppStubContent({required String lib, required String className})
→ String
-
Web-specific C++ impl starter (
web/src/Hybrid<Class>.cpp). Inert until it
holds real code — then nitrogen link compiles it for the wasm instead of
the shared src/Hybrid<Class>.cpp. Static-object registration: em++ is
clang, but this form needs no attribute and matches the shared starter.
-
windowsCppStubContent({required String lib, required String className})
→ String
-
Returns the content of a
windows/src/Hybrid${className}.cpp stub.