9#ifndef SQUID_SRC_PARSER_TOKENIZER_H
10#define SQUID_SRC_PARSER_TOKENIZER_H
104 bool skip(
const char tokenChar);
optimized set of C chars, with quick membership test and merge support
SBuf::size_type skipAllTrailing(const CharacterSet &discardables)
bool prefix(SBuf &returnedToken, const CharacterSet &tokenChars, SBuf::size_type limit=SBuf::npos)
SBuf buf_
yet unparsed input
bool suffix(SBuf &returnedToken, const CharacterSet &tokenChars, SBuf::size_type limit=SBuf::npos)
SBuf::size_type successTrailing(const SBuf::size_type n)
convenience method: consumes up to n last bytes and returns their count
bool skipOne(const CharacterSet &discardables)
bool token(SBuf &returnedToken, const CharacterSet &delimiters)
SBuf consumeTrailing(const SBuf::size_type n)
convenience method: consumes up to n last bytes and returns them
SBuf::size_type success(const SBuf::size_type n)
convenience method: consume()s up to n bytes and returns their count
void reset(const SBuf &newBuf)
reinitialize processing for a new buffer
void undoParse(const SBuf &newBuf, SBuf::size_type cParsed)
reset the buffer and parsed stats to a saved checkpoint
bool skipSuffix(const SBuf &tokenToSkip)
SBuf::size_type skipAll(const CharacterSet &discardables)
bool int64(int64_t &result, int base=0, bool allowSign=true, SBuf::size_type limit=SBuf::npos)
SBuf::size_type parsedSize() const
number of parsed bytes, including skipped ones
SBuf consume(const SBuf::size_type n)
convenience method: consumes up to n bytes, counts, and returns them
SBuf buf() const
yet unparsed data
Tokenizer(const SBuf &inBuf)
const SBuf & remaining() const
the remaining unprocessed section of buffer
bool skipOneTrailing(const CharacterSet &discardables)
void skipRequired(const char *description, const SBuf &tokenToSkip)
bool atEnd() const
whether the end of the buffer has been reached
SBuf::size_type parsed_
bytes successfully parsed, including skipped
int64_t udec64(const char *description, SBuf::size_type limit=SBuf::npos)
int64() wrapper but limited to unsigned decimal integers (for now)
bool skip(const SBuf &tokenToSkip)
static const size_type npos
MemBlob::size_type size_type
Generic protocol-agnostic parsing tools.