diff --git a/library/phx/resources/resource_utils.cpp b/library/phx/resources/resource_utils.cpp index 6f0d536d6433e2c3005e6e9b14d9c12a50064470..3804fae89b37f689c34763a38e47933942da29df 100644 --- a/library/phx/resources/resource_utils.cpp +++ b/library/phx/resources/resource_utils.cpp @@ -28,6 +28,8 @@ #include <string> #include <vector> +#include "boost/filesystem.hpp" + #include "phx/resources/resource_manager.hpp" #include "phx/resources_path.hpp" @@ -81,14 +83,9 @@ std::string ResourceUtils::ExtractFileExtension(const std::string& file_name) { std::string ResourceUtils::FindFileInSearchPath(const std::string& file_name) { for (auto& entry : resource_search_paths_) { auto full_name = entry + file_name; - if (FileExists(full_name)) return full_name; + if (boost::filesystem::exists(full_name.c_str())) return full_name; } return ""; } -bool ResourceUtils::FileExists(const std::string& full_file_name) { - std::fstream target_file(full_file_name.c_str()); - return target_file.is_open(); -} - } // namespace phx diff --git a/library/phx/resources/resource_utils.hpp b/library/phx/resources/resource_utils.hpp index 8dd2553f0583e7e35d238d83c28a57c2c2392abc..95cba49f82f2601230288d4e65a948b376d436f0 100644 --- a/library/phx/resources/resource_utils.hpp +++ b/library/phx/resources/resource_utils.hpp @@ -72,7 +72,6 @@ class PHOENIX_EXPORT ResourceUtils final { private: static std::string FindFileInSearchPath(const std::string& file_name); - static bool FileExists(const std::string& full_file_name); static std::vector<std::string> resource_search_paths_; };