Simplify use of GroupVarint* for the case where data is available one entry at a time (instead of one group at a time). Handles buffering and an incomplete last chunk.
Declared in <folly/GroupVarint.h>
template<
class T,
class Output>
class GroupVarintEncoder;
Output is a function object that accepts character ranges: out(StringPiece) appends the given character range to the output.
| Name | Description |
|---|---|
Base | The underlying GroupVarint codec for values of type T. |
type | The value type being encoded. |
| Name | Description |
|---|---|
GroupVarintEncoder [constructor] | Construct an encoder that writes encoded output through out. |
~GroupVarintEncoder [destructor] | Destroy the encoder, flushing any buffered values. |
add | Add a value to the encoder. |
clear | Reset the encoder, disregarding any state (except what was already flushed to the output, of course). |
finish | Finish encoding, flushing any buffered values if necessary. After finish(), the encoder is immediately ready to encode more data to the same output. |
output | Return the appender that was used. |