aboutsummaryrefslogtreecommitdiff
path: root/libbutl/manifest-serializer.mxx
diff options
context:
space:
mode:
authorKaren Arutyunov <karen@codesynthesis.com>2019-04-06 23:47:48 +0300
committerKaren Arutyunov <karen@codesynthesis.com>2019-04-08 16:51:41 +0300
commita16982956c5e87d9b2f238522d902df177ece98e (patch)
tree71f049508596a2004b872d8b5fbdeaf473148696 /libbutl/manifest-serializer.mxx
parent89659b66de7611e9a3f33e7354493ac1c540fe70 (diff)
Add support for manifest_serializer long lines mode
Diffstat (limited to 'libbutl/manifest-serializer.mxx')
-rw-r--r--libbutl/manifest-serializer.mxx12
1 files changed, 11 insertions, 1 deletions
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_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_function> filter_;
};
}