Skip to content

[23150] Docs - Apply custom templates to included IDL files (backport #1066) #1073

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 1 commit into
base: 2.14.x
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions code/FastDDSGenCodeTester.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -188,5 +188,6 @@ enum MyBitMask : uint8_t
// INCLUDE_MORE_IDL_FILES
#include "OtherFile.idl"
#include <AnotherFile.idl>
#include <IncludedIDL.idl>
//!
/**/
17 changes: 17 additions & 0 deletions docs/fastddsgen/dataTypes/dataTypes.rst
Original file line number Diff line number Diff line change
Expand Up @@ -448,6 +448,23 @@ If *Fast DDS-Gen* does not find a C/C++ preprocessor in default system paths, th
using parameter ``-ppPath``.
The parameter ``-ppDisable`` can be used to disable the usage of the C/C++ preprocessor.

The parameter ``-extrastg`` can also be used to apply custom templates to included IDL files.
To enable this feature, the output file name passed to ``-extrastg`` must include the character ``@``, which will be
replaced by the name of the included file to generate the output file.

The following command will generate two custom templates, one for the main IDL file and another for the included one:

- ``MainIDL_Custom.cpp``
- ``IncludedIDL_Custom.cpp``

Where ``IncludedIDL.idl`` is included in ``MainIDL.idl`` file.

.. code-block:: bash

<path/to/Fast DDS-Gen>/scripts/fastddsgen MainIDL.idl -I <path/to/idls> -extrastg <path/to/template>/Custom.stg @_Custom.cpp

Check :ref:`fastddsgen_supported_options` for more information about the ``-extrastg`` option.

Annotations
--------------

Expand Down