From 67da294d1dcb6a6a87f3f70db19a942609d33c9a Mon Sep 17 00:00:00 2001 From: tastytea Date: Sun, 1 Apr 2018 00:15:35 +0200 Subject: [PATCH] Added Easy::Entity::to_object() --- CMakeLists.txt | 2 +- src/easy/easy.cpp | 5 +++++ src/easy/easy.hpp | 10 ++++++++-- 3 files changed, 14 insertions(+), 3 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 0c63173..477aaa4 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -1,6 +1,6 @@ cmake_minimum_required (VERSION 3.7) project (mastodon-cpp - VERSION 0.7.16 + VERSION 0.7.17 LANGUAGES CXX ) diff --git a/src/easy/easy.cpp b/src/easy/easy.cpp index ce1c09c..f71ea02 100644 --- a/src/easy/easy.cpp +++ b/src/easy/easy.cpp @@ -85,6 +85,11 @@ const void Easy::Entity::from_string(const string &json) } } +const Json::Value Easy::Entity::to_object() const +{ + return _tree; +} + Easy::Entity::Entity() : _valid(false) {} diff --git a/src/easy/easy.hpp b/src/easy/easy.hpp index 478553b..3d7fad8 100644 --- a/src/easy/easy.hpp +++ b/src/easy/easy.hpp @@ -131,13 +131,19 @@ public: Entity(); /*! - * @brief Replaces the Entity object with a new one from a JSON - * string. + * @brief Replaces the Entity with a new one from a JSON string. * * @param json JSON string */ const void from_string(const string &json); + /*! + * @brief Returns the JSON object of the Entity + * + * @return JSON object + */ + const Json::Value to_object() const; + /*! * @brief Returns true if the Entity holds valid data */