#pragma once #include class OwnedStringView { public: OwnedStringView(char* c_str); OwnedStringView(char* c_str, usize length); OwnedStringView(); OwnedStringView(OwnedStringView&&); OwnedStringView(const OwnedStringView&) = delete; ~OwnedStringView(); Result clone() const; Result substring(usize begin, usize size) const; static Result from_string_literal(const char* str); const char* chars() const { return m_string; } usize length() const { return m_length; } const char& operator[](usize) const; private: char* m_string { nullptr }; usize m_length { 0 }; };