9#ifndef SQUID_SRC_STORE_PARSINGBUFFER_H
10#define SQUID_SRC_STORE_PARSINGBUFFER_H
99 void print(std::ostream &)
const;
102 const char *
memory()
const;
void consume(size_t)
get rid of previously appended() prefix of a given size
const char * c_str()
a NUL-terminated version of content(); same lifetime as content()
void growSpace(size_t)
makes sure we have the requested number of bytes, allocates enough memory if needed
StoreIOBuffer readerSuppliedMemory_
externally allocated buffer we were seeded with (or a zero-size one)
size_t contentSize() const
the total number of append()ed bytes that were not consume()d
void print(std::ostream &) const
summarizes object state (for debugging)
const char * memory() const
a read-only content start (or nil for some zero-size buffers)
std::optional< SBuf > extraMemory_
StoreIOBuffer content() const
ParsingBuffer()=default
creates buffer without any space or content
SBuf toSBuf() const
export content() into SBuf, avoiding content copying when possible
StoreIOBuffer makeSpace(size_t pageSize)
size_t spaceSize() const
the number of bytes in the space() buffer
size_t capacity() const
the maximum number of bytes we can store without allocating more space
StoreIOBuffer makeInitialSpace()
size_t readerSuppliedMemoryContentSize_
append()ed to readerSuppliedMemory_ bytes that were not consume()d
void appended(const char *, size_t)
remember the new bytes received into the previously provided space()
std::ostream & operator<<(std::ostream &os, const ParsingBuffer &b)