mirror of
https://github.com/eclipse-cdt/cdt
synced 2025-04-29 19:45:01 +02:00

new Discovery Problem Reporting option (3 changes) new Binary Parser section for New Managed Make Project Properties (1 addition and new screen captures for that section) updates to two concepts docs, the cdt_c_search.htm and cdt_c_makefile.htm which were showing some errors on certain characters
269 lines
No EOL
10 KiB
HTML
269 lines
No EOL
10 KiB
HTML
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 3.2 Final//EN">
|
|
<html lang="en">
|
|
|
|
<head>
|
|
<meta http-equiv="Content-Language" content="en-us">
|
|
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
|
|
<title>C/C++ search</title>
|
|
<link rel="stylesheet" type="text/css" href="../help.css">
|
|
</head>
|
|
|
|
<body>
|
|
|
|
<h1>C/C++ search</h1>
|
|
|
|
<p>You can conduct a fully or partially qualified name search. Further
|
|
qualifying a search increases the accuracy and relevance of search results. The
|
|
sections below provide guidance on how to control the scope of your search
|
|
through the use of search delimiters, correct syntax, and wildcards.</p>
|
|
|
|
<p>You can search for:<br>
|
|
<ul>
|
|
<li>language constructs within:
|
|
<ul>
|
|
<li>projects in your workspace</li>
|
|
<li>selected resources from various views</li>
|
|
<li>working sets</li>
|
|
</ul></li>
|
|
<li>a working set for references to particular elements</li>
|
|
<li>declarations of particular elements</li>
|
|
<li>definitions of particular elements</li>
|
|
<li>references of particular elements</li>
|
|
</ul>
|
|
</p>
|
|
|
|
For information on working sets, see <b>Workbench User Guide > Concepts > Workbench > Working sets</b><br>
|
|
|
|
|
|
<h2>What you can search for</h2>
|
|
<p>The table below lists the element types that you can search for and special
|
|
considerations to note when searching for a given element type. You can search
|
|
for some or all of the element types matching a search string that you
|
|
specify. If you choose to search for matching elements, all types, macros, and typdefs are included in the search.</p>
|
|
<table border="1" cellpadding="0" cellspacing="0" style="border-collapse: collapse" bordercolor="#111111" width="60%">
|
|
<tr>
|
|
<td width="19%"><b>Element</b></td>
|
|
<td width="81%"><b>Note</b></td>
|
|
</tr>
|
|
<tr>
|
|
<td width="19%"> Class/Struct</td>
|
|
<td width="81%">Searches for classes and structs.<p>You can further qualify
|
|
the search by specifying "class" or "struct" in front of the name
|
|
that you are
|
|
searching for. Specifying "class" or "struct" also allows you to
|
|
search for anonymous classes and structures.</td>
|
|
</tr>
|
|
<tr>
|
|
<td width="19%"> Function</td>
|
|
<td width="81%">Searches for global functions or functions in a namespace
|
|
(functions that are not members of a class, struct, or union).<p>You can
|
|
specify parameters to further qualify your search. When specifying a
|
|
parameter list, everything between the parentheses should be valid C/C++
|
|
syntax.</p>
|
|
<p>Do not specify the return type of the function.</td>
|
|
</tr>
|
|
<tr>
|
|
<td width="19%"> Variable</td>
|
|
<td width="81%">Searches for variables that are not members of a class,
|
|
struct, or union.</td>
|
|
</tr>
|
|
<tr>
|
|
<td width="19%"> Union</td>
|
|
<td width="81%">Searches for unions.<p>Anonymous unions can be searched for by
|
|
specifying "union" as the search pattern.</td>
|
|
</tr>
|
|
<tr>
|
|
<td width="19%"> Method</td>
|
|
<td width="81%">Searches for methods that are members of a class, struct, or
|
|
union.<p>Searching for methods also finds constructors and destructors. See
|
|
above note for functions.</td>
|
|
</tr>
|
|
<tr>
|
|
<td width="19%"> Field </td>
|
|
<td width="81%">Searches for fields that are members of a class, struct, or
|
|
union.
|
|
</tr>
|
|
<tr>
|
|
<td width="19%"> Enumeration</td>
|
|
<td width="81%">Searches for enumerations.</td>
|
|
</tr>
|
|
<tr>
|
|
<td width="19%"> Enumerator</td>
|
|
<td width="81%">Searches for enumerators.</td>
|
|
</tr>
|
|
<tr>
|
|
<td width="19%"> Namespace</td>
|
|
<td width="81%">Searches for namespaces.</td>
|
|
</tr>
|
|
</table>
|
|
|
|
<h2>How you can limit your search</h2>
|
|
|
|
<p>You can limit your search to one or all of the following:</p>
|
|
|
|
<ul>
|
|
<li>Declarations</li>
|
|
<li>References</li>
|
|
<li>Definitions (for functions, methods, variables and fields)</li>
|
|
</ul>
|
|
|
|
<p>You can control the scope of the search by specifying which of the following
|
|
is to be searched:</p>
|
|
<ul>
|
|
<li>Workspace</li>
|
|
<li>Working Set</li>
|
|
<li>Selected Resources</li>
|
|
</ul>
|
|
|
|
<h2>Wildcard characters</h2>
|
|
<p>You can use wildcard characters to further refine your search.</p>
|
|
<table border="1" cellpadding="0" cellspacing="0" style="border-collapse: collapse" bordercolor="#111111" width="60%">
|
|
<tr>
|
|
<td width="49%"><b>Use this wildcard character</b></td>
|
|
<td width="51%"><b>To search for this</b></td>
|
|
</tr>
|
|
<tr>
|
|
<td width="49%"> <samp>*</samp></td>
|
|
<td width="51%">Any string<p><b>Tip:<br>
|
|
</b> Use the character <samp>*</samp> to search for
|
|
operators that begin with *. See syntax examples in the table below.</td>
|
|
</tr>
|
|
<tr>
|
|
<td width="49%"> <samp>?</samp></td>
|
|
<td width="51%">A single character</td>
|
|
</tr>
|
|
<tr>
|
|
<td width="49%"> <samp>::</samp></td>
|
|
<td width="51%">Nested elements</td>
|
|
</tr>
|
|
</table>
|
|
<p><b>Tip: </b>Do not use wild cards between the brackets of a function or
|
|
method pattern. For example, the search
|
|
string <samp>f( * )</samp> is an invalid search that results in a search for any function <samp>f</samp>
|
|
because
|
|
the asterisk is interpreted as a pointer rather than a wild card.</p>
|
|
<h2>Syntax examples</h2>
|
|
<p>The table below provides syntax examples and an explanation for each example
|
|
to help you conduct an effective search.</p>
|
|
<table border="1" cellpadding="0" cellspacing="0" style="border-collapse: collapse" bordercolor="#111111" width="60%" height="400">
|
|
<tr>
|
|
<td width="64%" height="16"><b>Syntax</b></td>
|
|
<td width="36%" height="16"><b>Searches for this</b></td>
|
|
</tr>
|
|
<tr>
|
|
<td width="64%" height="17"> <samp>::*::*::A</samp></td>
|
|
<td width="36%" height="17">A nested element two levels deep</td>
|
|
</tr>
|
|
<tr>
|
|
<td width="64%" height="32"> <samp>::*::*::A?</samp></td>
|
|
<td width="36%" height="32">Any two-letter name that begins with A and is two levels
|
|
deep</td>
|
|
</tr>
|
|
<tr>
|
|
<td width="64%" height="32"> <samp>::A</samp> </td>
|
|
<td width="36%" height="32">Searches for A not nested in anything</td>
|
|
</tr>
|
|
<tr>
|
|
<td width="64%" height="17"> <samp>*()</samp></td>
|
|
<td width="36%" height="17">Any function taking no parameters</td>
|
|
</tr>
|
|
<tr>
|
|
<td width="64%" height="32"> <samp>*( A * )</samp> </td>
|
|
<td width="36%" height="32">Any function taking 1 parameter that is a pointer to type
|
|
A</td>
|
|
</tr>
|
|
<tr>
|
|
<td width="64%" height="33"> <samp>f( int * )</samp></td>
|
|
<td width="36%" height="33">Will search for function f taking 1 parameter that is an
|
|
int *</td>
|
|
</tr>
|
|
<tr>
|
|
<td width="64%" height="64"> <samp>f( const char [
|
|
], A & )</samp></td>
|
|
<td width="36%" height="64">Will search for a function f, taking 2 parameters; one is a
|
|
const char array, the other is a reference to type A</td>
|
|
</tr>
|
|
<tr>
|
|
<td width="64%" height="32"> <samp>operator \*</samp></td>
|
|
<td width="36%" height="32">Finds only operator *</td>
|
|
</tr>
|
|
<tr>
|
|
<td width="64%" height="32"> <samp>operator \*=</samp></td>
|
|
<td width="36%" height="32">Finds only operator *=</td>
|
|
</tr>
|
|
<tr>
|
|
<td width="64%" height="16"> <samp>operator *</samp></td>
|
|
<td width="36%" height="16">Finds all operators</td>
|
|
</tr>
|
|
<tr>
|
|
<td width="64%" height="15"> <samp>class</samp></td>
|
|
<td width="36%" height="15">Searches for anonymous classes</td>
|
|
</tr>
|
|
<tr>
|
|
<td width="64%" height="16"> <samp>struct</samp></td>
|
|
<td width="36%" height="16">Searches for anonymous structs</td>
|
|
</tr>
|
|
<tr>
|
|
<td width="64%" height="16"> <samp>union</samp></td>
|
|
<td width="36%" height="16">Searches for anonymous unions</td>
|
|
</tr>
|
|
</table>
|
|
<h2>Search results</h2>
|
|
<p>Search results are displayed in the Search view. You can sort your search by Name, Parent Name and Path. You can also repeat
|
|
your last search.</p>
|
|
|
|
<h2>Search Concepts</h2>
|
|
|
|
<h3>Declarations</h3>
|
|
<p>According to the ANSI C++ Spec, a declaration is a statement that “introduces a name into a translation unit or re-declares a name that has been previously introduced by a previous declaration.</p>
|
|
<p>All C/C++ search elements can be searched for declarations.</p>
|
|
|
|
<h3>Definitions</h3>
|
|
<p>Most declarations are also definitions; in other words, they also define the entity for they declare the name for. However there are some elements that can have separate definitions from their declarations.</p>
|
|
<p>For C/C++ search the following elements can be searched for definitions:
|
|
<ul>
|
|
<li>Functions/Methods – the definition is where the code implementation resides</li>
|
|
<li>Variable:
|
|
<ol>
|
|
<li>Extern – the definition is where the variable is initialized</li>
|
|
<li>Non extern - the definition of a variable is where it is declared </li>
|
|
</ol></li>
|
|
<li>Field:
|
|
<ol>
|
|
<li>Static fields - the definition of a static field is where it gets initialized</li>
|
|
<li>Non static fields - the definition corresponds to the fields declaration</li>
|
|
</ol></li>
|
|
<li>Namespace – the definition of a namespace is the same as its declaration</li>
|
|
</ul></p>
|
|
|
|
<h3>References</h3>
|
|
<p>By selecting references, C/C++ search will return all of the places the selected element is used.</p>
|
|
|
|
<h3>All Occurrences</h3>
|
|
<p>Selecting ‘All Occurrences’ in the Limit To section will result in a search for declarations, definitions (if applicable) and references for whatever element or elements have been selected.</p>
|
|
|
|
<h3>Any Element</h3>
|
|
<p>Selecting ‘Any Element’ in the Search For section will result in a search for all of the listed elements plus macros and typedefs.</p>
|
|
|
|
|
|
<p>For more information, see:<ul>
|
|
<li> <b>Workbench User Guide > Concepts > Views > Search view</b></li>
|
|
<li> <b>Workbench User Guide > Tasks > Navigating and finding resources</b></li>
|
|
</ul>
|
|
<p><img border="0" src="../images/ngconcepts.gif" ALT="Related concepts" width="143" height="21"><br>
|
|
<a href="../concepts/cdt_c_indexer.htm">C/C++ Indexer</a><br>
|
|
<a href="cdt_c_projects.htm">CDT Projects</a><br>
|
|
<a href="cdt_c_open_declarations.htm">Open Declarations</a></p>
|
|
<p><img border="0" src="../images/ngtasks.gif" ALT="Related tasks" width="143" height="21">
|
|
<br>
|
|
<a href="../tasks/cdt_t_search.htm">Searching for C/C++ elements</a><br>
|
|
<a href="../tasks/cdt_t_open_declarations.htm">Navigating to C/C++ declarations</a></p>
|
|
<p><img border="0" src="../images/ngref.gif" ALT="Related reference" width="143" height="21"> <br>
|
|
<a href="../reference/cdt_u_search.htm">C/C++ search page, Search dialog box</a><br>
|
|
<a href="../reference/cdt_u_icons.htm">C/C++ perspective icons</a></p><p>
|
|
|
|
<img src="../images/ng00_04a.gif" ALT="IBM Copyright Statement" ></p>
|
|
|
|
</body>
|
|
|
|
</html> |