Skip to content

Commit 8c80418

Browse files
cferreiragonzmergify[bot]
authored andcommitted
Docs - Apply custom templates to included IDL files (#1066)
* Refs #23150: Apply custom templates to included IDL files Signed-off-by: cferreiragonz <carlosferreira@eprosima.com> * Refs #23150: Apply suggestion Signed-off-by: cferreiragonz <carlosferreira@eprosima.com> --------- Signed-off-by: cferreiragonz <carlosferreira@eprosima.com> (cherry picked from commit bf0dfe6)
1 parent c2f12d0 commit 8c80418

File tree

2 files changed

+18
-0
lines changed

2 files changed

+18
-0
lines changed

code/FastDDSGenCodeTester.cpp

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -182,5 +182,6 @@ enum MyBitMask : uint8_t
182182
// INCLUDE_MORE_IDL_FILES
183183
#include "OtherFile.idl"
184184
#include <AnotherFile.idl>
185+
#include <IncludedIDL.idl>
185186
//!
186187
/**/

docs/fastddsgen/dataTypes/dataTypes.rst

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -450,6 +450,23 @@ If *Fast DDS-Gen* does not find a C/C++ preprocessor in default system paths, th
450450
using parameter ``-ppPath``.
451451
The parameter ``-ppDisable`` can be used to disable the usage of the C/C++ preprocessor.
452452

453+
The parameter ``-extrastg`` can also be used to apply custom templates to included IDL files.
454+
To enable this feature, the output file name passed to ``-extrastg`` must include the character ``@``, which will be
455+
replaced by the name of the included file to generate the output file.
456+
457+
The following command will generate two custom templates, one for the main IDL file and another for the included one:
458+
459+
- ``MainIDL_Custom.cpp``
460+
- ``IncludedIDL_Custom.cpp``
461+
462+
Where ``IncludedIDL.idl`` is included in ``MainIDL.idl`` file.
463+
464+
.. code-block:: bash
465+
466+
<path/to/Fast DDS-Gen>/scripts/fastddsgen MainIDL.idl -I <path/to/idls> -extrastg <path/to/template>/Custom.stg @_Custom.cpp
467+
468+
Check :ref:`fastddsgen_supported_options` for more information about the ``-extrastg`` option.
469+
453470
Annotations
454471
--------------
455472

0 commit comments

Comments
 (0)