mirror of
https://github.com/PurpleI2P/i2pd.git
synced 2025-04-28 03:37:49 +02:00
use std::filesystem for C++17
This commit is contained in:
parent
3ff79038b5
commit
ae309ca632
3 changed files with 73 additions and 46 deletions
|
@ -1,5 +1,5 @@
|
|||
/*
|
||||
* Copyright (c) 2013-2023, The PurpleI2P Project
|
||||
* Copyright (c) 2013-2024, The PurpleI2P Project
|
||||
*
|
||||
* This file is part of Purple i2pd project and licensed under BSD3
|
||||
*
|
||||
|
@ -15,7 +15,6 @@
|
|||
#include <condition_variable>
|
||||
#include <openssl/rand.h>
|
||||
#include <boost/algorithm/string.hpp>
|
||||
#include <boost/filesystem.hpp>
|
||||
#include "Base.h"
|
||||
#include "util.h"
|
||||
#include "Identity.h"
|
||||
|
@ -27,6 +26,14 @@
|
|||
#include "AddressBook.h"
|
||||
#include "Config.h"
|
||||
|
||||
#if STD_FILESYSTEM
|
||||
#include <filesystem>
|
||||
namespace fs_lib = std::filesystem;
|
||||
#else
|
||||
#include <boost/filesystem.hpp>
|
||||
namespace fs_lib = boost::filesystem;
|
||||
#endif
|
||||
|
||||
namespace i2p
|
||||
{
|
||||
namespace client
|
||||
|
@ -266,11 +273,11 @@ namespace client
|
|||
void AddressBookFilesystemStorage::ResetEtags ()
|
||||
{
|
||||
LogPrint (eLogError, "Addressbook: Resetting eTags");
|
||||
for (boost::filesystem::directory_iterator it (etagsPath); it != boost::filesystem::directory_iterator (); ++it)
|
||||
for (fs_lib::directory_iterator it (etagsPath); it != fs_lib::directory_iterator (); ++it)
|
||||
{
|
||||
if (!boost::filesystem::is_regular_file (it->status ()))
|
||||
if (!fs_lib::is_regular_file (it->status ()))
|
||||
continue;
|
||||
boost::filesystem::remove (it->path ());
|
||||
fs_lib::remove (it->path ());
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue