27
27
#include < algorithm>
28
28
#include < queue>
29
29
30
- #include < boost/iostreams/filtering_stream.hpp>
31
- #include < boost/iostreams/filter/regex.hpp>
32
30
#include < boost/json/src.hpp>
33
31
#include < boost/lexical_cast.hpp>
34
32
#include < boost/nowide/utf/convert.hpp>
@@ -656,31 +654,6 @@ void JsonWriter::handleDef(const Defect &def)
656
654
657
655
void JsonWriter::flush ()
658
656
{
659
- boost::iostreams::filtering_ostream str;
660
-
661
- // create a regex-based filter to restore integral values wrapped as strings
662
- const RE reInt (" : \" ([0-9]+)\" (,?)$" );
663
- boost::iostreams::basic_regex_filter<char > reFilter (reInt, " : \\ 1\\ 2" );
664
- str.push (reFilter);
665
-
666
- // create a regex-based filter to replace \/ (produced by newer boost) by /
667
- const RE reSlash (" ([^\\\\ ]*(?:\\\\\\\\ )*)(?:\\\\ (/))?" );
668
- boost::iostreams::basic_regex_filter<char > reFilterSlash (reSlash, " \\ 1\\ 2" );
669
- str.push (reFilterSlash);
670
-
671
- // create a regex-based filter to replace \u0009 by \t
672
- const RE reTab (" \\\\ u0009" );
673
- boost::iostreams::basic_regex_filter<char > reFilterTab (reTab, " \\\\ t" );
674
- str.push (reFilterTab);
675
-
676
- // regex-based filter to replace "results": "" by "results": [] in SARIF
677
- const RE reEmptyResults (" (\" results\" : )\"\" $" );
678
- boost::iostreams::basic_regex_filter<char >
679
- reFilterEmp (reEmptyResults, " \\ 1[]" );
680
- str.push (reFilterEmp);
681
-
682
- str.push (d->str );
683
-
684
657
// transfer scan properties if available
685
658
d->encoder ->importScanProps (d->scanProps );
686
659
@@ -689,5 +662,5 @@ void JsonWriter::flush()
689
662
d->encoder ->appendDef (d->defQueue .front ());
690
663
691
664
// finally encode the tree as JSON
692
- d->encoder ->writeTo (str);
665
+ d->encoder ->writeTo (d-> str );
693
666
}
0 commit comments