There are many scenarios where you may want to manipulate the directory hierarchy in a C/C++ code-base model.

Where you wish to do this using generalizations - based on pattern matching against the file names - use transformations or pre-transformations.

Sometimes, however, you may wish to apply a bunch of highly specific "rename" operations. This is where the name map comes in.

A name map boils down to a simple text file where each line corresponds to an explicit rename (no wildcards) directive in the form

<sourcename><TAB><targetname>

The file may contain any number of such directives. So there could be one to deal with some specific anomaly in the file system organization, or there could be one for each and every source file in the code-base e.g. to take some metadata defined elsewhere and use it to transform the model to the point where it no longer bears any relation to the way the source code is organized in the file system.

To use a name map, proceed as follows:

  1. Write or generate the name map file.
  2. Save this file with the same name and location as the cpa file but with extension ".namemap". For example, if the cpa file is called /foo/X.cpa, the name map file must be stored as /foo/X.namemap
  3. Choose menu item Project/Properties, select the Main Settings panel, and activate the option Use namemap if available.

Note: