MCPcopy Create free account
hub / github.com/bytecodealliance/wit-bindgen / class_namespace

Method class_namespace

crates/cpp/src/lib.rs:1280–1297  ·  view source on GitHub ↗
(
            cifg: &CppInterfaceGenerator,
            func: &Function,
            variant: AbiVariant,
        )

Source from the content-addressed store, hash-verified

1278
1279 fn generate_function(&mut self, func: &Function, owner: &TypeOwner, variant: AbiVariant) {
1280 fn class_namespace(
1281 cifg: &CppInterfaceGenerator,
1282 func: &Function,
1283 variant: AbiVariant,
1284 ) -> Vec<String> {
1285 let owner = &cifg.resolve.types[match &func.kind {
1286 FunctionKind::Static(id) => *id,
1287 _ => panic!("special func should be static"),
1288 }];
1289 let mut namespace = namespace(
1290 cifg.resolve,
1291 &owner.owner,
1292 matches!(variant, AbiVariant::GuestExport),
1293 &cifg.r#gen.opts,
1294 );
1295 namespace.push(owner.name.as_ref().unwrap().to_upper_camel_case());
1296 namespace
1297 }
1298
1299 let export = match variant {
1300 AbiVariant::GuestImport => false,

Callers

nothing calls this directly

Calls 2

namespaceFunction · 0.85
pushMethod · 0.45

Tested by

no test coverage detected