From a9d33aa08df10102539e33c0c6d4334e9e99a470 Mon Sep 17 00:00:00 2001 From: Kelly Rauchenberger Date: Thu, 30 Aug 2018 20:38:37 -0400 Subject: Started using hkutil As of this commit, the only change is using hatkirby::implode instead of the implode that was in util.cpp. --- src/client.cpp | 11 +++++++---- src/client.h | 1 - src/timeline.cpp | 5 +++-- src/util.h | 21 --------------------- 4 files changed, 10 insertions(+), 28 deletions(-) (limited to 'src') diff --git a/src/client.cpp b/src/client.cpp index 3a01c90..07f7580 100644 --- a/src/client.cpp +++ b/src/client.cpp @@ -4,6 +4,7 @@ #include #include #include +#include #include "request.h" namespace twitter { @@ -26,7 +27,7 @@ namespace twitter { if (!media_ids.empty()) { datastrstream << "&media_ids="; - datastrstream << twitter::implode(std::begin(media_ids), std::end(media_ids), ","); + datastrstream << hatkirby::implode(std::begin(media_ids), std::end(media_ids), ","); } return tweet( @@ -46,7 +47,7 @@ namespace twitter { if (!media_ids.empty()) { datastrstream << "&media_ids="; - datastrstream << twitter::implode(std::begin(media_ids), std::end(media_ids), ","); + datastrstream << hatkirby::implode(std::begin(media_ids), std::end(media_ids), ","); } return tweet( @@ -366,7 +367,8 @@ namespace twitter { } std::string datastr = "id=" + - OAuth::PercentEncode(implode(std::begin(cur), std::end(cur), ",")); + OAuth::PercentEncode( + hatkirby::implode(std::begin(cur), std::end(cur), ",")); std::string response = post(auth_, @@ -399,7 +401,8 @@ namespace twitter { } std::string datastr = "user_id=" + - OAuth::PercentEncode(implode(std::begin(cur), std::end(cur), ",")); + OAuth::PercentEncode( + hatkirby::implode(std::begin(cur), std::end(cur), ",")); std::string response = post(auth_, diff --git a/src/client.h b/src/client.h index ba68e6b..5329edb 100644 --- a/src/client.h +++ b/src/client.h @@ -9,7 +9,6 @@ #include "tweet.h" #include "auth.h" #include "configuration.h" -#include "util.h" #include "timeline.h" namespace twitter { diff --git a/src/timeline.cpp b/src/timeline.cpp index fd75a69..280c814 100644 --- a/src/timeline.cpp +++ b/src/timeline.cpp @@ -1,8 +1,8 @@ #include "timeline.h" #include #include +#include #include "codes.h" -#include "util.h" #include "request.h" namespace twitter { @@ -40,7 +40,8 @@ namespace twitter { if (!arguments.empty()) { urlstr << "?"; - urlstr << implode(std::begin(arguments), std::end(arguments), "&"); + urlstr << hatkirby::implode( + std::begin(arguments), std::end(arguments), "&"); } std::string theUrl = urlstr.str(); diff --git a/src/util.h b/src/util.h index b950728..8b9cf86 100644 --- a/src/util.h +++ b/src/util.h @@ -1,31 +1,10 @@ #ifndef UTIL_H_440DEAA0 #define UTIL_H_440DEAA0 -#include -#include -#include #include namespace twitter { - template - std::string implode(InputIterator first, InputIterator last, std::string delimiter) - { - std::stringstream result; - - for (InputIterator it = first; it != last; it++) - { - if (it != first) - { - result << delimiter; - } - - result << *it; - } - - return result.str(); - } - time_t timegm(struct tm * t); }; -- cgit 1.4.1