#include void command_parser::on_msg (std::istream &args) { Json::Reader reader; Json::Value ext; if (!reader.parse (args, ext, false)) throw std::runtime_error ("error parsing input: " + reader.getFormatedErrorMessages ()); if (ext.type () == Json::arrayValue) emit msg (ext[0u].asUInt (), ext[1u].asString (), ext[2u].asString ()); // TODO: other json types }