List all unique fields and functions used by C++ object pointer in many files

Alec Jacobson

April 21, 2011

weblog/

Here's a little bash one liner to find all fields and functions used by a C++ object pointer in all files of the current directory. The object I'm looking for always has a name ending in "mesh", which makes this a bit easier:
grep -ho "mesh->.*" * | sed -e "s/.*mesh->\([^(\[,\.]*\).*$/\1/g" | uniq
For me this prints exactly what I wanted:
ComputeShortestPathInTetVertices
Copy
FindClosestTetVertex
IsTetMesh
surface_to_tet_map
tet_neighbors
tet_vertices
tet_vertices for volume problem
tetrahedra

Comments

April 21, 2011, Colin
Maybe submit it here - http://www.commandlinefu.com/commands/browse