@@ -348,6 +348,32 @@ class PathStripper: public GenericAbstractFilter {
348
348
const size_t prefSize_;
349
349
};
350
350
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
+
351
377
class DuplicateFilter : public AbstractFilter {
352
378
public:
353
379
DuplicateFilter (AbstractWriter *agent):
@@ -552,6 +578,7 @@ int main(int argc, char *argv[])
552
578
(" annot" , po::value<string>(), " defect matches if its annotation matches the given regex" )
553
579
(" src-annot" , po::value<string>(), " defect matches if an annotation in the _source_ file matches the given regex" )
554
580
581
+ (" drop-scan-props" , " do not propagate scan properties" )
555
582
(" embed-context,U" , po::value<int >(), " embed a number of lines of context from the source file for the key event" )
556
583
(" prune-events" , po::value<int >(), " event is preserved if its verbosity level is below the given number" )
557
584
(" remove-duplicates,u" , " remove defects that are not unique by their key event" )
@@ -631,6 +658,9 @@ int main(int argc, char *argv[])
631
658
// an error message already printed out
632
659
return 1 ;
633
660
661
+ if (vm.count (" drop-scan-props" ))
662
+ eng = new DropScanProps (eng);
663
+
634
664
if (vm.count (" remove-duplicates" ))
635
665
eng = new DuplicateFilter (eng);
636
666
0 commit comments