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 resources::OutputFormatter& formatter) {
11 auto limit = parser.GetInt("limit").value_or(10);
12
13 formatter.BeginObject("Dialogue Messages");
14 formatter.AddField("total_messages", 0);
15 formatter.AddField("limit", limit);
16 formatter.AddField("status", "not_implemented");
17 formatter.AddField("message", "Dialogue listing requires dialogue system integration");
18
19 formatter.BeginArray("messages");
20 formatter.EndArray();
21 formatter.EndObject();
22
23 return absl::OkStatus();
24}
25
27 resources::OutputFormatter& formatter) {
28 auto message_id = parser.GetString("id").value();
29
30 formatter.BeginObject("Dialogue Message");
31 formatter.AddField("message_id", message_id);
32 formatter.AddField("status", "not_implemented");
33 formatter.AddField("message", "Dialogue reading requires dialogue system integration");
34 formatter.EndObject();
35
36 return absl::OkStatus();
37}
38
40 resources::OutputFormatter& formatter) {
41 auto query = parser.GetString("query").value();
42 auto limit = parser.GetInt("limit").value_or(10);
43
44 formatter.BeginObject("Dialogue Search Results");
45 formatter.AddField("query", query);
46 formatter.AddField("limit", limit);
47 formatter.AddField("matches_found", 0);
48 formatter.AddField("status", "not_implemented");
49 formatter.AddField("message", "Dialogue search requires dialogue system integration");
50
51 formatter.BeginArray("matches");
52 formatter.EndArray();
53 formatter.EndObject();
54
55 return absl::OkStatus();
56}
57
58} // namespace handlers
59} // namespace cli
60} // namespace yaze
The Rom class is used to load, save, and modify Rom data.
Definition rom.h:71
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.
Main namespace for the application.