Book a Demo

Author Topic: Code Generation Template  with C  (Read 2261 times)

Schuecki

  • EA Novice
  • *
  • Posts: 2
  • Karma: +0/-0
    • View Profile
Code Generation Template  with C
« on: June 03, 2009, 09:34:04 pm »
Hello,

I have the following problem.
I want to seperate macros and global function prototypes, but on every code generation EA adds the macro additonally in the header file.

Header File:
/*****************************************************************************
* macros
*****************************************************************************/


#define macro(v, a) // added on the first generation


/*****************************************************************************
* public variables
*****************************************************************************/


int mypublicint;


/*****************************************************************************
* public functions
*****************************************************************************/


void publicFunction();
#define macro(v, a) // added on the second generation
#define macro(v, a) // added on the third generation



Template "Class Body":
/*****************************************************************************
* macros
*****************************************************************************/
\n
$pubDefines = %list="Operation" @separator="\n" opTag:"define"=="true"%
$pubDefines = %TRIM($pubDefines, "\n")%
%if $pubDefines != ""%
$pubDefines
\n
%endIf%
/*****************************************************************************
* public variables
*****************************************************************************/
\n
$pubAttributes = %list="Attribute" @separator="\n" attScope=="Public" and attTag:"define"==""%
$pubAttributes = %TRIM($pubAttributes, "\n")%
%if $pubAttributes != ""%
$pubAttributes
\n
%endIf%
/*****************************************************************************
* public functions
*****************************************************************************/
\n
$pubOperations = %list="Operation" @separator="\n" opScope=="Public" and opTag:"define"==""%
$pubOperations = %TRIM($pubOperations, "\n")%
%if $pubOperations != ""%
$pubOperations
%endIf%

Could somebody help me ?

regards Christoph

Eve

  • EA Administrator
  • EA Guru
  • *****
  • Posts: 8110
  • Karma: +119/-20
    • View Profile
Re: Code Generation Template  with C
« Reply #1 on: June 04, 2009, 10:55:10 am »
I'm afraid you're probably stuck.

EA is treating them both as methods, and has a single method insert location.