This is an automated email from the git hooks/post-receive script.

guillem pushed a commit to branch main
in repository dpkg.

View the commit online:
https://git.dpkg.org/cgit/dpkg/dpkg.git/commit/?id=f259b414d701c4d5996227a1612a56c94e90585c

commit f259b414d701c4d5996227a1612a56c94e90585c
Author: Guillem Jover <[email protected]>
AuthorDate: Tue Jul 23 02:34:46 2024 +0200

    libdpkg: Add new varbuf C++ operator+= methods
---
 lib/dpkg/varbuf.h | 24 ++++++++++++++++++++++++
 1 file changed, 24 insertions(+)

diff --git a/lib/dpkg/varbuf.h b/lib/dpkg/varbuf.h
index e27f0d19e..088d4b9f7 100644
--- a/lib/dpkg/varbuf.h
+++ b/lib/dpkg/varbuf.h
@@ -99,6 +99,9 @@ struct varbuf {
        void trim_prefix(varbuf &prefix);
        void trim_prefix(int prefix);
 
+       varbuf &operator+=(const varbuf &v);
+       varbuf &operator+=(int c);
+       varbuf &operator+=(const char *str);
        void operator()(int c);
        void operator()(const char *s);
        const char *str();
@@ -362,6 +365,27 @@ varbuf::trim_prefix(int prefix)
        varbuf_trim_char_prefix(this, prefix);
 }
 
+inline varbuf &
+varbuf::operator+=(const varbuf &v)
+{
+       varbuf_add_varbuf(this, &v);
+       return *this;
+}
+
+inline varbuf &
+varbuf::operator+=(int c)
+{
+       varbuf_add_char(this, c);
+       return *this;
+}
+
+inline varbuf &
+varbuf::operator+=(const char *str)
+{
+       varbuf_add_str(this, str);
+       return *this;
+}
+
 inline void
 varbuf::operator()(int c)
 {

-- 
Dpkg.Org's dpkg

Reply via email to