diff options
Diffstat (limited to 'libbutl/manifest-serializer.cxx')
-rw-r--r-- | libbutl/manifest-serializer.cxx | 25 |
1 files changed, 25 insertions, 0 deletions
diff --git a/libbutl/manifest-serializer.cxx b/libbutl/manifest-serializer.cxx index adb7f13..d8f640b 100644 --- a/libbutl/manifest-serializer.cxx +++ b/libbutl/manifest-serializer.cxx @@ -133,6 +133,31 @@ namespace butl os_ << endl; } + string manifest_serializer:: + merge_comment (const string& value, const string& comment) + { + string r; + for (char c: value) + { + // Escape ';' character. + // + if (c == ';') + r += '\\'; + + r += c; + } + + // Add the comment. + // + if (!comment.empty ()) + { + r += "; "; + r += comment; + } + + return r; + } + void manifest_serializer:: check_name (const string& n) { |