Kyoto Cabinet
Public Member Functions
kyotocabinet::TinyArrayList Class Reference

Memory-saving string array list. More...

#include <kcmap.h>

List of all members.

Public Member Functions

 TinyArrayList ()
 Default constructor.
 ~TinyArrayList ()
 Destructor.
void push (const char *buf, size_t size)
 Insert a record at the bottom of the list.
bool pop ()
 Remove a record at the bottom of the list.
void unshift (const char *buf, size_t size)
 Insert a record at the top of the list.
bool shift ()
 Remove a record at the top of the list.
void insert (const char *buf, size_t size, size_t idx)
 Insert a record at the position of the given index of the list.
void remove (size_t idx)
 Remove a record at the position of the given index of the list.
const char * get (size_t idx, size_t *sp)
 Retrieve a record at the position of the given index of the list.
void clear ()
 Remove all records.
size_t count ()
 Get the number of records.

Detailed Description

Memory-saving string array list.


Constructor & Destructor Documentation

Default constructor.

Destructor.


Member Function Documentation

void kyotocabinet::TinyArrayList::push ( const char *  buf,
size_t  size 
)

Insert a record at the bottom of the list.

Parameters:
bufthe pointer to the record region.
sizethe size of the record region.

Remove a record at the bottom of the list.

Returns:
true if the operation success, or false if there is no record in the list.
void kyotocabinet::TinyArrayList::unshift ( const char *  buf,
size_t  size 
)

Insert a record at the top of the list.

Parameters:
bufthe pointer to the record region.
sizethe size of the record region.

Remove a record at the top of the list.

Returns:
true if the operation success, or false if there is no record in the list.
void kyotocabinet::TinyArrayList::insert ( const char *  buf,
size_t  size,
size_t  idx 
)

Insert a record at the position of the given index of the list.

Parameters:
bufthe pointer to the record region.
sizethe size of the record region.
idxthe index of the position. It must be equal to or less than the number of records.

Remove a record at the position of the given index of the list.

Parameters:
idxthe index of the position. It must be less than the number of records.
const char* kyotocabinet::TinyArrayList::get ( size_t  idx,
size_t *  sp 
)

Retrieve a record at the position of the given index of the list.

Parameters:
idxthe index of the position. It must be less than the number of records.
spthe pointer to the variable into which the size of the region of the return value is assigned.
Returns:
the pointer to the region of the retrieved record.

Remove all records.

Get the number of records.

Returns:
the number of records.