MCPcopy Create free account
hub / github.com/DFHack/dfhack / decode

Method decode

library/RemoteClient.cpp:70–88  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

68const char RPCHandshakeHeader::RESPONSE_MAGIC[9] = "DFHack!\n";
69
70void color_ostream_proxy::decode(CoreTextNotification *data)
71{
72 flush_proxy();
73
74 int cnt = data->fragments_size();
75 if (cnt > 0) {
76 target->begin_batch();
77
78 for (int i = 0; i < cnt; i++)
79 {
80 auto &frag = data->fragments(i);
81
82 color_value color = frag.has_color() ? color_value(frag.color()) : COLOR_RESET;
83 target->add_text(color, frag.text());
84 }
85
86 target->end_batch();
87 }
88}
89
90RemoteClient::RemoteClient(color_ostream *default_output)
91 : p_default_output(default_output)

Callers 15

executeMethod · 0.45
decode_matinfoFunction · 0.45
mainFunction · 0.45
walk_git_filesFunction · 0.45
mainFunction · 0.45
mainFunction · 0.45
changeitem_executeFunction · 0.45
guess_job_materialFunction · 0.45
changelayerFunction · 0.45
df_probeFunction · 0.45

Calls 5

color_valueEnum · 0.85
begin_batchMethod · 0.45
colorMethod · 0.45
add_textMethod · 0.45
end_batchMethod · 0.45

Tested by

no test coverage detected