MCPcopy Create free account
hub / github.com/colbymchenry/codegraph / stripCppTemplateArgs

Function stripCppTemplateArgs

src/extraction/languages/c-cpp.ts:157–167  ·  view source on GitHub ↗
(name: string)

Source from the content-addressed store, hash-verified

155 * identically. A name with no template args passes through unchanged.
156 */
157export function stripCppTemplateArgs(name: string): string {
158 if (!name.includes('<')) return name;
159 let out = '';
160 let depth = 0;
161 for (const ch of name) {
162 if (ch === '<') depth++;
163 else if (ch === '>') { if (depth > 0) depth--; }
164 else if (depth === 0) out += ch;
165 }
166 return out.trim();
167}
168
169/**
170 * A function/method's return type lives in the `function_definition`'s `type`

Callers 5

extractCallMethod · 0.90
recordCppFnPtrBindingMethod · 0.90
extractInheritanceMethod · 0.90
extraction.test.tsFile · 0.90
extractCppReceiverTypeFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected