mdds
Public Types | Static Public Member Functions | List of all members
mdds::trie::std_string_trait Struct Reference

#include <trie_map.hpp>

Public Types

typedef std::string string_type
 
typedef std::string buffer_type
 
typedef char char_type
 

Static Public Member Functions

static buffer_type init_buffer (const char_type *str, size_t length)
 
static void push_back (buffer_type &buffer, char_type c)
 
static void pop_back (buffer_type &buffer)
 
static string_type to_string (const buffer_type &buf)
 

Detailed Description

String trait that uses std::string as the key type. This trait can be used with mdds::trie_map or mdds::packed_trie_map.

Member Typedef Documentation

type used to build an intermediate string value, from which a final string object is to be created.

type that represents a single character inside a string or a buffer object. A string object is expected to store a series of characters of this type.

type used to store a final string content.

Member Function Documentation

static buffer_type mdds::trie::std_string_trait::init_buffer ( const char_type str,
size_t  length 
)
inlinestatic

Function called to create and initialize a buffer object from a given initial string value.

Parameters
strpointer to the first character of string value.
lengthlength of the string value.
Returns
buffer object containing the specified string value.
static void mdds::trie::std_string_trait::pop_back ( buffer_type buffer)
inlinestatic

Function called to remove a single character from the tail of an existing string buffer.

Parameters
bufferbuffer object to remove character from.
static void mdds::trie::std_string_trait::push_back ( buffer_type buffer,
char_type  c 
)
inlinestatic

Function called to append a single character to the end of a string buffer.

Parameters
bufferbuffer object to append character to.
ccharacter to append to the buffer.
static string_type mdds::trie::std_string_trait::to_string ( const buffer_type buf)
inlinestatic

Function called to create a final string object from an existing buffer.

Parameters
bufbuffer object to create a final string object from.
Returns
string object whose content is created from the buffer object.