MCPcopy Create free account
hub / github.com/clockworklabs/SpacetimeDB / new

Method new

crates/codegen/src/unrealcpp.rs:5226–5243  ·  view source on GitHub ↗
(extra_includes: &[&str], self_header: &str, include_version: bool)

Source from the content-addressed store, hash-verified

5224
5225impl UnrealCppAutogen {
5226 fn new(extra_includes: &[&str], self_header: &str, include_version: bool) -> Self {
5227 let mut output = CodeIndenter::new(String::new(), " ");
5228 print_auto_generated_file_comment(&mut output);
5229 if include_version {
5230 print_auto_generated_version_comment(&mut output);
5231 }
5232 writeln!(output, "#pragma once");
5233 writeln!(output, "#include \"CoreMinimal.h\"");
5234 writeln!(output, "#include \"BSATN/UESpacetimeDB.h\"");
5235
5236 // Add specific includes based on what's needed
5237 for include in extra_includes {
5238 writeln!(output, "#include \"{include}\"");
5239 }
5240 writeln!(output, "#include \"{self_header}.g.generated.h\""); // need to include the generated header for Unreal's reflection
5241 writeln!(output);
5242 Self { output }
5243 }
5244
5245 fn new_cpp(extra_includes: &[&str]) -> Self {
5246 let mut output = CodeIndenter::new(String::new(), " ");

Callers

nothing calls this directly

Calls 3

newFunction · 0.50

Tested by

no test coverage detected