Sometimes there’s a need to inject some C++ code into your ported C# code. If porting your code just once, you can do this after port comletes. However, if you are setting up a pipeline for porting some code continuously (e. g. to port each version of your product), it is easier to let porter do this job.
There are several features providing this behavior.
Placing ‘CppSkipDefinition’ attribute at some method will remove this method’s definition (but not declaration) from ported code. After doing this, you can either provide an alternative definition using ‘implementation’ cofiguration file node, or simply include a *.cpp file containing one directly into your project - when porting is done, this file will be copied into output project unchanged.
Code line injection
Alternatively, you may use a specially formatted comments in your C# code to add small portions of C++ code into your ported code. The example is below.