PROF_stop(MemBuf_consume);
}
+/// removes all whitespace prefix bytes and "packs" by moving content left
+void MemBuf::consumeWhitespace()
+{
+ PROF_start(MemBuf_consumeWhitespace);
+ const char *end = buf + contentSize();
+ const char *p = buf;
+ for(; p<=end && xisspace(*p); ++p);
+ if (p-buf > 0)
+ consume(p-buf);
+ PROF_stop(MemBuf_consumeWhitespace);
+}
+
// removes last tailSize bytes
void MemBuf::truncate(mb_size_t tailSize)
{
/// \note there is currently no stretch() method to grow without appending
void consume(mb_size_t sz); // removes sz bytes, moving content left
+ void consumeWhitespace(); // removes all prefix whitespace, moving content left
+
void append(const char *c, mb_size_t sz); // grows if needed and possible
void appended(mb_size_t sz); // updates content size after external append
void truncate(mb_size_t sz); // removes sz last bytes