@@ -699,17 +699,24 @@ int MyStreamWriter::write(Value const& root) const
699
699
class StreamWriterBuilder {
700
700
typedef StreamWriter::CommentStyle CommentStyle;
701
701
CommentStyle cs_;
702
+ std::string indentation_;
702
703
public:
703
704
virtual ~StreamWriterBuilder ();
704
705
virtual void setCommentStyle (CommentStyle cs);
706
+ virtual void setIndentation (std::string indentation);
705
707
virtual StreamWriter* newStreamWriter (std::ostream* sout) const ;
706
708
};
707
709
StreamWriterBuilder::~StreamWriterBuilder ()
708
710
{
709
711
}
710
- void StreamWriterBuilder::setCommentStyle (CommentStyle cs )
712
+ void StreamWriterBuilder::setCommentStyle (CommentStyle v )
711
713
{
712
- cs_ = cs;
714
+ cs_ = v;
715
+ }
716
+ void StreamWriterBuilder::setIndentation (std::string v)
717
+ {
718
+ indentation_ = v;
719
+ if (indentation_.empty ()) cs_ = CommentStyle::None;
713
720
}
714
721
StreamWriter* StreamWriterBuilder::newStreamWriter (std::ostream* stream) const
715
722
{
@@ -732,9 +739,17 @@ StreamWriter::Builder::~Builder()
732
739
{
733
740
delete own_;
734
741
}
735
- void StreamWriter::Builder::setCommentStyle (CommentStyle cs)
742
+ void StreamWriter::Builder::setCommentStyle (CommentStyle v)
743
+ {
744
+ own_->setCommentStyle (v);
745
+ }
746
+ void StreamWriter::Builder::setIndentation (std::string v)
747
+ {
748
+ own_->setIndentation (v);
749
+ }
750
+ StreamWriter* StreamWriter::Builder::newStreamWriter (std::ostream* sout)
736
751
{
737
- own_->setCommentStyle (cs );
752
+ return own_->newStreamWriter (sout );
738
753
}
739
754
740
755
// / Do not take ownership of sout, but maintain a reference.
0 commit comments