Author Topic: CTF 'Import' and 'Import Impl' templates  (Read 2767 times)

g.makulik

  • EA User
  • **
  • Posts: 355
  • Karma: +0/-0
    • View Profile
CTF 'Import' and 'Import Impl' templates
« on: November 25, 2012, 08:28:55 am »
Hi,

Can someone tell me how these templates apply exactly, I cannot find any general documentation for these.

I can see though these have code for languages like Java or C#. I just guess you can use these to have more fine grained control over single import statements (e.g. realized by #include or extern statements in C/C++).

1. Is there a possibility to use these from C/C++ code generation?

2. Is there further possibility to control the contents produced by the %fileImports% CTF macro anyhow?

I'd like to have #include statements generated for standard framework classes like std::string or std::vector<int>
The include statements for such classes always look like this:
Code: [Select]
#include "string.h"
#include "vector.h"
These #include statements should rather render as
Code: [Select]
#include <string>
#include <vector>

Does anyone know a solution how to achieve this for C/C++ code generation (without using class level code generation Import(s)/Header(s) settings)?

Best regards,
Günther
Using EA9.3, UML2.3, C++, linux, my brain, http://makulik.github.com/sttcl/

g.makulik

  • EA User
  • **
  • Posts: 355
  • Karma: +0/-0
    • View Profile
Re: CTF 'Import' and 'Import Impl' templates
« Reply #1 on: November 25, 2012, 12:59:31 pm »
OK I've got it!

You'll simply need need to add the %Import% / %ImportImpl% CTF template expansions to the standard 'File' / 'File Impl' templates.

Then these are considered and you can change / override them as necessary.

HTH anyone else,

Günther
Using EA9.3, UML2.3, C++, linux, my brain, http://makulik.github.com/sttcl/