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

Method cpp_field_name

crates/codegen/src/cpp.rs:22–38  ·  view source on GitHub ↗
(&self, field_name: &'a str)

Source from the content-addressed store, hash-verified

20
21impl<'opts> Cpp<'opts> {
22 fn cpp_field_name<'a>(&self, field_name: &'a str) -> &'a str {
23 match field_name {
24 "alignas" | "alignof" | "and" | "and_eq" | "asm" | "atomic_cancel" | "atomic_commit"
25 | "atomic_noexcept" | "auto" | "bitand" | "bitor" | "bool" | "break" | "case" | "catch" | "char"
26 | "char8_t" | "char16_t" | "char32_t" | "class" | "compl" | "concept" | "const" | "consteval"
27 | "constexpr" | "constinit" | "const_cast" | "continue" | "co_await" | "co_return" | "co_yield"
28 | "decltype" | "default" | "delete" | "do" | "double" | "dynamic_cast" | "else" | "enum" | "explicit"
29 | "export" | "extern" | "false" | "float" | "for" | "friend" | "goto" | "if" | "inline" | "int"
30 | "long" | "mutable" | "namespace" | "new" | "noexcept" | "not" | "not_eq" | "nullptr" | "operator"
31 | "or" | "or_eq" | "private" | "protected" | "public" | "register" | "reinterpret_cast" | "requires"
32 | "return" | "short" | "signed" | "sizeof" | "static" | "static_assert" | "static_cast" | "struct"
33 | "switch" | "template" | "this" | "thread_local" | "throw" | "true" | "try" | "typedef" | "typeid"
34 | "typename" | "union" | "unsigned" | "using" | "virtual" | "void" | "volatile" | "wchar_t" | "while"
35 | "xor" | "xor_eq" => "",
36 _ => field_name,
37 }
38 }
39
40 fn write_cpp_field_name(&self, output: &mut String, field_name: &str) -> fmt::Result {
41 let escaped = self.cpp_field_name(field_name);

Callers 1

write_cpp_field_nameMethod · 0.80

Calls

no outgoing calls

Tested by

no test coverage detected