From 12eca108a07cde1606fca3e472aed58749407699 Mon Sep 17 00:00:00 2001 From: Stanislaw Halik Date: Sat, 5 Nov 2022 19:29:40 +0100 Subject: replace std::string with Corrade's String --- editor/editor.cpp | 5 ++++- editor/editor.hpp | 5 ++--- 2 files changed, 6 insertions(+), 4 deletions(-) (limited to 'editor') diff --git a/editor/editor.cpp b/editor/editor.cpp index 3586a3bf..499dd441 100644 --- a/editor/editor.cpp +++ b/editor/editor.cpp @@ -11,6 +11,7 @@ #include +#include #include #include @@ -25,7 +26,9 @@ void tile_editor::load_atlases() { static const std::filesystem::path image_path{IMAGE_PATH, std::filesystem::path::generic_format}; using atlas_array = std::vector>; - for (auto& atlas : json_helper::from_json(image_path/(_name + ".json"))) + const String filename = _name + ".json"; + const auto filename_view = std::string_view{filename.cbegin(), filename.cend()}; + for (auto& atlas : json_helper::from_json(image_path/filename_view)) { StringView name = atlas->name(); if (auto x = name.findLast('.'); x) diff --git a/editor/editor.hpp b/editor/editor.hpp index 869307c7..09277590 100644 --- a/editor/editor.hpp +++ b/editor/editor.hpp @@ -9,9 +9,8 @@ #include #include #include -#include #include -#include +#include namespace floormat { @@ -32,7 +31,7 @@ private: sel_none, sel_tile, sel_perm, }; - std::string _name; + String _name; std::map> _atlases; tile_image_proto _selected_tile; std::tuple, std::vector> _permutation; -- cgit v1.2.3