aboutsummaryrefslogtreecommitdiff
path: root/libbutl/manifest-serializer.mxx
diff options
context:
space:
mode:
authorKaren Arutyunov <karen@codesynthesis.com>2019-04-18 20:15:46 +0300
committerKaren Arutyunov <karen@codesynthesis.com>2019-04-25 19:43:36 +0300
commit276f68ee4d55befa8922378199b4281c82d4fd93 (patch)
treeaf1c1b94fddec588feefe79a86e6463094ba2d8e /libbutl/manifest-serializer.mxx
parent7a1c91dbdbde1c4feeaa701592365bb4b7cf2562 (diff)
Add parse_manifest() and serialize_manifest() functions
Diffstat (limited to 'libbutl/manifest-serializer.mxx')
-rw-r--r--libbutl/manifest-serializer.mxx13
1 files changed, 13 insertions, 0 deletions
diff --git a/libbutl/manifest-serializer.mxx b/libbutl/manifest-serializer.mxx
index 1b3ace8..2a8d32e 100644
--- a/libbutl/manifest-serializer.mxx
+++ b/libbutl/manifest-serializer.mxx
@@ -10,6 +10,7 @@
#ifndef __cpp_lib_modules
#include <string>
+#include <vector>
#include <iosfwd>
#include <cstddef> // size_t
#include <stdexcept> // runtime_error
@@ -24,6 +25,9 @@ export module butl.manifest_serializer;
import std.core;
import std.io;
#endif
+import butl.manifest_types;
+#else
+#include <libbutl/manifest-types.mxx>
#endif
#include <libbutl/export.hxx>
@@ -136,6 +140,15 @@ LIBBUTL_MODEXPORT namespace butl
bool long_lines_;
const std::function<filter_function> filter_;
};
+
+ // Serialize a manifest to a stream adding the leading format version pair
+ // and the trailing end-of-manifest pair. Unless eos is false, then also
+ // write the end-of-stream pair.
+ //
+ LIBBUTL_SYMEXPORT void
+ serialize_manifest (manifest_serializer&,
+ const std::vector<manifest_name_value>&,
+ bool eos = true);
}
#include <libbutl/manifest-serializer.ixx>