C/C++ Search

The C/C++ Search mechanism provided by the C/C++ Development Plugin enables users to search for both text (string) and specific C/C++ data types - variables, functions, macros, etc.

Eclipse Search Dialog

The C/C++ Search Tool accessed through the Eclipse Search dialog. There are three ways to open the Eclipse Workbench Search dialog.

  1. From the Workbench menu:


  2. From the Workbench tool bar:


  3. From the keyboard via keyboard sequence: Ctrl+h

C/C++ Search Tool

Select the C/C++ Search tab.

C/C++ Search Features

The goal for the C/C++ search mechanism is to enable the user to easily navigate and understand the source code in hand. The C/C++ search tab consists of four groups or areas:

  • Search Expression group where the user inputs the string to search for. Note that if the user highlights text in the editor, this text will be shown in the text field area
  • Search For group which limits the search to the desired data types selected by the user. This simplifies the search results when viewed in the search results view. It also speeds up getting the search results.
  • Limit to group which enables the user to refine the search to whether to limit the search to declaration only or references only or both.
  • Scope group which enables the user to define the search scope. It enhances the search and provides faster results when working with huge projects. To narrow the search, the user clicks on the selection radio button and selects the directory to search in. The default is set to the whole workspace.

C/C++ Search Options

Case Sensitivity
Off by default, you may choose to refine your searches by turning on case sensitivity.

Regular Expressions
On by default, you may specify your search argument as a regular expression.

Our regular expression support uses the Jakarta ORO package (available from: http://jakarta.apache.org) which is described on their website as:

"The Kakarta-ORO Java classes are a set of text-processing Java classes that provide
Perl5 compatible regular expressions, AWK-like regular expressions, glob expressions
and utility classes for performing substitutions, splits, filtering filenames, etc."

Example of using C/C++ Search

  1. Launch Search Dialog using the methods described above
  2. Input the desired search string in the search Expression field
  3. Select the data type that you wish to search for from the Search For group
  4. Using the Scope group, define the scope of the search - By default the scope is the whole workspace
  5. Click on the search button to view the search results


Click . The results are viewed in the Search view.

Note: You can switch focus to the source code location by:

  • Double clicking the mouse on a specific line in the Search Results view
  • Selecting a specific line in the Search Results view and mouse clicking on the view tool bar icon:

Limitations for this release

"Limit to" group has not been implemented

Limitations

Before using C/C++ search mechanism, the C/C++ code must be parsed first.

Contact Us