MCPcopy Create free account
hub / github.com/ActiveState/code / stripped_name

Method stripped_name

recipes/Python/578138_gprof2dotpy/recipe-578138.py:208–228  ·  view source on GitHub ↗

Remove extraneous information from C++ demangled function names.

(self)

Source from the content-addressed store, hash-verified

206 _const_re = re.compile(r'\s+const$')
207
208 def stripped_name(self):
209 """Remove extraneous information from C++ demangled function names."""
210
211 name = self.name
212
213 # Strip function parameters from name by recursively removing paired parenthesis
214 while True:
215 name, n = self._parenthesis_re.subn('', name)
216 if not n:
217 break
218
219 # Strip const qualifier
220 name = self._const_re.sub('', name)
221
222 # Strip template parameters from name by recursively removing paired angles
223 while True:
224 name, n = self._angles_re.subn('', name)
225 if not n:
226 break
227
228 return name
229
230 # TODO: write utility functions
231

Callers 1

graphMethod · 0.80

Calls 1

subMethod · 0.45

Tested by

no test coverage detected