diff options
| author | Stanislaw Halik <sthalik@misaki.pl> | 2022-11-05 19:29:40 +0100 |
|---|---|---|
| committer | Stanislaw Halik <sthalik@misaki.pl> | 2022-11-05 19:29:40 +0100 |
| commit | 12eca108a07cde1606fca3e472aed58749407699 (patch) | |
| tree | 44ac90dffca8cde0fc06800c5546cd12f5cd9249 /editor/editor.cpp | |
| parent | 28f5a46ba0058752d4e92cc66e0260f4ed2b8cf3 (diff) | |
replace std::string with Corrade's String
Diffstat (limited to 'editor/editor.cpp')
| -rw-r--r-- | editor/editor.cpp | 5 |
1 files changed, 4 insertions, 1 deletions
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 <Corrade/Containers/StringView.h> +#include <string_view> #include <vector> #include <filesystem> @@ -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<std::shared_ptr<tile_atlas>>; - for (auto& atlas : json_helper::from_json<atlas_array>(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<atlas_array>(image_path/filename_view)) { StringView name = atlas->name(); if (auto x = name.findLast('.'); x) |
