diff options
author | hop311 <hop3114@gmail.com> | 2024-01-03 15:30:23 +0100 |
---|---|---|
committer | hop311 <hop3114@gmail.com> | 2024-01-03 15:43:35 +0100 |
commit | f0dd758b6c7f35ffb1f6b237805bcb8d39c20cc5 (patch) | |
tree | 21e54285c4f3927ecd3b1b621587d75b875ac3d3 /src/openvic-simulation/dataloader/Vic2PathSearch.cpp | |
parent | 461ec160448373f8d9492b9c586ff53a35edef18 (diff) |
Added case insensitive ordered set and map and IdentifierRegistry
Diffstat (limited to 'src/openvic-simulation/dataloader/Vic2PathSearch.cpp')
-rw-r--r-- | src/openvic-simulation/dataloader/Vic2PathSearch.cpp | 11 |
1 files changed, 2 insertions, 9 deletions
diff --git a/src/openvic-simulation/dataloader/Vic2PathSearch.cpp b/src/openvic-simulation/dataloader/Vic2PathSearch.cpp index d3468e4..26facbe 100644 --- a/src/openvic-simulation/dataloader/Vic2PathSearch.cpp +++ b/src/openvic-simulation/dataloader/Vic2PathSearch.cpp @@ -6,6 +6,7 @@ #include "openvic-simulation/types/OrderedContainers.hpp" #include "openvic-simulation/utility/ConstexprIntToStr.hpp" #include "openvic-simulation/utility/Logger.hpp" +#include "openvic-simulation/utility/StringUtils.hpp" #include "Dataloader.hpp" @@ -20,7 +21,6 @@ #endif using namespace OpenVic; -using namespace OpenVic::NodeTools; using namespace ovdl; #if defined(_WIN32) || (defined(__APPLE__) && defined(__MACH__)) @@ -31,17 +31,10 @@ using namespace ovdl; #define FILESYSTEM_NEEDS_FORWARD_SLASHES #endif -static constexpr bool path_equals_case_insensitive(std::string_view lhs, std::string_view rhs) { - constexpr auto ichar_equals = [](unsigned char l, unsigned char r) { - return std::tolower(l) == std::tolower(r); - }; - return std::equal(lhs.begin(), lhs.end(), rhs.begin(), rhs.end(), ichar_equals); -} - // Windows and Mac by default act like case insensitive filesystems static constexpr bool path_equals(std::string_view lhs, std::string_view rhs) { #if defined(FILESYSTEM_CASE_INSENSITIVE) - return path_equals_case_insensitive(lhs, rhs); + return StringUtils::strings_equal_case_insensitive(lhs, rhs); #else return std::equal(lhs.begin(), lhs.end(), rhs.begin(), rhs.end()); #endif |