enable backup of filters outputs
Issue/feature addressed
Currently filters override their output if the file already exists. This merge request closes #264 (closed) and enables backup of the files if they exists and backup is enabled.
Proposed solution
An overloaded virtual function is added to the filter base class, the first function accept file extension and parameter map. From those inputs, the code checks, as usual, if the "OutputFile" is defined in the parameter and use it or uses the session name if not. For few filters, as the output file renames in other functions that didn't have access to the parameters map, to keep it clean, this SetupOutput function overloaded to accept extension and file name.
When the name is set up, then similar to what we do for "chk" field output, the function checks if the file exists and if so, added -bak# to the name.
Implementation
as explained in the Proposed solution
Tests
All have checked but test are not needed.
Suggested reviewers
Please suggest any people who would be appropriate to review your code.
Notes
Please add any other information that could be useful for reviewers.
Checklist
-
Functions and classes, or changes to them, are documented. -
User guide/documentation is updated. -
Changelog is updated. -
Suitable tests added for new functionality. -
Contributed code is correctly formatted. (See the contributing guidelines). -
License added to any new files. -
No extraneous files have been added (e.g. compiler output or test data files).