summaryrefslogtreecommitdiff
path: root/lib/nes/app/action.hh
diff options
context:
space:
mode:
authorHannes Schulze <hannes.hs.schulze@fau.de>2025-05-02 15:16:35 +0200
committerHannes Schulze <hannes.hs.schulze@fau.de>2025-05-02 15:16:35 +0200
commit91c9b3addf5f3db972fd28752855eda811221afe (patch)
treee3f23bc153e66afa0481430c9c828f6d7a28859b /lib/nes/app/action.hh
parent24c521f5a4b9f2e1a98668e9d9f7b19b4c9a9bd7 (diff)
different action depending on file extension
Diffstat (limited to 'lib/nes/app/action.hh')
-rw-r--r--lib/nes/app/action.hh11
1 files changed, 10 insertions, 1 deletions
diff --git a/lib/nes/app/action.hh b/lib/nes/app/action.hh
index c88a5f1..8caf969 100644
--- a/lib/nes/app/action.hh
+++ b/lib/nes/app/action.hh
@@ -2,6 +2,7 @@
#include "nes/common/containers/string-view.hh"
#include "nes/common/status.hh"
+#include <cstdio>
namespace nes::app
{
@@ -22,6 +23,7 @@ namespace nes::app
launch_game,
show_error,
prompt_key,
+ view_file,
};
private:
@@ -65,6 +67,13 @@ namespace nes::app
return res;
}
+ static auto view_file(string_view const file_name) -> action
+ {
+ auto res = action{ type::view_file };
+ res.file_name_ = file_name;
+ return res;
+ }
+
auto get_type() const -> type { return type_; }
auto get_file_name() const -> string_view { return file_name_; }
auto get_key() const -> string_view { return key_; }
@@ -77,4 +86,4 @@ namespace nes::app
{
}
};
-} // namespace nes::app \ No newline at end of file
+} // namespace nes::app