aboutsummaryrefslogtreecommitdiff
path: root/tests/manifest-roundtrip/driver.cxx
diff options
context:
space:
mode:
authorKaren Arutyunov <karen@codesynthesis.com>2021-11-23 19:24:00 +0300
committerKaren Arutyunov <karen@codesynthesis.com>2021-11-24 13:59:15 +0300
commit405dfa3e28ab71d4f6b5210faba0e3600070a0f3 (patch)
treee2e1de8213968c8b299904b48a60d4914eb1487b /tests/manifest-roundtrip/driver.cxx
parentb90126986fbeec6f42d469e99574096c3f6abc22 (diff)
Add support for new-fashioned multi-line manifest value introducer
Diffstat (limited to 'tests/manifest-roundtrip/driver.cxx')
-rw-r--r--tests/manifest-roundtrip/driver.cxx26
1 files changed, 24 insertions, 2 deletions
diff --git a/tests/manifest-roundtrip/driver.cxx b/tests/manifest-roundtrip/driver.cxx
index 4cf35e9..5dc5862 100644
--- a/tests/manifest-roundtrip/driver.cxx
+++ b/tests/manifest-roundtrip/driver.cxx
@@ -15,17 +15,39 @@
using namespace std;
using namespace butl;
+// Usage: argv[0] [-m]
+//
+// Round-trip a manifest reading it from stdin and printing to stdout.
+//
+// -m
+// Serialize multi-line manifest values using the v2 form.
+//
int
-main ()
+main (int argc, const char* argv[])
try
{
+ bool multiline_v2 (false);
+
+ for (int i (1); i != argc; ++i)
+ {
+ string v (argv[i]);
+
+ if (v == "-m")
+ multiline_v2 = true;
+ }
+
// Read/write in binary mode.
//
stdin_fdmode (fdstream_mode::binary);
stdout_fdmode (fdstream_mode::binary);
manifest_parser p (cin, "stdin");
- manifest_serializer s (cout, "stdout");
+
+ manifest_serializer s (cout,
+ "stdout",
+ false /* long_lines */,
+ {} /* filter */,
+ multiline_v2);
for (bool eom (true), eos (false); !eos; )
{