diff options
Diffstat (limited to 'libbutl/manifest-rewriter.cxx')
-rw-r--r-- | libbutl/manifest-rewriter.cxx | 44 |
1 files changed, 7 insertions, 37 deletions
diff --git a/libbutl/manifest-rewriter.cxx b/libbutl/manifest-rewriter.cxx index 46bf239..1232e9c 100644 --- a/libbutl/manifest-rewriter.cxx +++ b/libbutl/manifest-rewriter.cxx @@ -1,41 +1,15 @@ // file : libbutl/manifest-rewriter.cxx -*- C++ -*- // license : MIT; see accompanying LICENSE file -#ifndef __cpp_modules_ts -#include <libbutl/manifest-rewriter.mxx> -#endif +#include <libbutl/manifest-rewriter.hxx> -#include <cassert> - -// C includes. - -#ifndef __cpp_lib_modules_ts #include <string> +#include <cassert> #include <cstdint> // uint64_t #include <cstddef> // size_t -#endif - -// Other includes. - -#ifdef __cpp_modules_ts -module butl.manifest_rewriter; - -// Only imports additional to interface. -#ifdef __clang__ -#ifdef __cpp_lib_modules_ts -import std.core; -#endif -import butl.path; -import butl.fdstream; -import butl.manifest_types; -#endif - -import butl.utility; // utf8_length() -import butl.manifest_serializer; -#else -#include <libbutl/utility.mxx> -#include <libbutl/manifest-serializer.mxx> -#endif + +#include <libbutl/utility.hxx> // utf8_length() +#include <libbutl/manifest-serializer.hxx> using namespace std; @@ -99,8 +73,6 @@ namespace butl if (!nv.value.empty ()) { - os << ' '; - manifest_serializer s (os, path_.string (), long_lines_); // Note that the name can be surrounded with the ASCII whitespace @@ -112,7 +84,7 @@ namespace butl // s.write_value (nv.value, static_cast<size_t> (nv.colon_pos - nv.start_pos) - - (nv.name.size () - utf8_length (nv.name)) + 2); + (nv.name.size () - utf8_length (nv.name)) + 1); } os << suffix; @@ -144,15 +116,13 @@ namespace butl if (!nv.value.empty ()) { - os << ' '; - // Note that the name can be surrounded with the ASCII whitespace // characters and the start_pos refers to the first character in the // line. // s.write_value (nv.value, static_cast<size_t> (nv.colon_pos - nv.start_pos) - - (nv.name.size () - n) + 2); + (nv.name.size () - n) + 1); } os << suffix; |