yaze 0.3.2
Link to the Past ROM Editor
 
Loading...
Searching...
No Matches
dialogue_commands.cc
Go to the documentation of this file.
2
3#include "absl/strings/str_format.h"
4
5namespace yaze {
6namespace cli {
7namespace handlers {
8
10 Rom* rom, const resources::ArgumentParser& parser,
11 resources::OutputFormatter& formatter) {
12 auto limit = parser.GetInt("limit").value_or(10);
13
14 formatter.BeginObject("Dialogue Messages");
15 formatter.AddField("total_messages", 0);
16 formatter.AddField("limit", limit);
17 formatter.AddField("status", "not_implemented");
18 formatter.AddField("message",
19 "Dialogue listing requires dialogue system integration");
20
21 formatter.BeginArray("messages");
22 formatter.EndArray();
23 formatter.EndObject();
24
25 return absl::OkStatus();
26}
27
29 Rom* rom, const resources::ArgumentParser& parser,
30 resources::OutputFormatter& formatter) {
31 auto message_id = parser.GetString("id").value();
32
33 formatter.BeginObject("Dialogue Message");
34 formatter.AddField("message_id", message_id);
35 formatter.AddField("status", "not_implemented");
36 formatter.AddField("message",
37 "Dialogue reading requires dialogue system integration");
38 formatter.EndObject();
39
40 return absl::OkStatus();
41}
42
44 Rom* rom, const resources::ArgumentParser& parser,
45 resources::OutputFormatter& formatter) {
46 auto query = parser.GetString("query").value();
47 auto limit = parser.GetInt("limit").value_or(10);
48
49 formatter.BeginObject("Dialogue Search Results");
50 formatter.AddField("query", query);
51 formatter.AddField("limit", limit);
52 formatter.AddField("matches_found", 0);
53 formatter.AddField("status", "not_implemented");
54 formatter.AddField("message",
55 "Dialogue search requires dialogue system integration");
56
57 formatter.BeginArray("matches");
58 formatter.EndArray();
59 formatter.EndObject();
60
61 return absl::OkStatus();
62}
63
64} // namespace handlers
65} // namespace cli
66} // namespace yaze
The Rom class is used to load, save, and modify Rom data. This is a generic SNES ROM container and do...
Definition rom.h:24
absl::Status Execute(Rom *rom, const resources::ArgumentParser &parser, resources::OutputFormatter &formatter) override
Execute the command business logic.
absl::Status Execute(Rom *rom, const resources::ArgumentParser &parser, resources::OutputFormatter &formatter) override
Execute the command business logic.
absl::Status Execute(Rom *rom, const resources::ArgumentParser &parser, resources::OutputFormatter &formatter) override
Execute the command business logic.
Utility for parsing common CLI argument patterns.
std::optional< std::string > GetString(const std::string &name) const
Parse a named argument (e.g., –format=json or –format json)
absl::StatusOr< int > GetInt(const std::string &name) const
Parse an integer argument (supports hex with 0x prefix)
Utility for consistent output formatting across commands.
void BeginArray(const std::string &key)
Begin an array.
void BeginObject(const std::string &title="")
Start a JSON object or text section.
void EndObject()
End a JSON object or text section.
void AddField(const std::string &key, const std::string &value)
Add a key-value pair.