diff irccdctl/cli.cpp @ 698:ad1ee47165fa

Irccd: create own json_util::document class For convenience when parsing command arguments, use directly json_util::document instead of raw nlohmann::json object. This will simplify the process of decomposing unsafe structures.
author David Demelier <markand@malikania.fr>
date Mon, 07 May 2018 21:10:12 +0200
parents 95ac3ace1610
children 252506d9839b
line wrap: on
line diff
--- a/irccdctl/cli.cpp	Fri May 04 14:19:01 2018 +0200
+++ b/irccdctl/cli.cpp	Mon May 07 21:10:12 2018 +0200
@@ -34,7 +34,7 @@
         if (code)
             throw std::system_error(code);
 
-        const auto c = json_util::parser(message).get<std::string>("command");
+        const auto c = json_util::document(message).get<std::string>("command");
 
         if (!c) {
             recv_response(ctl, std::move(req), std::move(handler));