CocoaTweet
httpBase.h
Go to the documentation of this file.
1 #ifndef COCOATWEET_API_INTERFACE_HTTPBASE_H_
2 #define COCOATWEET_API_INTERFACE_HTTPBASE_H_
3 
4 #include <functional>
6 
8 class HttpBase {
9 public:
10 protected:
11  std::weak_ptr<CocoaTweet::OAuth::OAuth1> oauth_;
12  std::map<std::string, std::string> bodyParam_;
13  std::string url_;
14  std::string contentType_;
15  virtual void process(std::weak_ptr<CocoaTweet::OAuth::OAuth1> _oauth,
16  std::function<void(const std::string&)> _callback) = 0;
17  static size_t curlCallback_(char* _ptr, size_t _size, size_t _nmemb, std::string* _stream) {
18  int realsize = _size * _nmemb;
19  _stream->append(_ptr, realsize);
20  return realsize;
21  }
22 };
23 } // namespace CocoaTweet::API::Interface
24 
25 #endif
CocoaTweet::API::Interface::HttpBase::process
virtual void process(std::weak_ptr< CocoaTweet::OAuth::OAuth1 > _oauth, std::function< void(const std::string &)> _callback)=0
CocoaTweet::API::Interface
Definition: httpBase.h:7
CocoaTweet::API::Interface::HttpBase::oauth_
std::weak_ptr< CocoaTweet::OAuth::OAuth1 > oauth_
Definition: httpBase.h:11
CocoaTweet::API::Interface::HttpBase
Definition: httpBase.h:8
CocoaTweet::API::Interface::HttpBase::url_
std::string url_
Definition: httpBase.h:13
CocoaTweet::API::Interface::HttpBase::contentType_
std::string contentType_
Definition: httpBase.h:14
CocoaTweet::API::Interface::HttpBase::curlCallback_
static size_t curlCallback_(char *_ptr, size_t _size, size_t _nmemb, std::string *_stream)
Definition: httpBase.h:17
oauth.h
CocoaTweet::API::Interface::HttpBase::bodyParam_
std::map< std::string, std::string > bodyParam_
Definition: httpBase.h:12