Transformations

Transformation description (XML file)

The configuration file describes (in XML) the transformation of the template files into the project folder. In the normal case these will be .cpp / .h and possibly project files; however, all types of files can be handled.

The root node is a <ProjectFileGeneratorConfig> element. The useProjectInterface="true" attribute can be set directly at this node. It sets the processing procedure in the Visual Studio mode to generate projects (as opposed to TC-C++ modules).

Several <FileDescription> elements, each of which describes the transformation of a file, follow here. After these elements there is a possibility to define symbols that are available for the transformation in a <Symbols> element.

Transformation of the template files

A <FileDescription> element is structured as follows:

<FileDescription openFile="true"> 
<SourceFile>FileInTemplatesDirectory.cpp</SourceFile>
<TargetFile>[!output SYMBOLNAME].cpp</TargetFile>
<Filter>Source Files</Filter>
</FileDescription>

Transformation instructions

Commands that describe the transformations themselves are used in the template files.

The following commands are available:

Symbol names

Symbol names can be provided for the transformation instructions in 3 ways.
These are used by the commands described above in order to carry out replacements.

  1. A number of predefined symbols directly in the configuration file:
    A list of <Symbols> is provided in the XML file. Symbols can be defined here: <Symbols>
    <Symbol>
    <Name>CustomerSymbol</Name>
    <Value>CustomerString</Value>
    </Symbol>
    </Symbols>
  2. The generated destination file names can be provided by adding the "symbolName" attribute:
    <TargetFile symbolName="CustomerFileName">[!output SYMBOLNAME].txt</TargetFile>
  3. Important symbols are provided by the system itself

Symbol Name (Projects)

Description

PROJECT_NAME

The project name from the Visual Studio dialog.

PROJECT_NAME_UPPERCASE

The project name in upper case letters.

WIN32_WINNT

0x0400

DRVID

Driver ID in the format: 0x03010000

PLATFORM_TOOLSET

Toolset version, e.g. v100

PLATFORM_TOOLSET_ELEMENT

Toolset version as an XML element, e.g. <PlatformToolset>v100</PlatformToolset>

NEW_GUID_REGISTRY_FORMAT

Creates a new GUID in the format:
{48583F97-206A-4C7C-9EF2-D5C8A31F7BDC}

Symbol Name (Classes)

Description

PROJECT_NAME

The project name from the Visual Studio dialog.

HEADER_FILE_NAME

Entered by the user in the wizard dialog.

SOURCE_FILE_NAME

Entered by the user in the wizard dialog.

CLASS_NAME

Entered by the user in the wizard dialog.

CLASS_SHORT_NAME

Entered by the user in the wizard dialog.

CLASS_ID

A new GUID created by the wizard.

GROUP_NAME

C++

TMC_FILE_NAME

Used to identify the TMC file.

NEW_GUID_REGISTRY_FORMAT

Creates a new GUID in the format:
{48583F97-206A-4C7C-9EF2-D5C8A31F7BDC}