MCPcopy Create free account
hub / github.com/ReversecLabs/C3 / TranslateCommand

Method TranslateCommand

Src/ChannelLinter/ChannelLinter.cpp:248–262  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

246 }
247
248 FSecure::ByteVector ChannelLinter::TranslateCommand(StringVector const& commandParams)
249 {
250 uint16_t commandId = GetCommandId(commandParams.at(0));
251
252 if (!m_ChannelCommands.count(commandId))
253 throw std::runtime_error("Failed to find a command with id: " + std::to_string(commandId));
254
255 Form commandForm = m_ChannelCommands.at(commandId).m_ArgumentsForm;
256 json command
257 {
258 { "id", commandId},
259 { "arguments", commandForm.Fill({begin(commandParams) + 1, end(commandParams)})}, // + 1 to omit command id}
260 };
261 return C3::Core::Profiler::TranslateCommand(command);
262 }
263
264 StringVector ChannelLinter::GetComplementaryChannelArgs() const
265 {

Callers

nothing calls this directly

Calls 6

GetCommandIdFunction · 0.85
beginFunction · 0.85
endFunction · 0.85
countMethod · 0.80
FillMethod · 0.80
to_stringFunction · 0.50

Tested by

no test coverage detected