@@ -348,6 +348,32 @@ class PathStripper: public GenericAbstractFilter {
348348 const size_t prefSize_;
349349};
350350
351+ class DropScanProps : public GenericAbstractFilter {
352+ public:
353+ DropScanProps (AbstractWriter *agent):
354+ GenericAbstractFilter (agent)
355+ {
356+ }
357+
358+ // / ignore any given scan properties
359+ virtual void setScanProps (const TScanProps &) {
360+ }
361+
362+ // / always return empty scan properties
363+ virtual const TScanProps& getScanProps () const {
364+ return emp_;
365+ }
366+
367+ protected:
368+ // / trivial pass-through
369+ virtual void handleDef (const Defect &def) {
370+ agent_->handleDef (def);
371+ }
372+
373+ private:
374+ const TScanProps emp_;
375+ };
376+
351377class DuplicateFilter : public AbstractFilter {
352378 public:
353379 DuplicateFilter (AbstractWriter *agent):
@@ -552,6 +578,7 @@ int main(int argc, char *argv[])
552578 (" annot" , po::value<string>(), " defect matches if its annotation matches the given regex" )
553579 (" src-annot" , po::value<string>(), " defect matches if an annotation in the _source_ file matches the given regex" )
554580
581+ (" drop-scan-props" , " do not propagate scan properties" )
555582 (" embed-context,U" , po::value<int >(), " embed a number of lines of context from the source file for the key event" )
556583 (" prune-events" , po::value<int >(), " event is preserved if its verbosity level is below the given number" )
557584 (" remove-duplicates,u" , " remove defects that are not unique by their key event" )
@@ -631,6 +658,9 @@ int main(int argc, char *argv[])
631658 // an error message already printed out
632659 return 1 ;
633660
661+ if (vm.count (" drop-scan-props" ))
662+ eng = new DropScanProps (eng);
663+
634664 if (vm.count (" remove-duplicates" ))
635665 eng = new DuplicateFilter (eng);
636666
0 commit comments