Skip to content

Commit bf0dfe6

Browse files
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>
1 parent 9ba97f9 commit bf0dfe6

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
@@ -449,6 +449,23 @@ If *Fast DDS-Gen* does not find a C/C++ preprocessor in default system paths, th
449449
using parameter ``-ppPath``.
450450
The parameter ``-ppDisable`` can be used to disable the usage of the C/C++ preprocessor.
451451

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

0 commit comments

Comments
 (0)