Code Browser by Woboq for C & C++

This is an online C and C++ code browser. It focuses on improving the code navigation with proper semantic highlighting and tooltips.


Interactive Live Demo

Decl *CallExpr::getCalleeDecl() {
  Expr *CEE = getCallee()->IgnoreParenImpCasts();

  while (SubstNonTypeTemplateParmExpr *NTTP
                                = dyn_cast<SubstNonTypeTemplateParmExpr>(CEE)) {
    CEE = NTTP->getReplacement()->IgnoreParenCasts();
  }

  // If we're calling a dereference, look at the pointer instead.
  if (BinaryOperator *BO = dyn_cast<BinaryOperator>(CEE)) {
    if (BO->isPtrMemOp())
      CEE = BO->getRHS()->IgnoreParenCasts();
  } else if (UnaryOperator *UO = dyn_cast<UnaryOperator>(CEE)) {
    if (UO->getOpcode() == UO_Deref)
      CEE = UO->getSubExpr()->IgnoreParenCasts();
  }
  if (DeclRefExpr *DRE = dyn_cast<DeclRefExpr>(CEE))
    return DRE->getDecl();
  if (MemberExpr *ME = dyn_cast<MemberExpr>(CEE))
    return ME->getMemberDecl();

  return nullptr;
}

Feature Tour

Tooltip containing all useful information about symbols

The Code Browser can be used as a Cross Referencer for C/C++ code.

Hover over a symbol, and you can see its type, its documentation or where it is used.

Click on the "Show Uses" label to see the list of usages. You can visit each links to discover how it is used. (Hint: you can open them in different tabs.)

In the parentheses you can see the number of uses within each functions. And the letters inside the parentheses are telling how the variable is used:

The function signature contains the name of all the argument (useful to know what ', false, true)' means), in addition to the type of each argument and their default value if any.
For virtual functions, you can quickly go to the implementation of the inherited functions

For enum constant you can see the numerical value.

The sizeof is also displayed

Navigation between functions

Clicking on a function brings you directly to the implementation. Just like normal URL, you can open it in a tab or new window and use the back button of your browser to come back where you came from.

Clicking on a variable brings you to the declaration of this variable

Macro expansions

The tool-tip of a macro shows its expansion.

Click on a macro to go to the corresponding #define.

Context

Sometimes, when you are reading the code of a long functions, you may wonder in which function you actually are. You can see the current function in the header.

Qt support

The Qt SIGNAL and SLOT macros are well supported. The tooltip of a signal show where you connect to it or emit it.

Search for a file or for a function

Start typing the name of a file or the name of a function in the line edit at the top. Result will be auto-completed once you entered 4 characters. Jump directly to the file or that function.

Works also on the main page in code.woboq.org

Show inheritance diagram

From the tooltip you can access a 🔗 symbol detail page which shows the inheritance diagram of a class

Pre-processor

expanded preprocessor macro

Clicking on an include brings you to that file

The tooltip of an #if/#elif/#else/#ifdef/#endif directives lets you jump to the matching directives

Usable links

Link to specific line numbers or to specific function or class within a page to show the code to people on a chat or web page.

Toggle line number

Inheritance graph of a class

If you wish to copy-paste code, you may want to hide the line numbers. Just click on the link to hide them or show them again.



Semantic Coloration - Pick Your Theme

Semantic highlighting makes reading a piece of code easier as it helps differentiating what is what. You can quickly differentiate local variables from member variables or global variables. Virtual functions are in italic. You can see what is a macros, a typedef, or a type.

Different themes are available depending on your taste. Just pick one from the style combo box at the top right.

How does it work?

The generator generates static HTML pages that can be served by any web server.
It indexes and semantically analyzes the source code in the generation step, using the clang libraries to parse the code.
It does not need a server-side database or CGI scripts, so it is easier to host.
It can be run automatically periodically or with a hook on a version control or CI system.
The generator runs on Linux or Mac and can be integrated with the build systems (CMake, QMake, others).

→ Read our more detailed explanation how the indexer works.

Free Public License

You can also host on the public internet without changing or removing the Woboq branding.

or git clone our development branch

Evaluation License

You can compile the generator yourself and try it on your own machine for 30 days.

or git clone our development branch

Commercial License

If you are interested in hosting a browsable version of your own C/C++ source code on your intranet, you can purchase a license of our code browser generator.

Source code

If you are interested in the implementation, you can browse the sources of the generator using the Code Browser itself. Or clone the repository from github. You can report issues on the github bugtracker.

© 2016 Woboq GmbH