[squid-dev] [PATCH] SBuf API improvements

Kinkie gkinkie at gmail.com
Mon Dec 28 13:41:47 UTC 2015


Hi all,
  the attached patch is a proposal for a couple of small extensions to
SBuf, which are meant to make it more API-compatible with std::string.

- it adds a "fill" operator: append(size_type n, char c)
- it aliases append(char) to push_back(char)
- it aliases reserveCapacity to reserve

Also a small fix:
- it marks the const begin() and end() methods as such

It is debateable whether reserveCapacity should be just renamed
instead of aliased; feedback is welcome.

The objective of this change will be clear in the followup rfc3986
patch, which is templatized in order to be available both to helpers
who use std::string and to squid using SBuf.

-- 
    Francesco
-------------- next part --------------
A non-text attachment was scrubbed...
Name: sbuf-improvements.patch
Type: text/x-diff
Size: 6728 bytes
Desc: not available
URL: <http://lists.squid-cache.org/pipermail/squid-dev/attachments/20151228/3c9c288e/attachment.patch>


More information about the squid-dev mailing list