From 179b29252d8bb28e11686a1852c8e8ffcd98ecc0 Mon Sep 17 00:00:00 2001 From: Rye Date: Tue, 11 Feb 2025 05:02:45 -0500 Subject: Rework windows to use zc:wchar_t for better c++ conformance and compatibility with modern libraries --- indra/llfilesystem/lldir.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'indra/llfilesystem/lldir.cpp') diff --git a/indra/llfilesystem/lldir.cpp b/indra/llfilesystem/lldir.cpp index 99d4850610..9c61c25ada 100644 --- a/indra/llfilesystem/lldir.cpp +++ b/indra/llfilesystem/lldir.cpp @@ -103,7 +103,7 @@ std::vector LLDir::getFilesInDir(const std::string &dirname) //Returns a vector of fullpath filenames. #ifdef LL_WINDOWS // or BOOST_WINDOWS_API - boost::filesystem::path p(utf8str_to_utf16str(dirname)); + boost::filesystem::path p(ll_convert(dirname)); #else boost::filesystem::path p(dirname); #endif @@ -196,7 +196,7 @@ U32 LLDir::deleteDirAndContents(const std::string& dir_name) try { #ifdef LL_WINDOWS // or BOOST_WINDOWS_API - boost::filesystem::path dir_path(utf8str_to_utf16str(dir_name)); + boost::filesystem::path dir_path(ll_convert(dir_name)); #else boost::filesystem::path dir_path(dir_name); #endif -- cgit v1.2.3 From 94e45ca2e60b4013a4e38d8f2c1fe8dad4207c3a Mon Sep 17 00:00:00 2001 From: Andrey Kleshchev Date: Fri, 5 Sep 2025 15:09:11 +0300 Subject: Replace boost filesystem with std filesystem Build fixes, instead of resolving unclear boost filesystem errors just updated to std in affected places. --- indra/llfilesystem/lldir.cpp | 32 ++++++++++++++++---------------- 1 file changed, 16 insertions(+), 16 deletions(-) (limited to 'indra/llfilesystem/lldir.cpp') diff --git a/indra/llfilesystem/lldir.cpp b/indra/llfilesystem/lldir.cpp index ea33a3bb90..06f5dd2f77 100644 --- a/indra/llfilesystem/lldir.cpp +++ b/indra/llfilesystem/lldir.cpp @@ -43,7 +43,7 @@ #include "lldiriterator.h" #include "stringize.h" #include "llstring.h" -#include +#include #include #include #include @@ -103,24 +103,24 @@ std::vector LLDir::getFilesInDir(const std::string &dirname) //Returns a vector of fullpath filenames. #ifdef LL_WINDOWS // or BOOST_WINDOWS_API - boost::filesystem::path p(ll_convert(dirname)); + std::filesystem::path p(ll_convert(dirname)); #else - boost::filesystem::path p(dirname); + std::filesystem::path p(dirname); #endif std::vector v; - boost::system::error_code ec; - if (exists(p, ec) && !ec.failed()) + std::error_code ec; + if (std::filesystem::exists(p, ec) && ec.value() == 0) { - if (is_directory(p, ec) && !ec.failed()) + if (is_directory(p, ec) && ec.value() == 0) { - boost::filesystem::directory_iterator end_iter; - for (boost::filesystem::directory_iterator dir_itr(p); + std::filesystem::directory_iterator end_iter; + for (std::filesystem::directory_iterator dir_itr(p); dir_itr != end_iter; ++dir_itr) { - if (boost::filesystem::is_regular_file(dir_itr->status())) + if (std::filesystem::is_regular_file(dir_itr->status())) { v.push_back(dir_itr->path().filename().string()); } @@ -197,24 +197,24 @@ U32 LLDir::deleteDirAndContents(const std::string& dir_name) try { #ifdef LL_WINDOWS // or BOOST_WINDOWS_API - boost::filesystem::path dir_path(ll_convert(dir_name)); + std::filesystem::path dir_path(ll_convert(dir_name)); #else - boost::filesystem::path dir_path(dir_name); + std::filesystem::path dir_path(dir_name); #endif - if (boost::filesystem::exists(dir_path)) + if (std::filesystem::exists(dir_path)) { - if (!boost::filesystem::is_empty(dir_path)) + if (!std::filesystem::is_empty(dir_path)) { // Directory has content - num_deleted = (U32)boost::filesystem::remove_all(dir_path); + num_deleted = (U32)std::filesystem::remove_all(dir_path); } else { // Directory is empty - boost::filesystem::remove(dir_path); + std::filesystem::remove(dir_path); } } } - catch (boost::filesystem::filesystem_error &er) + catch (std::filesystem::filesystem_error &er) { LL_WARNS() << "Failed to delete " << dir_name << " with error " << er.code().message() << LL_ENDL; } -- cgit v1.2.3 From 94cfce4a4d2dbc799e5e8a3495a628ae85d4cffe Mon Sep 17 00:00:00 2001 From: Callum Prentice Date: Fri, 5 Sep 2025 13:44:57 -0700 Subject: Revert "Replace boost filesystem with std filesystem" This reverts commit 94e45ca2e60b4013a4e38d8f2c1fe8dad4207c3a. --- indra/llfilesystem/lldir.cpp | 32 ++++++++++++++++---------------- 1 file changed, 16 insertions(+), 16 deletions(-) (limited to 'indra/llfilesystem/lldir.cpp') diff --git a/indra/llfilesystem/lldir.cpp b/indra/llfilesystem/lldir.cpp index 06f5dd2f77..ea33a3bb90 100644 --- a/indra/llfilesystem/lldir.cpp +++ b/indra/llfilesystem/lldir.cpp @@ -43,7 +43,7 @@ #include "lldiriterator.h" #include "stringize.h" #include "llstring.h" -#include +#include #include #include #include @@ -103,24 +103,24 @@ std::vector LLDir::getFilesInDir(const std::string &dirname) //Returns a vector of fullpath filenames. #ifdef LL_WINDOWS // or BOOST_WINDOWS_API - std::filesystem::path p(ll_convert(dirname)); + boost::filesystem::path p(ll_convert(dirname)); #else - std::filesystem::path p(dirname); + boost::filesystem::path p(dirname); #endif std::vector v; - std::error_code ec; - if (std::filesystem::exists(p, ec) && ec.value() == 0) + boost::system::error_code ec; + if (exists(p, ec) && !ec.failed()) { - if (is_directory(p, ec) && ec.value() == 0) + if (is_directory(p, ec) && !ec.failed()) { - std::filesystem::directory_iterator end_iter; - for (std::filesystem::directory_iterator dir_itr(p); + boost::filesystem::directory_iterator end_iter; + for (boost::filesystem::directory_iterator dir_itr(p); dir_itr != end_iter; ++dir_itr) { - if (std::filesystem::is_regular_file(dir_itr->status())) + if (boost::filesystem::is_regular_file(dir_itr->status())) { v.push_back(dir_itr->path().filename().string()); } @@ -197,24 +197,24 @@ U32 LLDir::deleteDirAndContents(const std::string& dir_name) try { #ifdef LL_WINDOWS // or BOOST_WINDOWS_API - std::filesystem::path dir_path(ll_convert(dir_name)); + boost::filesystem::path dir_path(ll_convert(dir_name)); #else - std::filesystem::path dir_path(dir_name); + boost::filesystem::path dir_path(dir_name); #endif - if (std::filesystem::exists(dir_path)) + if (boost::filesystem::exists(dir_path)) { - if (!std::filesystem::is_empty(dir_path)) + if (!boost::filesystem::is_empty(dir_path)) { // Directory has content - num_deleted = (U32)std::filesystem::remove_all(dir_path); + num_deleted = (U32)boost::filesystem::remove_all(dir_path); } else { // Directory is empty - std::filesystem::remove(dir_path); + boost::filesystem::remove(dir_path); } } } - catch (std::filesystem::filesystem_error &er) + catch (boost::filesystem::filesystem_error &er) { LL_WARNS() << "Failed to delete " << dir_name << " with error " << er.code().message() << LL_ENDL; } -- cgit v1.2.3