aboutsummaryrefslogtreecommitdiff
path: root/libbutl/manifest-serializer.mxx
diff options
context:
space:
mode:
authorKaren Arutyunov <karen@codesynthesis.com>2018-12-15 17:23:37 +0300
committerKaren Arutyunov <karen@codesynthesis.com>2018-12-15 17:27:56 +0300
commit3bf1846063ad30ecc0fc90d34490bf70776faef0 (patch)
tree8a2a248be187671f8d9fd75d3367bfb9de782e45 /libbutl/manifest-serializer.mxx
parent5bff24a8862f61e40f827591be5c81228efab4c6 (diff)
Add manifest_rewriter class
Diffstat (limited to 'libbutl/manifest-serializer.mxx')
-rw-r--r--libbutl/manifest-serializer.mxx23
1 files changed, 18 insertions, 5 deletions
diff --git a/libbutl/manifest-serializer.mxx b/libbutl/manifest-serializer.mxx
index a1864d6..66ca398 100644
--- a/libbutl/manifest-serializer.mxx
+++ b/libbutl/manifest-serializer.mxx
@@ -75,15 +75,28 @@ LIBBUTL_MODEXPORT namespace butl
merge_comment (const std::string& value, const std::string& comment);
private:
+ friend class manifest_rewriter;
+
+ // Validate and write a name.
+ //
+ void
+ write_name (const std::string&);
+
+ // Write a value assuming the current line already has the specified
+ // offset. If the resulting line length would be too large then the
+ // multi-line representation will be used. It is assumed that the name,
+ // followed by the colon, is already written.
+ //
void
- check_name (const std::string&);
+ write_value (const std::string&, std::size_t offset);
- // Write 'n' characters from 's' (assuming there are no newlines)
- // split into multiple lines at or near the 78 characters
- // boundary. The first line starts at the 'column' offset.
+ // Write the specified number of characters from the specified string
+ // (assuming there are no newlines) split into multiple lines at or near
+ // the 78 characters boundary. Assume the current line already has the
+ // specified offset.
//
void
- write_value (std::size_t column, const char* s, std::size_t n);
+ write_value (const char* s, std::size_t n, std::size_t offset);
private:
enum {start, body, end} s_ = start;