Skip to content

Commit

Permalink
Fix build with boost-1.85 (filesystem api v4 removed Deprecated Featu…
Browse files Browse the repository at this point in the history
  • Loading branch information
dekeonus authored and ConiKost committed Jul 16, 2024
1 parent a7e76f9 commit 769a7cc
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 10 deletions.
4 changes: 2 additions & 2 deletions plugin/cpp/Util.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ void createDirectories(Transport::Config *config, const boost::filesystem::path&
}

// First create branch, by calling ourself recursively
createDirectories(config, ph.branch_path());
createDirectories(config, ph.parent_path());

// Now that parent's path exists, create the directory
create_directory(ph);
Expand Down Expand Up @@ -89,7 +89,7 @@ void removeEverythingOlderThan(const std::vector<std::string> &dirs, time_t t) {
for (directory_iterator itr(p); itr != end_itr; ++itr) {
if (last_write_time(itr->path()) < t) {
try {
if (is_regular(itr->path())) {
if (is_regular_file(itr->path())) {
remove(itr->path());
}
else if (is_directory(itr->path())) {
Expand Down
2 changes: 1 addition & 1 deletion spectrum/src/main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -147,7 +147,7 @@ static void _createDirectories(Transport::Config *config, boost::filesystem::pat
}

// First create branch, by calling ourself recursively
_createDirectories(config, ph.branch_path());
_createDirectories(config, ph.parent_path());

// Now that parent's path exists, create the directory
boost::filesystem::create_directory(ph);
Expand Down
14 changes: 7 additions & 7 deletions spectrum_manager/src/methods.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -168,7 +168,7 @@ int start_instances(ManagerConfig *config, const std::string &_jid) {

directory_iterator end_itr;
for (directory_iterator itr(p); itr != end_itr; ++itr) {
if (is_regular(itr->path()) && extension(itr->path()) == ".cfg") {
if (is_regular_file(itr->path()) && itr->path().extension().string() == ".cfg") {
Config cfg;
if (cfg.load(itr->path().string()) == false) {
std::cerr << "Can't load config file " << itr->path().string() << ". Skipping...\n";
Expand Down Expand Up @@ -232,7 +232,7 @@ void stop_instances(ManagerConfig *config, const std::string &_jid) {

directory_iterator end_itr;
for (directory_iterator itr(p); itr != end_itr; ++itr) {
if (is_regular(itr->path()) && extension(itr->path()) == ".cfg") {
if (is_regular_file(itr->path()) && itr->path().extension().string() == ".cfg") {
Config cfg;
if (cfg.load(itr->path().string()) == false) {
std::cerr << "Can't load config file " << itr->path().string() << ". Skipping...\n";
Expand Down Expand Up @@ -315,7 +315,7 @@ int restart_instances(ManagerConfig *config, const std::string &_jid) {

directory_iterator end_itr;
for (directory_iterator itr(p); itr != end_itr; ++itr) {
if (is_regular(itr->path()) && extension(itr->path()) == ".cfg") {
if (is_regular_file(itr->path()) && itr->path().extension().string() == ".cfg") {
Config cfg;
if (cfg.load(itr->path().string()) == false) {
std::cerr << "Can't load config file " << itr->path().string() << ". Skipping...\n";
Expand Down Expand Up @@ -401,7 +401,7 @@ int show_status(ManagerConfig *config) {

directory_iterator end_itr;
for (directory_iterator itr(p); itr != end_itr; ++itr) {
if (is_regular(itr->path()) && extension(itr->path()) == ".cfg") {
if (is_regular_file(itr->path()) && itr->path().extension().string() == ".cfg") {
Config cfg;
if (cfg.load(itr->path().string()) == false) {
std::cerr << "Can't load config file " << itr->path().string() << ". Skipping...\n";
Expand Down Expand Up @@ -531,7 +531,7 @@ std::string get_config(ManagerConfig *config, const std::string &jid, const std:

directory_iterator end_itr;
for (directory_iterator itr(p); itr != end_itr; ++itr) {
if (is_regular(itr->path()) && extension(itr->path()) == ".cfg") {
if (is_regular_file(itr->path()) && itr->path().extension().string() == ".cfg") {
Config cfg;
if (cfg.load(itr->path().string()) == false) {
std::cerr << "Can't load config file " << itr->path().string() << ". Skipping...\n";
Expand Down Expand Up @@ -572,7 +572,7 @@ void ask_local_server(ManagerConfig *config, Swift::BoostNetworkFactories &netwo
bool found = false;
directory_iterator end_itr;
for (directory_iterator itr(p); itr != end_itr; ++itr) {
if (is_regular(itr->path()) && extension(itr->path()) == ".cfg") {
if (is_regular_file(itr->path()) && itr->path().extension().string() == ".cfg") {
Config cfg;
if (cfg.load(itr->path().string()) == false) {
std::cerr << "Can't load config file " << itr->path().string() << ". Skipping...\n";
Expand Down Expand Up @@ -619,7 +619,7 @@ std::vector<std::string> show_list(ManagerConfig *config, bool show) {

directory_iterator end_itr;
for (directory_iterator itr(p); itr != end_itr; ++itr) {
if (is_regular(itr->path()) && extension(itr->path()) == ".cfg") {
if (is_regular_file(itr->path()) && itr->path().extension().string() == ".cfg") {
Config cfg;
if (cfg.load(itr->path().string()) == false) {
std::cerr << "Can't load config file " << itr->path().string() << ". Skipping...\n";
Expand Down

0 comments on commit 769a7cc

Please sign in to comment.