The following macros (enclosed in % characters) can be used as templates ("blueprint") values for both Forward (code-gen) and Reverse (parser) engineering. See Adding custom code templates and Using Code Templates.
In addition to the macros listed below, the parser can use the %Any% macro in parser blueprints. %Any% - matches any token.
|
Macro |
Definition |
|
%Class_Name% |
The name of class generated or selected. Note: can't be used in prologue/epilogue properties |
|
%FILE_NAME% |
The name of the class source code file |
|
%FILE_EXT% |
The file extension for same |
|
%DATE_CREATED% |
Date the file was created. |
|
%TIME_CREATED% |
Time the file was created. |
|
%Name% |
Specific name of an attribute/operation generated, editable in the Choose Pattern dialog |
|
%Dst% |
The name of destination class of link generated, editable in the Choose Pattern dialog |
|
%Short_Dst% |
The short non-qualified name of destination class of link generated (Java only) |
|
%Number% |
The autonumber providing unique (in the current scope) name for element generated |
|
%Parameters% |
Operation parameters, editable in the Choose Pattern dialog |
|
%Type% |
Type of attribute or return type of operation, editable in the Choose Pattern dialog |
|
Macro |
Definition |
|
%Header_File% |
The header file path |
Notes:
The case of letters in file macros (%FILE_NAME%, etc.) controls the case of letters in the generated file name. For example, "%FILE_NAME%_%FILE_EXT%" is expanded to "CLASS1_HPP", while "%File_Name%_%file_ext%" is expanded to "Class1_hpp".
The file macros (%FILE_NAME%, etc.) are resolved quotably. Thus, if due to the context, they should be resolved to valid identifiers, you should control this on your own. For example, if you use .h++ file extensions, then the statement in the default file prologue: #ifndef %FILE_NAME%_%FILE_EXT% can cause compilation errors.