From 57dfa6c68123a204eeae981173b0d64bcbd20c64 Mon Sep 17 00:00:00 2001 From: Jackson Date: Tue, 18 Jan 2022 21:30:55 -0500 Subject: [PATCH] Add version info, update to 0.7.1 --- CMakeLists.txt | 2 +- include/rpc.hpp | 5 ++++- include/rpc_adapters/rpc_boost_json.hpp | 8 ++++---- 3 files changed, 9 insertions(+), 6 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 61096511..b614663b 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -32,7 +32,7 @@ cmake_minimum_required(VERSION 3.16) project( "rpc.hpp" - VERSION 0.6.2 + VERSION 0.7.1 DESCRIPTION "Simple RPC Header-Only Library" LANGUAGES CXX ) diff --git a/include/rpc.hpp b/include/rpc.hpp index e02787b9..d070b09b 100644 --- a/include/rpc.hpp +++ b/include/rpc.hpp @@ -1,7 +1,7 @@ ///@file rpc.hpp ///@author Jackson Harmer (jharmer95@gmail.com) ///@brief Header-only library for serialized RPC usage -///@version 0.6.2 +///@version 0.7.1 /// ///@copyright ///BSD 3-Clause License @@ -71,6 +71,9 @@ ///@brief Top-level namespace for rpc.hpp classes and functions namespace rpc { +///@brief Array containing the version information for rpc.hpp +static constexpr unsigned version[]{ 0, 7, 1 }; + namespace exceptions { enum class Type diff --git a/include/rpc_adapters/rpc_boost_json.hpp b/include/rpc_adapters/rpc_boost_json.hpp index 165fcd23..a25256b5 100644 --- a/include/rpc_adapters/rpc_boost_json.hpp +++ b/include/rpc_adapters/rpc_boost_json.hpp @@ -264,7 +264,7 @@ template object_t obj{}; obj["func_name"] = pack.get_func_name(); - auto& args = ret_j["args"].emplace_array(); + auto& args = obj["args"].emplace_array(); args.reserve(sizeof...(Args)); const auto& argTup = pack.get_args(); @@ -286,7 +286,7 @@ template } } - return ret_j; + return obj; } template<> @@ -318,7 +318,7 @@ template } else { - if (obj.contains("result") && !obj["result"].is_null()) + if (obj.contains("result") && !obj.at("result").is_null()) { return ::rpc::details::packed_func(obj.at("func_name").get_string().c_str(), adapters::boost_json::details::parse_arg(obj.at("result")), @@ -331,7 +331,7 @@ template if (obj.contains("except_type")) { - pack.set_exception(obj.at("err_mesg").get_string.c_str(), + pack.set_exception(obj.at("err_mesg").get_string().c_str(), static_cast(obj.at("except_type").get_int64())); }