Tkrzw
Public Member Functions | Friends | List of all members
tkrzw::StdIndexStr::Iterator Class Reference

Iterator for each record. More...

#include <tkrzw_index.h>

Public Member Functions

 ~Iterator ()
 Destructor. More...
 
 Iterator (const Iterator &rhs)=delete
 Copy and assignment are disabled. More...
 
Iteratoroperator= (const Iterator &rhs)=delete
 
void First ()
 Initializes the iterator to indicate the first record. More...
 
void Last ()
 Initializes the iterator to indicate the last record. More...
 
void Jump (std::string_view key, std::string_view value="")
 Initializes the iterator to indicate a specific range. More...
 
void Next ()
 Moves the iterator to the next record. More...
 
void Previous ()
 Moves the iterator to the previous record. More...
 
bool Get (std::string *key=nullptr, std::string *value=nullptr)
 Gets the key and the value of the current record of the iterator. More...
 

Friends

class StdIndexStr
 

Detailed Description

Iterator for each record.

Constructor & Destructor Documentation

◆ ~Iterator()

tkrzw::StdIndexStr::Iterator::~Iterator ( )

Destructor.

◆ Iterator()

tkrzw::StdIndexStr::Iterator::Iterator ( const Iterator rhs)
explicitdelete

Copy and assignment are disabled.

Member Function Documentation

◆ First()

void tkrzw::StdIndexStr::Iterator::First ( )

Initializes the iterator to indicate the first record.

◆ Last()

void tkrzw::StdIndexStr::Iterator::Last ( )

Initializes the iterator to indicate the last record.

◆ Jump()

void tkrzw::StdIndexStr::Iterator::Jump ( std::string_view  key,
std::string_view  value = "" 
)

Initializes the iterator to indicate a specific range.

Parameters
keyThe key of the lower bound.
valueThe value of the lower bound.

◆ Next()

void tkrzw::StdIndexStr::Iterator::Next ( )

Moves the iterator to the next record.

◆ Previous()

void tkrzw::StdIndexStr::Iterator::Previous ( )

Moves the iterator to the previous record.

◆ Get()

bool tkrzw::StdIndexStr::Iterator::Get ( std::string *  key = nullptr,
std::string *  value = nullptr 
)

Gets the key and the value of the current record of the iterator.

Parameters
keyThe pointer to a string object to contain the record key. If it is nullptr, the key data is ignored.
valueThe pointer to a string object to contain the record value. If it is nullptr, the value data is ignored.
Returns
True on success or false on failure. If theres no record to fetch, false is returned.