[nostalgia,studio] Replace some String returns with StringView

This commit is contained in:
Gary Talent 2023-12-10 15:09:51 -06:00
parent dbd98fe18b
commit 8c9ebbedae
10 changed files with 20 additions and 20 deletions

View File

@ -22,11 +22,11 @@ PaletteEditorImGui::PaletteEditorImGui(turbine::Context &ctx, ox::CRStringView p
m_pal(*keel::readObj<Palette>(keelCtx(m_ctx), ox::FileAddress(m_itemPath.c_str())).unwrapThrow()) {
}
ox::String const&PaletteEditorImGui::itemName() const noexcept {
ox::CStringView PaletteEditorImGui::itemName() const noexcept {
return m_itemPath;
}
ox::String const&PaletteEditorImGui::itemDisplayName() const noexcept {
ox::CStringView PaletteEditorImGui::itemDisplayName() const noexcept {
return m_itemName;
}

View File

@ -26,9 +26,9 @@ class PaletteEditorImGui: public studio::Editor {
/**
* Returns the name of item being edited.
*/
ox::String const&itemName() const noexcept final;
ox::CStringView itemName() const noexcept final;
ox::String const&itemDisplayName() const noexcept final;
ox::CStringView itemDisplayName() const noexcept final;
void draw(turbine::Context*) noexcept final;

View File

@ -54,11 +54,11 @@ TileSheetEditorImGui::TileSheetEditorImGui(turbine::Context &ctx, ox::CRStringVi
model()->paletteChanged.connect(this, &TileSheetEditorImGui::setPaletteSelection);
}
ox::String const&TileSheetEditorImGui::itemName() const noexcept {
ox::CStringView TileSheetEditorImGui::itemName() const noexcept {
return m_itemPath;
}
ox::String const&TileSheetEditorImGui::itemDisplayName() const noexcept {
ox::CStringView TileSheetEditorImGui::itemDisplayName() const noexcept {
return m_itemName;
}

View File

@ -59,9 +59,9 @@ class TileSheetEditorImGui: public studio::BaseEditor {
~TileSheetEditorImGui() override = default;
ox::String const&itemName() const noexcept override;
ox::CStringView itemName() const noexcept override;
ox::String const&itemDisplayName() const noexcept override;
ox::CStringView itemDisplayName() const noexcept override;
void exportFile() override;

View File

@ -20,11 +20,11 @@ SceneEditorImGui::SceneEditorImGui(turbine::Context &ctx, ox::StringView path):
setRequiresConstantRefresh(false);
}
ox::CRString SceneEditorImGui::itemName() const noexcept {
ox::CStringView SceneEditorImGui::itemName() const noexcept {
return m_itemPath;
}
ox::CRString SceneEditorImGui::itemDisplayName() const noexcept {
ox::CStringView SceneEditorImGui::itemDisplayName() const noexcept {
return m_itemName;
}

View File

@ -28,9 +28,9 @@ class SceneEditorImGui: public studio::Editor {
/**
* Returns the name of item being edited.
*/
ox::CRString itemName() const noexcept final;
ox::CStringView itemName() const noexcept final;
ox::CRString itemDisplayName() const noexcept final;
ox::CStringView itemDisplayName() const noexcept final;
void draw(turbine::Context*) noexcept final;

View File

@ -14,11 +14,11 @@ ClawEditor::ClawEditor(ox::CRStringView path, ox::ModelObject obj) noexcept:
m_obj(std::move(obj)) {
}
ox::CRString ClawEditor::itemName() const noexcept {
ox::CStringView ClawEditor::itemName() const noexcept {
return m_itemName;
}
ox::CRString ClawEditor::itemDisplayName() const noexcept {
ox::CStringView ClawEditor::itemDisplayName() const noexcept {
return m_itemDisplayName;
}

View File

@ -23,9 +23,9 @@ class ClawEditor: public studio::Editor {
/**
* Returns the name of item being edited.
*/
ox::CRString itemName() const noexcept final;
ox::CStringView itemName() const noexcept final;
ox::CRString itemDisplayName() const noexcept final;
ox::CStringView itemDisplayName() const noexcept final;
void draw(turbine::Context*) noexcept final;

View File

@ -32,10 +32,10 @@ class BaseEditor: public Widget {
* Returns the name of item being edited.
*/
[[nodiscard]]
virtual const ox::String &itemName() const noexcept = 0;
virtual ox::CStringView itemName() const noexcept = 0;
[[nodiscard]]
virtual const ox::String &itemDisplayName() const noexcept;
virtual ox::CStringView itemDisplayName() const noexcept;
virtual void cut();
@ -113,7 +113,7 @@ class BaseEditor: public Widget {
ox::Signal<ox::Error(bool)> cutEnabledChanged;
ox::Signal<ox::Error(bool)> copyEnabledChanged;
ox::Signal<ox::Error(bool)> pasteEnabledChanged;
ox::Signal<ox::Error(const ox::String&)> closed;
ox::Signal<ox::Error(ox::StringView)> closed;
};

View File

@ -10,7 +10,7 @@
namespace studio {
const ox::String &BaseEditor::itemDisplayName() const noexcept {
ox::CStringView BaseEditor::itemDisplayName() const noexcept {
return itemName();
}