Skip to content

Commit 33f93fa

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 6151802 commit 33f93fa

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
@@ -188,5 +188,6 @@ enum MyBitMask : uint8_t
188188
// INCLUDE_MORE_IDL_FILES
189189
#include "OtherFile.idl"
190190
#include <AnotherFile.idl>
191+
#include <IncludedIDL.idl>
191192
//!
192193
/**/

docs/fastddsgen/dataTypes/dataTypes.rst

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

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

0 commit comments

Comments
 (0)