From 97a74a32da9fde85117d9f9d1ac4b244ed940e35 Mon Sep 17 00:00:00 2001 From: goeiecool9999 <> Date: Thu, 8 Sep 2022 09:48:22 +0200 Subject: [PATCH] Fixed some issues. --- src/Cafe/Filesystem/FSPath.cpp | 14 ++++++++++---- src/Cafe/Filesystem/FSPath.h | 8 ++++++-- 2 files changed, 16 insertions(+), 6 deletions(-) diff --git a/src/Cafe/Filesystem/FSPath.cpp b/src/Cafe/Filesystem/FSPath.cpp index 7e716eea..80df5a9d 100644 --- a/src/Cafe/Filesystem/FSPath.cpp +++ b/src/Cafe/Filesystem/FSPath.cpp @@ -1,10 +1,16 @@ #include "FSPath.h" #ifdef BOOST_OS_UNIX - -FSPath& FSPath::operator/ (const FSPath & other) +FSPath operator/ (const FSPath& lhs, const FSPath& rhs) { - *this /= other; + FSPath res{lhs}; + res /= FSPath{rhs}; + return res; +} + +FSPath& FSPath::operator/ (const FSPath & rhs) +{ + *this /= rhs; return *this; } @@ -17,7 +23,7 @@ FSPath& FSPath::operator/= (const FSPath & other) fs::path correctedPath = empty() ? other.root_path() : *this; // helper function to convert a path's alphabet characters to lowercase. - auto static lowercase_path = [](FSPath const & path) + auto static lowercase_path = [](fs::path const & path) { std::string string = path.string(); for (auto& i : string) diff --git a/src/Cafe/Filesystem/FSPath.h b/src/Cafe/Filesystem/FSPath.h index 58a9b773..b5807f2c 100644 --- a/src/Cafe/Filesystem/FSPath.h +++ b/src/Cafe/Filesystem/FSPath.h @@ -15,6 +15,10 @@ class FSPath : public fs::path { return FSPath{} / FSPath{input}; } FSPath& operator/= (const FSPath & other); - FSPath& operator/ (const FSPath & other); + FSPath& operator/ (const FSPath & rhs); +#endif +}; + +#ifdef BOOST_OS_UNIX +FSPath operator/ (const FSPath& lhs, const FSPath& rhs); #endif -}; \ No newline at end of file