From 4bcf6d116b92f5969714602ed082ff2a7263edde Mon Sep 17 00:00:00 2001 From: Kelly Rauchenberger Date: Fri, 20 May 2016 21:33:25 -0400 Subject: Added "retweeted" field to tweet --- src/tweet.cpp | 15 +++++++++++++++ 1 file changed, 15 insertions(+) (limited to 'src/tweet.cpp') diff --git a/src/tweet.cpp b/src/tweet.cpp index e515595..5885b51 100644 --- a/src/tweet.cpp +++ b/src/tweet.cpp @@ -1,5 +1,6 @@ #include "tweet.h" #include +#include using nlohmann::json; @@ -16,23 +17,37 @@ namespace twitter { _id = _data.at("id"); _text = _data.at("text"); _author = user(_data.at("user").dump()); + _retweeted = _data.at("retweeted"); } tweet_id tweet::getID() const { + assert(_valid); + return _id; } std::string tweet::getText() const { + assert(_valid); + return _text; } const user& tweet::getAuthor() const { + assert(_valid); + return _author; } + bool tweet::isRetweet() const + { + assert(_valid); + + return _retweeted; + } + tweet::operator bool() const { return _valid; -- cgit 1.4.1