| <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 3.2 Final//EN"> |
| <html lang="en"> |
| |
| <head> |
| <meta http-equiv="Content-Language" content="en-us"> |
| <meta name="GENERATOR" content="Microsoft FrontPage 5.0"> |
| <meta name="ProgId" content="FrontPage.Editor.Document"> |
| <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>The CDT lets you search for language constructs in the projects in your |
| workspace or a working set for references to, declarations or definitions of, particular |
| elements.</p> |
| |
| <p>For information on:</p> |
| |
| <ul> |
| <li> Working sets, see <b>Workbench User Guide > Concepts > Workbench > Working sets</b></li> |
| <li> The Eclipse workspace, see <b>Workbench User Guide > Tasks > Upgrading |
| Eclipse</b></li> |
| </ul> |
| |
| <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> |
| |
| <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.<p>Searching for fields also finds enumerators.</td> |
| </tr> |
| <tr> |
| <td width="19%"> Enumeration</td> |
| <td width="81%">Searches for enumerations.</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> |
| |
| <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="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/ng03_04.gif" ALT="IBM Copyright Statement" BORDER=0 width="324" height="14"></p> |
| |
| </body> |
| |
| </html> |