From fa3bbb773bb6ee0d49dacd2d7892c19f62402372 Mon Sep 17 00:00:00 2001 From: Mathieu Westphal Date: Wed, 25 Dec 2024 16:39:44 +0100 Subject: [PATCH] window: Update API for C++17 --- library/private/window_impl.h | 2 +- library/public/window.h | 2 +- library/src/window_impl.cxx | 4 ++-- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/library/private/window_impl.h b/library/private/window_impl.h index addea7e956..283ce6af27 100644 --- a/library/private/window_impl.h +++ b/library/private/window_impl.h @@ -55,7 +55,7 @@ class window_impl : public window window& setSize(int width, int height) override; window& setPosition(int x, int y) override; window& setIcon(const unsigned char* icon, size_t iconSize) override; - window& setWindowName(const std::string& windowName) override; + window& setWindowName(std::string_view windowName) override; point3_t getWorldFromDisplay(const point3_t& displayPoint) const override; point3_t getDisplayFromWorld(const point3_t& worldPoint) const override; ///@} diff --git a/library/public/window.h b/library/public/window.h index 33d7aa9c6a..64bfabc70c 100644 --- a/library/public/window.h +++ b/library/public/window.h @@ -106,7 +106,7 @@ class F3D_EXPORT window /** * Set the window name to be shown by a window manager. */ - virtual window& setWindowName(const std::string& windowName) = 0; + virtual window& setWindowName(std::string_view windowName) = 0; /** * Convert a point in display coordinate to world coordinate. diff --git a/library/src/window_impl.cxx b/library/src/window_impl.cxx index 4d4d0c19aa..833a735e38 100644 --- a/library/src/window_impl.cxx +++ b/library/src/window_impl.cxx @@ -315,9 +315,9 @@ window& window_impl::setIcon(const unsigned char* icon, size_t iconSize) } //---------------------------------------------------------------------------- -window& window_impl::setWindowName(const std::string& windowName) +window& window_impl::setWindowName(std::string_view windowName) { - this->Internals->RenWin->SetWindowName(windowName.c_str()); + this->Internals->RenWin->SetWindowName(windowName.data()); return *this; }