1
0
Fork 0
mirror of https://github.com/OpenMW/openmw.git synced 2025-03-03 15:09:39 +00:00

Remove redundant operator<< overloads from Log

This commit is contained in:
elsid 2023-02-06 21:18:35 +01:00
parent a0795ba7ae
commit 627bed09ee
No known key found for this signature in database
GPG key ID: 4DE04C198CBA7625
2 changed files with 5 additions and 46 deletions

View file

@ -39,22 +39,6 @@ Log::~Log()
sLock.unlock();
}
Log& Log::operator<<(const std::filesystem::path&& rhs)
{
if (mShouldLog)
std::cout << Files::pathToUnicodeString(std::move(rhs));
return *this;
}
Log& Log::operator<<(std::filesystem::path&& rhs)
{
if (mShouldLog)
std::cout << Files::pathToUnicodeString(std::move(rhs));
return *this;
}
Log& Log::operator<<(const std::filesystem::path& rhs)
{
if (mShouldLog)
@ -63,26 +47,10 @@ Log& Log::operator<<(const std::filesystem::path& rhs)
return *this;
}
Log& Log::operator<<(std::filesystem::path& rhs)
Log& Log::operator<<(const std::u8string& rhs)
{
if (mShouldLog)
std::cout << Files::pathToUnicodeString(rhs);
return *this;
}
Log& Log::operator<<(const std::u8string&& rhs)
{
if (mShouldLog)
std::cout << Misc::StringUtils::u8StringToString(std::move(rhs));
return *this;
}
Log& Log::operator<<(std::u8string&& rhs)
{
if (mShouldLog)
std::cout << Misc::StringUtils::u8StringToString(std::move(rhs));
std::cout << Misc::StringUtils::u8StringToString(rhs);
return *this;
}

View file

@ -27,27 +27,18 @@ public:
explicit Log(Debug::Level level);
~Log();
// Perfect forwarding wrappers to give the chain of objects to cout
template <typename T>
Log& operator<<(T&& rhs)
Log& operator<<(const T& rhs)
{
if (mShouldLog)
std::cout << std::forward<T>(rhs);
std::cout << rhs;
return *this;
}
Log& operator<<(const std::filesystem::path&& rhs);
Log& operator<<(std::filesystem::path&& rhs);
Log& operator<<(const std::filesystem::path& rhs);
Log& operator<<(std::filesystem::path& rhs);
Log& operator<<(const std::u8string&& rhs);
Log& operator<<(std::u8string&& rhs);
Log& operator<<(const std::u8string& rhs);
Log& operator<<(std::u8string_view rhs);