diff options
Diffstat (limited to 'bbot/utility.txx')
-rw-r--r-- | bbot/utility.txx | 25 |
1 files changed, 14 insertions, 11 deletions
diff --git a/bbot/utility.txx b/bbot/utility.txx index 3199a61..d2aad10 100644 --- a/bbot/utility.txx +++ b/bbot/utility.txx @@ -1,12 +1,12 @@ // file : bbot/utility.txx -*- C++ -*- -// license : TBC; see accompanying LICENSE file +// license : MIT; see accompanying LICENSE file #include <iostream> // cin -#include <libbutl/fdstream.mxx> +#include <libbutl/fdstream.hxx> -#include <libbutl/manifest-parser.mxx> -#include <libbutl/manifest-serializer.mxx> +#include <libbutl/manifest-parser.hxx> +#include <libbutl/manifest-serializer.hxx> #include <bbot/diagnostics.hxx> @@ -152,9 +152,11 @@ namespace bbot bool d (f.extension () == "lz4"); - ifdstream ifs (f, (d - ? ifdstream::badbit - : ifdstream::badbit | ifdstream::failbit)); + ifdstream ifs (f, + (d ? fdopen_mode::binary : fdopen_mode::none), + (d + ? ifdstream::badbit + : ifdstream::badbit | ifdstream::failbit)); ilz4stream izs; if (d) @@ -206,7 +208,7 @@ namespace bbot template <typename T> void - serialize_manifest (const T& m, const path& f, const char* what) + serialize_manifest (const T& m, const path& f, const char* what, bool ll) { using namespace std; using namespace butl; @@ -216,7 +218,7 @@ namespace bbot ofdstream ofs (f, fdopen_mode::binary); auto_rmfile arm (f); // Try to remove on failure ignoring errors. - serialize_manifest (m, ofs, f.string (), what, true); + serialize_manifest (m, ofs, f.string (), what, true, ll); ofs.close (); arm.cancel (); @@ -233,13 +235,14 @@ namespace bbot ostream& os, const string& name, const char* what, - bool fh) + bool fh, + bool ll) { using namespace butl; try { - manifest_serializer s (os, name); + manifest_serializer s (os, name, ll); m.serialize (s); return; } |