# Generic File Queries

A generic file query is a powerful mechanism for locating files that match the criteria you specify. All the ready-made file queries that CScout provides you are just URLs specifying saved instances of generic queries.

You specify the query through the following form:

## File Query Writable Read-only
Sort-by | Metric | Compare | Value
--- | --- | --- | ---
| Number of characters |  |
| Number of comment characters |  |
| Number of space characters |  |
| Number of line comments |  |
| Number of block comments |  |
| Number of lines |  |
| Maximum number of characters in a line |  |
| Number of character strings |  |
| Number of unprocessed lines |  |
| Number of C preprocessor directives |  |
| Number of processed C preprocessor conditionals (ifdef, if, elif) |  |
| Number of defined C preprocessor function-like macros |  |
| Number of defined C preprocessor object-like macros |  |
| Number of preprocessed tokens |  |
| Number of compiled tokens |  |
| Number of copies of the file |  |
| Number of statements |  |
| Number of defined project-scope functions |  |
| Number of defined file-scope (static) functions |  |
| Number of defined project-scope variables |  |
| Number of defined file-scope (static) variables |  |
| Number of complete aggregate (struct/union) declarations |  |
| Number of declared aggregate (struct/union) members |  |
| Number of complete enumeration declarations |  |
| Number of declared enumeration elements |  |
| Number of directly included files |  |
| Entity name |  |
Reverse sort order Match any of the above Match all of the above File names should ( not) match RE Query title Main page — Web: Home Manual CScout

You start by specifying whether the file should be writable (i.e. typically part of your application) and/or readable (i.e. typically part of the compiler or system). Next come a series of metrics CScout collects for each file. For each metric (e.g. the number of comments) you can specify an operator `==, !=, <` or `>` and a number to match that metric against. Thus to locate files without any comments you would specify
Number of block comments `==` 0.

On the left of each metric you can specify whether that metric will be used to sort the resulting file list. In that case, the corresponding number will appear together with each file listed. A separate option allows you to specify that files should be sorted in the reverse order.

You can request to see files matching any of your specifications (Match any of the above) or to see files matching all your specifications (Match all of the above).

Sometimes you may only want to search in a subset of files; you can then specify a regular expression that filenames should match (or not match) against: "File names should (not) match RE".

Finally, you can also specify a title for your query. The title will then appear on the result document annotating the results, and will also provide you with a sensible name when creating a bookmark to it.

Contents | « Previous Next (Include Graphs) »