From a16982956c5e87d9b2f238522d902df177ece98e Mon Sep 17 00:00:00 2001 From: Karen Arutyunov Date: Sat, 6 Apr 2019 23:47:48 +0300 Subject: Add support for manifest_serializer long lines mode --- libbutl/manifest-serializer.mxx | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) (limited to 'libbutl/manifest-serializer.mxx') diff --git a/libbutl/manifest-serializer.mxx b/libbutl/manifest-serializer.mxx index 7df78d5..1b3ace8 100644 --- a/libbutl/manifest-serializer.mxx +++ b/libbutl/manifest-serializer.mxx @@ -56,10 +56,19 @@ LIBBUTL_MODEXPORT namespace butl using filter_function = bool (const std::string& name, const std::string& value); + // Unless long_lines is true, break lines in values (including multi-line) + // so that their length does not exceed 78 characters (including '\n'). + // manifest_serializer (std::ostream& os, const std::string& name, + bool long_lines = false, std::function filter = {}) - : os_ (os), name_ (name), filter_ (std::move (filter)) {} + : os_ (os), + name_ (name), + long_lines_ (long_lines), + filter_ (std::move (filter)) + { + } const std::string& name () const {return name_;} @@ -124,6 +133,7 @@ LIBBUTL_MODEXPORT namespace butl private: std::ostream& os_; const std::string name_; + bool long_lines_; const std::function filter_; }; } -- cgit v1.1