DBM update logger to store logs into a string deque.
More...
#include <tkrzw_dbm_ulog.h>
DBM update logger to store logs into a string deque.
◆ DBMUpdateLoggerStrDeque()
tkrzw::DBMUpdateLoggerStrDeque::DBMUpdateLoggerStrDeque |
( |
const std::string & |
delim = "\t" | ) |
|
|
explicit |
Constructor.
- Parameters
-
delim | The delimiter put between fields in a log. |
◆ WriteSet()
Status tkrzw::DBMUpdateLoggerStrDeque::WriteSet |
( |
std::string_view |
key, |
|
|
std::string_view |
value |
|
) |
| |
|
overridevirtual |
Writes a log for modifying an existing record or adding a new record.
- Parameters
-
key | The key of the record. |
value | The new value of the record. |
- Returns
- The result status.
Implements tkrzw::DBM::UpdateLogger.
◆ WriteRemove()
Status tkrzw::DBMUpdateLoggerStrDeque::WriteRemove |
( |
std::string_view |
key | ) |
|
|
overridevirtual |
Writes a log for removing an existing record.
- Parameters
-
key | The key of the record. |
- Returns
- The result status.
Implements tkrzw::DBM::UpdateLogger.
◆ WriteClear()
Status tkrzw::DBMUpdateLoggerStrDeque::WriteClear |
( |
| ) |
|
|
overridevirtual |
◆ GetSize()
int64_t tkrzw::DBMUpdateLoggerStrDeque::GetSize |
( |
| ) |
|
Gets the number of logs.
- Returns
- The number of logs.
◆ PopFront()
bool tkrzw::DBMUpdateLoggerStrDeque::PopFront |
( |
std::string * |
text | ) |
|
Gets the first log in the queue and removes it.
- Parameters
-
text | The pointer to a string object to store the result. If it is nullptr, assignment is not done. |
- Returns
- True on success or false if there's no log in the queue.
◆ PopBack()
bool tkrzw::DBMUpdateLoggerStrDeque::PopBack |
( |
std::string * |
text | ) |
|
Gets the last log in the queue and removes it.
- Parameters
-
text | The pointer to a string object to store the result. If it is nullptr, assignment is not done. |
- Returns
- True on success or false if there's no log in the queue.
◆ Clear()
void tkrzw::DBMUpdateLoggerStrDeque::Clear |
( |
| ) |
|