Skip to content

Commit

Permalink
Use std::filesystem in PersistentStore module
Browse files Browse the repository at this point in the history
Signed-off-by: Kai-Uwe Hermann <[email protected]>
  • Loading branch information
hikinggrass committed Sep 26, 2023
1 parent e5d8434 commit 59688b0
Showing 1 changed file with 7 additions and 6 deletions.
13 changes: 7 additions & 6 deletions modules/PersistentStore/main/kvsImpl.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -3,18 +3,19 @@

#include "kvsImpl.hpp"

#include <boost/filesystem.hpp>
#include <filesystem>

namespace fs = std::filesystem;

namespace module {
namespace main {

void kvsImpl::init() {
// open and initialize database
boost::filesystem::path sqlite_db_path =
boost::filesystem::absolute(boost::filesystem::path(mod->config.sqlite_db_file_path));
boost::filesystem::path database_directory = sqlite_db_path.parent_path();
if (!boost::filesystem::exists(database_directory)) {
boost::filesystem::create_directories(database_directory);
fs::path sqlite_db_path = fs::absolute(fs::path(mod->config.sqlite_db_file_path));
fs::path database_directory = sqlite_db_path.parent_path();
if (!fs::exists(database_directory)) {
fs::create_directories(database_directory);
}

int ret = sqlite3_open(sqlite_db_path.c_str(), &this->db);
Expand Down

0 comments on commit 59688b0

Please sign in to comment.