27 #ifndef Common_StringDecompressorPrefix_h
28 #define Common_StringDecompressorPrefix_h
60 virtual const uint8_t *
add(
const uint8_t *next_base) {
62 const uint8_t *next_ptr = next_base;
65 size_t suffix_len = strlen((
const char *)next_ptr);
66 str.append((
const char *)next_ptr);
68 const uint8_t *next = next_ptr + suffix_len + 1;
70 return (next_ptr + suffix_len + 1);
100 #endif // Common_StringDecompressorPrefix_h
virtual size_t length() const
Returns the length of the compressed string.
std::string String
A String is simply a typedef to std::string.
A class to decompress prefix-compressed strings.
Po::typed_value< String > * str(String *v=0)
virtual const uint8_t * add(const uint8_t *next_base)
Adds (and decompresses) a compressed string.
size_t m_compressed_len
Length of the compressed string.
virtual void reset()
Resets and clears the internal state.
String m_last_string
The uncompressed string; use load to retrieve it.
StringDecompressorPrefix()
Constructor; creates a new decompressor.
virtual void load(String &str) const
Returns the uncompressed string.
A String class based on std::string.
uint32_t decode_vi32(const uint8_t **bufp, size_t *remainp)
Decode a variable length encoded integer up to 32-bit.
virtual size_t length_uncompressed() const
Returns the length of the uncompressed string.