MCPcopy
hub / github.com/colbymchenry/codegraph / stripCppTemplateArgs

Function stripCppTemplateArgs

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

Source from the content-addressed store, hash-verified

100 * identically. A name with no template args passes through unchanged.
101 */
102export function stripCppTemplateArgs(name: string): string {
103 if (!name.includes('<')) return name;
104 let out = '';
105 let depth = 0;
106 for (const ch of name) {
107 if (ch === '<') depth++;
108 else if (ch === '>') { if (depth > 0) depth--; }
109 else if (depth === 0) out += ch;
110 }
111 return out.trim();
112}
113
114/**
115 * A function/method's return type lives in the `function_definition`'s `type`

Callers 2

extractInheritanceMethod · 0.90
extraction.test.tsFile · 0.90

Calls

no outgoing calls

Tested by

no test coverage detected