From a31945f682fc69340692680f2736aa74c186ef69 Mon Sep 17 00:00:00 2001 From: Karen Arutyunov Date: Thu, 26 Jul 2018 22:32:59 +0300 Subject: Make manifest serializer to accept non-empty versions for subsequent manifests --- libbutl/manifest-serializer.cxx | 7 +++++-- libbutl/manifest-serializer.mxx | 3 ++- 2 files changed, 7 insertions(+), 3 deletions(-) (limited to 'libbutl') diff --git a/libbutl/manifest-serializer.cxx b/libbutl/manifest-serializer.cxx index 73255b0..3d73f47 100644 --- a/libbutl/manifest-serializer.cxx +++ b/libbutl/manifest-serializer.cxx @@ -76,10 +76,13 @@ namespace butl { if (n.empty ()) { + s_ = start; + + // Start new manifest if the end-of-manifest pair is omitted. + // if (!v.empty ()) - throw serialization (name_, "non-empty value in end pair"); + return next (n, v); - s_ = start; break; } diff --git a/libbutl/manifest-serializer.mxx b/libbutl/manifest-serializer.mxx index e063f17..a1864d6 100644 --- a/libbutl/manifest-serializer.mxx +++ b/libbutl/manifest-serializer.mxx @@ -55,7 +55,8 @@ LIBBUTL_MODEXPORT namespace butl // with empty name and value. After that we can either have another // start-of-manifest pair (in which case the whole sequence repeats // from the beginning) or we get another end-of-manifest pair which - // signals the end of stream. + // signals the end of stream. The end-of-manifest pair can be omitted + // if it is followed by the start-of-manifest pair. // void next (const std::string& name, const std::string& value); -- cgit v1.1