3

I'm looking for a free tool for analyzing a generic C++ project without a particular IDE for searching references or declaration of classes, methods and functions. For example, a similar tool have to work also with projects which use bash scripts for compilation. A tool like cppdepend.com.

If it doesn't exist, we could organize to develop it.

Thank you

1

2 Answers 2

1

You might find SourceTrail as something that can do this. I code for a FOSS project and we had a FOSS project license for this a couple of years ago - however as of November 2019 SourceTrail has switched to a Gnu Public License so that it is free for all to use.

To use it, it needs to access a compilation database of your project; for a C++ project that can be obtained in passing from the clang compiler but there are other methodologies that can be employed should you be using other compilers.

When it has got this information you can then use it's GUI to track the objects (methods, members, constants etc.) to see where they come from, what they depend on and where they are used. From personal experience I know that it can work with the Qt Creator (IDE) to direct that to the places where methods are declared and defined - and indeed since 4.8 of Creator that can generate the previously mentioned compilation database for you as part of building your Qt project.

0

You just want to search plain text source files for a string, right?

Did you try grep? It comes with linux, and there are also versions for Windows cmd.exe. It can also search groups of files specified with a wildcard like *.c or multiple wildcard groups like *.c *.h.

  1. GrepWin has a GUI for windows.
  2. GNU Grep is a CLI for cmd.exe.
  3. Another GrepWin.
  4. Oak Road Systems grep for cmd.exe.
  5. findstr comes with cmd.exe (Windows) and has some options including searching all files in subdirectories. For help do findstr /? in a cmd.exe window.
3
  • 1
    This is the idea. But I'm looking for something more clever, especially than me. Anyway, thank you
    – rikicecchi
    Sep 13, 2019 at 8:51
  • I don't understand what do you mean by more clever than you. It's just a tool.
    – 59507
    Oct 10, 2019 at 14:36
  • As the OP said earching references or declaration of classes, methods and functions, not just every text occurrence of their names Oct 11, 2019 at 10:19

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.