0.9.8.10
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Modules Pages
Public Member Functions | Private Member Functions | Private Attributes | List of all members
Hypertable::StringCompressorPrefix Class Reference

A class to prefix-compress strings. More...

#include <StringCompressorPrefix.h>

Collaboration diagram for Hypertable::StringCompressorPrefix:
Collaboration graph
[legend]

Public Member Functions

virtual void reset ()
 Clears the internal state. More...
 
virtual void add (const char *str)
 Adds (and compresses) a string. More...
 
virtual size_t length () const
 Retrieves the length of the compressed string. More...
 
virtual size_t length_uncompressed () const
 Retrieves the length of the uncompressed string. More...
 
virtual void write (uint8_t *buf) const
 Writes the compressed string to a buffer. More...
 
virtual void write_uncompressed (uint8_t *buf) const
 Writes the uncompressed string to a buffer. More...
 

Private Member Functions

size_t get_prefix_length (const char *str, size_t len) const
 Helper function returning the prefix length of a new string. More...
 

Private Attributes

size_t m_compressed_len
 Length of the compressed string. More...
 
size_t m_uncompressed_len
 Length of the uncompressed string. More...
 
String m_last_string
 The previously added (uncompressed) string. More...
 
DynamicBuffer m_compressed_string
 Dynamic array holding the compressed string. More...
 

Detailed Description

A class to prefix-compress strings.

Definition at line 43 of file StringCompressorPrefix.h.

Member Function Documentation

virtual void Hypertable::StringCompressorPrefix::add ( const char *  str)
inlinevirtual

Adds (and compresses) a string.

Keeps a copy of the uncompressed string for the next invocation of this function. The compressed string can be retrieved with write.

Parameters
strA null-terminated string to compress

Definition at line 57 of file StringCompressorPrefix.h.

size_t Hypertable::StringCompressorPrefix::get_prefix_length ( const char *  str,
size_t  len 
) const
inlineprivate

Helper function returning the prefix length of a new string.

Definition at line 102 of file StringCompressorPrefix.h.

virtual size_t Hypertable::StringCompressorPrefix::length ( ) const
inlinevirtual

Retrieves the length of the compressed string.

Definition at line 79 of file StringCompressorPrefix.h.

virtual size_t Hypertable::StringCompressorPrefix::length_uncompressed ( ) const
inlinevirtual

Retrieves the length of the uncompressed string.

Definition at line 84 of file StringCompressorPrefix.h.

virtual void Hypertable::StringCompressorPrefix::reset ( )
inlinevirtual

Clears the internal state.

Definition at line 46 of file StringCompressorPrefix.h.

virtual void Hypertable::StringCompressorPrefix::write ( uint8_t *  buf) const
inlinevirtual

Writes the compressed string to a buffer.

Definition at line 89 of file StringCompressorPrefix.h.

virtual void Hypertable::StringCompressorPrefix::write_uncompressed ( uint8_t *  buf) const
inlinevirtual

Writes the uncompressed string to a buffer.

Definition at line 94 of file StringCompressorPrefix.h.

Member Data Documentation

size_t Hypertable::StringCompressorPrefix::m_compressed_len
private

Length of the compressed string.

Definition at line 113 of file StringCompressorPrefix.h.

DynamicBuffer Hypertable::StringCompressorPrefix::m_compressed_string
private

Dynamic array holding the compressed string.

Definition at line 122 of file StringCompressorPrefix.h.

String Hypertable::StringCompressorPrefix::m_last_string
private

The previously added (uncompressed) string.

Definition at line 119 of file StringCompressorPrefix.h.

size_t Hypertable::StringCompressorPrefix::m_uncompressed_len
private

Length of the uncompressed string.

Definition at line 116 of file StringCompressorPrefix.h.


The documentation for this class was generated from the following file: