From bfb15053ea5d21bc0502f3102cd83407fafddf75 Mon Sep 17 00:00:00 2001 From: imarom Date: Tue, 15 Dec 2015 04:26:21 -0500 Subject: moved all return code values to RC types (better for batch rc) also few fixes --- src/rpc-server/trex_rpc_cmd.cpp | 12 ++++++++++++ 1 file changed, 12 insertions(+) (limited to 'src/rpc-server/trex_rpc_cmd.cpp') diff --git a/src/rpc-server/trex_rpc_cmd.cpp b/src/rpc-server/trex_rpc_cmd.cpp index d4eef1f7..8f0ffbad 100644 --- a/src/rpc-server/trex_rpc_cmd.cpp +++ b/src/rpc-server/trex_rpc_cmd.cpp @@ -203,12 +203,24 @@ TrexRpcCommand::parse_string(const Json::Value &parent, const std::string &name, return parent[name].asString(); } +/** + * object version + */ const Json::Value & TrexRpcCommand::parse_object(const Json::Value &parent, const std::string &name, Json::Value &result) { check_field_type(parent, name, FIELD_TYPE_OBJ, result); return parent[name]; } +/** + * index version + */ +const Json::Value & +TrexRpcCommand::parse_object(const Json::Value &parent, int index, Json::Value &result) { + check_field_type(parent, index, FIELD_TYPE_OBJ, result); + return parent[index]; +} + const Json::Value & TrexRpcCommand::parse_array(const Json::Value &parent, const std::string &name, Json::Value &result) { check_field_type(parent, name, FIELD_TYPE_ARRAY, result); -- cgit 1.2.3-korg