diff options
| author | Kelly Rauchenberger <fefferburbia@gmail.com> | 2016-04-13 11:24:24 -0400 |
|---|---|---|
| committer | Kelly Rauchenberger <fefferburbia@gmail.com> | 2016-04-13 11:24:24 -0400 |
| commit | 7e85b35d7d1714e3f85434b891a1050ad584e337 (patch) | |
| tree | 1ca626fe9551734d6d98e50b841b7365d49ba088 /src/util.h | |
| parent | 891d57d200f55b91f80b6d3b4dd0c30479be6109 (diff) | |
| download | libtwittercpp-7e85b35d7d1714e3f85434b891a1050ad584e337.tar.gz libtwittercpp-7e85b35d7d1714e3f85434b891a1050ad584e337.tar.bz2 libtwittercpp-7e85b35d7d1714e3f85434b891a1050ad584e337.zip | |
Added ability to upload media and tweet it
Images (static and animated) and videos have been tested. Currently all media uploads occur in one large chunk; support to break down chunks will be added later.
Diffstat (limited to 'src/util.h')
| -rw-r--r-- | src/util.h | 29 |
1 files changed, 29 insertions, 0 deletions
| diff --git a/src/util.h b/src/util.h new file mode 100644 index 0000000..e1c9370 --- /dev/null +++ b/src/util.h | |||
| @@ -0,0 +1,29 @@ | |||
| 1 | #ifndef UTIL_H_440DEAA0 | ||
| 2 | #define UTIL_H_440DEAA0 | ||
| 3 | |||
| 4 | #include <string> | ||
| 5 | #include <sstream> | ||
| 6 | |||
| 7 | namespace twitter { | ||
| 8 | |||
| 9 | template <class InputIterator> | ||
| 10 | std::string implode(InputIterator first, InputIterator last, std::string delimiter) | ||
| 11 | { | ||
| 12 | std::stringstream result; | ||
| 13 | |||
| 14 | for (InputIterator it = first; it != last; it++) | ||
| 15 | { | ||
| 16 | if (it != first) | ||
| 17 | { | ||
| 18 | result << delimiter; | ||
| 19 | } | ||
| 20 | |||
| 21 | result << *it; | ||
| 22 | } | ||
| 23 | |||
| 24 | return result.str(); | ||
| 25 | } | ||
| 26 | |||
| 27 | }; | ||
| 28 | |||
| 29 | #endif /* end of include guard: UTIL_H_440DEAA0 */ | ||
