diff --git a/include/Nazara/Core/AbstractLogger.hpp b/include/Nazara/Core/AbstractLogger.hpp index c909e9324..6d84447e0 100644 --- a/include/Nazara/Core/AbstractLogger.hpp +++ b/include/Nazara/Core/AbstractLogger.hpp @@ -26,8 +26,8 @@ namespace Nz virtual bool IsStdReplicationEnabled() const = 0; - virtual void Write(const std::string_view& string) = 0; - virtual void WriteError(ErrorType type, const std::string_view& error, unsigned int line = 0, const char* file = nullptr, const char* function = nullptr); + virtual void Write(std::string_view string) = 0; + virtual void WriteError(ErrorType type, std::string_view error, unsigned int line = 0, const char* file = nullptr, const char* function = nullptr); AbstractLogger& operator=(const AbstractLogger&) = default; AbstractLogger& operator=(AbstractLogger&&) noexcept = default; diff --git a/include/Nazara/Core/FileLogger.hpp b/include/Nazara/Core/FileLogger.hpp index 9592c4e4a..add7f0320 100644 --- a/include/Nazara/Core/FileLogger.hpp +++ b/include/Nazara/Core/FileLogger.hpp @@ -29,8 +29,8 @@ namespace Nz bool IsStdReplicationEnabled() const override; bool IsTimeLoggingEnabled() const; - void Write(const std::string_view& string) override; - void WriteError(ErrorType type, const std::string_view& error, unsigned int line = 0, const char* file = nullptr, const char* function = nullptr) override; + void Write(std::string_view string) override; + void WriteError(ErrorType type, std::string_view error, unsigned int line = 0, const char* file = nullptr, const char* function = nullptr) override; FileLogger& operator=(const FileLogger&) = delete; FileLogger& operator=(FileLogger&&) = default; diff --git a/include/Nazara/Core/Log.hpp b/include/Nazara/Core/Log.hpp index bc39aba2b..d9c8e8850 100644 --- a/include/Nazara/Core/Log.hpp +++ b/include/Nazara/Core/Log.hpp @@ -39,8 +39,8 @@ namespace Nz static void SetLogger(AbstractLogger* logger); - static void Write(const std::string_view& string); - static void WriteError(ErrorType type, const std::string_view& error, unsigned int line = 0, const char* file = nullptr, const char* function = nullptr); + static void Write(std::string_view string); + static void WriteError(ErrorType type, std::string_view error, unsigned int line = 0, const char* file = nullptr, const char* function = nullptr); NazaraStaticSignal(OnLogWrite, const std::string_view& /*string*/); NazaraStaticSignal(OnLogWriteError, ErrorType /*type*/, const std::string_view& /*error*/, unsigned int /*line*/, const char* /*file*/, const char* /*function*/); diff --git a/include/Nazara/Core/StdLogger.hpp b/include/Nazara/Core/StdLogger.hpp index 55deef667..689405401 100644 --- a/include/Nazara/Core/StdLogger.hpp +++ b/include/Nazara/Core/StdLogger.hpp @@ -24,8 +24,8 @@ namespace Nz bool IsStdReplicationEnabled() const override; - void Write(const std::string_view& error) override; - void WriteError(ErrorType type, const std::string_view& error, unsigned int line = 0, const char* file = nullptr, const char* function = nullptr) override; + void Write(std::string_view string) override; + void WriteError(ErrorType type, std::string_view error, unsigned int line = 0, const char* file = nullptr, const char* function = nullptr) override; StdLogger& operator=(const StdLogger&) = default; StdLogger& operator=(StdLogger&&) noexcept = default; diff --git a/include/Nazara/Core/Stream.hpp b/include/Nazara/Core/Stream.hpp index 30c1ff26f..b5742bfe2 100644 --- a/include/Nazara/Core/Stream.hpp +++ b/include/Nazara/Core/Stream.hpp @@ -53,7 +53,7 @@ namespace Nz bool SetCursorPos(UInt64 offset); bool Write(const ByteArray& byteArray); - bool Write(const std::string_view& string); + bool Write(std::string_view string); inline std::size_t Write(const void* buffer, std::size_t size); Stream& operator=(const Stream&) = delete; diff --git a/src/Nazara/Core/AbstractLogger.cpp b/src/Nazara/Core/AbstractLogger.cpp index 4e5c2dcf0..6561277e7 100644 --- a/src/Nazara/Core/AbstractLogger.cpp +++ b/src/Nazara/Core/AbstractLogger.cpp @@ -39,7 +39,7 @@ namespace Nz * \param file Filename * \param function Name of the function throwing the error */ - void AbstractLogger::WriteError(ErrorType type, const std::string_view& error, unsigned int line, const char* file, const char* function) + void AbstractLogger::WriteError(ErrorType type, std::string_view error, unsigned int line, const char* file, const char* function) { NAZARA_USE_ANONYMOUS_NAMESPACE diff --git a/src/Nazara/Core/FileLogger.cpp b/src/Nazara/Core/FileLogger.cpp index 5a36966b6..8049d1df1 100644 --- a/src/Nazara/Core/FileLogger.cpp +++ b/src/Nazara/Core/FileLogger.cpp @@ -91,7 +91,7 @@ namespace Nz * \see WriteError */ - void FileLogger::Write(const std::string_view& string) + void FileLogger::Write(std::string_view string) { if (m_forceStdOutput || m_stdReplicationEnabled) { @@ -147,7 +147,7 @@ namespace Nz * \see Write */ - void FileLogger::WriteError(ErrorType type, const std::string_view& error, unsigned int line, const char* file, const char* function) + void FileLogger::WriteError(ErrorType type, std::string_view error, unsigned int line, const char* file, const char* function) { AbstractLogger::WriteError(type, error, line, file, function); m_outputFile.flush(); diff --git a/src/Nazara/Core/Log.cpp b/src/Nazara/Core/Log.cpp index baf97f688..ff2eec8fa 100644 --- a/src/Nazara/Core/Log.cpp +++ b/src/Nazara/Core/Log.cpp @@ -78,7 +78,7 @@ namespace Nz * \see WriteError */ - void Log::Write(const std::string_view& string) + void Log::Write(std::string_view string) { if (s_enabled) s_logger->Write(string); @@ -98,7 +98,7 @@ namespace Nz * \see Write */ - void Log::WriteError(ErrorType type, const std::string_view& error, unsigned int line, const char* file, const char* function) + void Log::WriteError(ErrorType type, std::string_view error, unsigned int line, const char* file, const char* function) { if (s_enabled) s_logger->WriteError(type, error, line, file, function); diff --git a/src/Nazara/Core/StdLogger.cpp b/src/Nazara/Core/StdLogger.cpp index 703b88852..5d965f9dd 100644 --- a/src/Nazara/Core/StdLogger.cpp +++ b/src/Nazara/Core/StdLogger.cpp @@ -61,9 +61,9 @@ namespace Nz * \see WriteError */ - void StdLogger::Write(const std::string_view& error) + void StdLogger::Write(std::string_view string) { - fwrite(error.data(), sizeof(char), error.size(), stdout); + fwrite(string.data(), sizeof(char), string.size(), stdout); fputc('\n', stdout); } @@ -79,7 +79,7 @@ namespace Nz * \see Write */ - void StdLogger::WriteError(ErrorType type, const std::string_view& error, unsigned int line, const char* file, const char* function) + void StdLogger::WriteError(ErrorType type, std::string_view error, unsigned int line, const char* file, const char* function) { NAZARA_USE_ANONYMOUS_NAMESPACE diff --git a/src/Nazara/Core/Stream.cpp b/src/Nazara/Core/Stream.cpp index 0814d325b..a28ce5604 100644 --- a/src/Nazara/Core/Stream.cpp +++ b/src/Nazara/Core/Stream.cpp @@ -257,7 +257,7 @@ namespace Nz * \param string String to write */ - bool Stream::Write(const std::string_view& string) + bool Stream::Write(std::string_view string) { if (m_streamOptions & StreamOption::Text) {