yaze 0.3.2
Link to the Past ROM Editor
 
Loading...
Searching...
No Matches
command_palette_goto.h
Go to the documentation of this file.
1#ifndef YAZE_APP_EDITOR_SYSTEM_COMMANDS_COMMAND_PALETTE_GOTO_H_
2#define YAZE_APP_EDITOR_SYSTEM_COMMANDS_COMMAND_PALETTE_GOTO_H_
3
4#include <cstddef>
5#include <optional>
6#include <string>
7#include <string_view>
8
10
11namespace yaze {
12namespace editor {
13
29
30struct GotoQuery {
31 enum class Status {
32 kOk, // id parsed and in range
33 kMissingId, // keyword + separator typed, id not yet
34 kOutOfRange, // id parsed but outside the kind's range
35 };
38 int id = -1;
39};
40
44std::optional<GotoQuery> ParseGotoQuery(std::string_view query);
45
47std::optional<int> ParseGotoId(std::string_view token);
48
50int GotoMaxId(GotoKind kind);
51const char* GotoKindName(GotoKind kind);
52
55
60CommandEntry BuildGotoEntry(const GotoQuery& query, size_t session_id);
61
62} // namespace editor
63} // namespace yaze
64
65#endif // YAZE_APP_EDITOR_SYSTEM_COMMANDS_COMMAND_PALETTE_GOTO_H_
CommandEntry BuildGotoEntry(const GotoQuery &query, size_t session_id)
const char * GotoKindName(GotoKind kind)
bool GotoKindHasJumpPath(GotoKind kind)
True when a jump path exists for kind (sprites have none yet).
std::optional< int > ParseGotoId(std::string_view token)
Parse a single id token using the formats above. nullopt if malformed.
int GotoMaxId(GotoKind kind)
Inclusive upper bound for kind.
std::optional< GotoQuery > ParseGotoQuery(std::string_view query)