Steal another bufferlist's content and prepend it to our own.
Signed-off-by: Sage Weil <sage@inktank.com>
bl.last_p = bl.begin();
}
+ void buffer::list::claim_prepend(list& bl)
+ {
+ // steal the other guy's buffers
+ _len += bl._len;
+ _buffers.splice( _buffers.begin(), bl._buffers );
+ bl._len = 0;
+ bl.last_p = bl.begin();
+ }
void buffer::list::copy(unsigned off, unsigned len, char *dest) const
{
// sort-of-like-assignment-op
void claim(list& bl);
void claim_append(list& bl);
+ void claim_prepend(list& bl);
iterator begin() {
return iterator(this, 0);