38 lines
660 B
C++
38 lines
660 B
C++
//
|
|
// Created by Kirill Zhukov on 20.04.2025.
|
|
//
|
|
|
|
#ifndef RECOVERYLOG_H
|
|
#define RECOVERYLOG_H
|
|
|
|
#include <fstream>
|
|
#include <iostream>
|
|
#include <string>
|
|
|
|
namespace usub::utils
|
|
{
|
|
class RecoveryLog
|
|
{
|
|
public:
|
|
explicit RecoveryLog(const std::string& dbname);
|
|
|
|
~RecoveryLog();
|
|
|
|
void log_put(const std::string& key, const std::string& value);
|
|
|
|
void log_delete(const std::string& key);
|
|
|
|
private:
|
|
void ensure_metadata_dir();
|
|
|
|
private:
|
|
std::string db_name;
|
|
std::string metadata_dir;
|
|
std::string log_file;
|
|
std::ofstream log_out;
|
|
};
|
|
} // utils
|
|
// usub
|
|
|
|
#endif //RECOVERYLOG_H
|