|
Hyperiso 1.0.3
Modular flavour-physics calculations, Wilson coefficients and statistical inference
|
Processes lines of a template C++ file and injects custom code. More...
#include <LineProcessor.h>
Public Member Functions | |
| LineProcessor (IncludeManager &includeManager, MartyFileWriter &filewriter, bool forceMode) | |
| Constructs a LineProcessor with the given helpers and mode. | |
| void | processLine (std::ofstream &outputFile, const std::string ¤tLine) |
| Processes a single line of input and writes to the output file. | |
Processes lines of a template C++ file and injects custom code.
LineProcessor is typically used to post-process a C++ file generated by MARTY:
main signature to accept argc, argv,#include directives,return 0;,//42) unless forceMode is enabled. Definition at line 30 of file LineProcessor.h.
| LineProcessor::LineProcessor | ( | IncludeManager & | includeManager, |
| MartyFileWriter & | filewriter, | ||
| bool | forceMode | ||
| ) |
Constructs a LineProcessor with the given helpers and mode.
| includeManager | Reference to an IncludeManager instance. |
| filewriter | Reference to a MartyFileWriter instance. |
| forceMode | If true, the processor keeps modifying the file even after encountering the //42 marker. |
Definition at line 3 of file LineProcessor.cpp.
| void LineProcessor::processLine | ( | std::ofstream & | outputFile, |
| const std::string & | currentLine | ||
| ) |
Processes a single line of input and writes to the output file.
The behavior depends on the contents of currentLine:
"//42" and forceMode == false, further injections are disabled and subsequent lines are passed through unchanged."int main", the signature is rewritten as int main(int argc, char** argv)."return 0;", the method inserts:return 0; line."using namespace", required includes are injected and the line is forwarded.outputFile.| outputFile | Stream representing the transformed C++ file. |
| currentLine | Current line read from the input file. |
Definition at line 6 of file LineProcessor.cpp.