summaryrefslogtreecommitdiff
path: root/lib/nes/app/file-browser.hh
diff options
context:
space:
mode:
authorHannes Schulze <haschu0103@outlook.de>2025-02-06 19:54:38 +0100
committerHannes Schulze <haschu0103@outlook.de>2025-02-06 19:54:38 +0100
commit64ebfde8bcd6408e3b6925624e8680c314db6efc (patch)
treeb969314f909f7f16ef5acc63f90dca317a40850a /lib/nes/app/file-browser.hh
parentd060e3a50c987d10799ccc739bdbf9d7d7a13c10 (diff)
get rid of nasty stdlib
Diffstat (limited to 'lib/nes/app/file-browser.hh')
-rw-r--r--lib/nes/app/file-browser.hh13
1 files changed, 7 insertions, 6 deletions
diff --git a/lib/nes/app/file-browser.hh b/lib/nes/app/file-browser.hh
index 3465000..1da4cd6 100644
--- a/lib/nes/app/file-browser.hh
+++ b/lib/nes/app/file-browser.hh
@@ -1,9 +1,10 @@
#pragma once
#include "nes/common/containers/span.hh"
+#include "nes/common/containers/string-view.hh"
#include "nes/common/types.hh"
#include "nes/common/status.hh"
-#include <string_view>
+#include "nes/common/utils.hh"
namespace nes
{
@@ -33,14 +34,14 @@ namespace nes::app
public:
explicit entry() = default;
- explicit entry(entry_type const type, std::string_view const name)
+ explicit entry(entry_type const type, string_view const name)
: type_{ type }
{
- std::copy_n(name.begin(), std::min(static_cast<u32>(name.length()), max_name_length), name_);
+ copy(name.get_data(), name_, min(name.get_length(), max_name_length));
}
auto get_type() const -> entry_type { return type_; }
- auto get_name() const -> std::string_view { return name_; }
+ auto get_name() const -> string_view { return name_; }
};
virtual ~file_browser() = default;
@@ -63,10 +64,10 @@ namespace nes::app
virtual auto navigate_up() -> status = 0;
/// Change the current working directory to an item.
- virtual auto navigate(std::string_view) -> status = 0;
+ virtual auto navigate(string_view) -> status = 0;
/// Load a file in the current working directory into memory.
- virtual auto load(std::string_view, span<u8>, u32* out_length) -> status = 0;
+ virtual auto load(string_view, span<u8>, u32* out_length) -> status = 0;
protected:
explicit file_browser() = default;