File tree Expand file tree Collapse file tree 2 files changed +21
-3
lines changed
Expand file tree Collapse file tree 2 files changed +21
-3
lines changed Original file line number Diff line number Diff line change 33namespace JSON
44{
55 BeautifiedStreamWrapper::BeautifiedStreamWrapper ()
6- : indentation_(0 )
6+ : indentation_(0 )
7+ , escape_(false )
8+ , disabled_(false )
79 , nestingStack_()
810 {
911 nestingStack_.push (NestingState::IN_CLASS);
Original file line number Diff line number Diff line change @@ -32,7 +32,21 @@ namespace JSON
3232 template <typename Sink>
3333 bool put (Sink& snk, char c)
3434 {
35- namespace io = boost::iostreams;
35+ namespace io = boost::iostreams;
36+
37+ escape_ = false ;
38+ if (disabled_)
39+ if (c == ' \\ ' )
40+ escape_ = true ;
41+
42+ if (c == ' "' && !escape_)
43+ disabled_ = !disabled_;
44+
45+ if (disabled_)
46+ {
47+ io::put (snk, c);
48+ return true ;
49+ }
3650
3751 if (c == ' {' )
3852 {
@@ -83,7 +97,9 @@ namespace JSON
8397 }
8498
8599 private:
86- int indentation_;
100+ int indentation_;
101+ bool escape_;
102+ bool disabled_;
87103 std::stack <NestingState> nestingStack_;
88104 };
89105}
You can’t perform that action at this time.
0 commit comments