[nostalgia] Replace C strings with ox::StringView

This commit is contained in:
2022-12-31 17:14:43 -06:00
parent 55ea405a54
commit 679226ef73
31 changed files with 81 additions and 75 deletions
+4 -2
View File
@@ -17,9 +17,11 @@ ox::String getClipboardText(Context *ctx) noexcept {
return glfwGetClipboardString(id->window);
}
void setClipboardText(Context *ctx, const ox::String &text) noexcept {
void setClipboardText(Context *ctx, ox::CRStringView text) noexcept {
const auto id = ctx->windowerData<GlfwImplData>();
glfwSetClipboardString(id->window, text.c_str());
auto cstr = ox_malloca(text.bytes() + 1, char);
ox_strncpy(cstr.get(), text.data(), text.bytes());
glfwSetClipboardString(id->window, cstr);
}
}