[turbine] Cleanup

This commit is contained in:
Gary Talent 2025-05-17 16:12:16 -05:00
parent abcf2adc56
commit 9937a01042
3 changed files with 7 additions and 2 deletions

View File

@ -34,7 +34,7 @@ void setClipboardText(Context &ctx, ox::StringViewCR text) noexcept;
void setClipboardObject(Context &ctx, ox::UPtr<BaseClipboardObject> &&obj) noexcept;
ox::Result<BaseClipboardObject*> getClipboardData(Context &ctx, ox::StringView typeId) noexcept;
ox::Result<BaseClipboardObject*> getClipboardData(Context &ctx, ox::StringViewCR typeId) noexcept;
template<typename T>
ox::Result<T*> getClipboardObject(Context &ctx) noexcept {

View File

@ -5,6 +5,7 @@
#include <ox/std/string.hpp>
#include <turbine/context.hpp>
#include <turbine/clipboard.hpp>
namespace turbine {
@ -15,4 +16,8 @@ ox::String getClipboardText(Context&) noexcept {
void setClipboardText(Context&, ox::StringViewCR) noexcept {
}
ox::Result<BaseClipboardObject*> getClipboardData(Context&, ox::StringViewCR) noexcept {
return ox::Error{1, "not implemented"};
}
}

View File

@ -28,7 +28,7 @@ void setClipboardObject(Context &ctx, ox::UPtr<BaseClipboardObject> &&obj) noexc
ctx.clipboard = std::move(obj);
}
ox::Result<BaseClipboardObject*> getClipboardData(Context &ctx, ox::StringView typeId) noexcept {
ox::Result<BaseClipboardObject*> getClipboardData(Context &ctx, ox::StringViewCR typeId) noexcept {
if (ctx.clipboard && ctx.clipboard->typeId() == typeId) {
return ctx.clipboard.get();
}