summaryrefslogtreecommitdiff
path: root/include/fud_string_view.hpp
diff options
context:
space:
mode:
authorDominick Allen <djallen@librehumanitas.org>2024-10-27 09:04:05 -0500
committerDominick Allen <djallen@librehumanitas.org>2024-10-27 09:04:05 -0500
commitb8345246dcc2121bcb6d1515a9341789de20199f (patch)
tree4a25857512a90ff38e8a40166c54694b74920216 /include/fud_string_view.hpp
parentf84b8259f6e980fed647d8e1ec0634f89ee59c06 (diff)
First crack at file objects.
Diffstat (limited to 'include/fud_string_view.hpp')
-rw-r--r--include/fud_string_view.hpp7
1 files changed, 7 insertions, 0 deletions
diff --git a/include/fud_string_view.hpp b/include/fud_string_view.hpp
index 718b3d7..972630a 100644
--- a/include/fud_string_view.hpp
+++ b/include/fud_string_view.hpp
@@ -61,6 +61,13 @@ struct StringView {
explicit StringView(const String& fudString) noexcept;
+ template <size_t N>
+ constexpr static StringView cStringView(const char (&input)[N])
+ {
+ static_assert(N > 0);
+ return StringView{N, reinterpret_cast<const utf8*>(input)};
+ }
+
[[nodiscard]] constexpr size_t length() const
{
return m_length;