interface.(h|cc)をpost用のinterfaceに

This commit is contained in:
keita
2021-02-17 10:36:29 +09:00
parent 3863349826
commit a4df859af9
4 changed files with 15 additions and 15 deletions
@@ -1,9 +0,0 @@
#include <cocoatweet/api/interface/interface.h>
namespace CocoaTweet::API {
size_t Interface::curlCallback_(char* _ptr, size_t _size, size_t _nmemb, std::string* _stream) {
int realsize = _size * _nmemb;
_stream->append(_ptr, realsize);
return realsize;
}
} // namespace CocoaTweet::API
@@ -0,0 +1,9 @@
#include <cocoatweet/api/interface/postInterface.h>
namespace CocoaTweet::API::Interface {
size_t postInterface::curlCallback_(char* _ptr, size_t _size, size_t _nmemb, std::string* _stream) {
int realsize = _size * _nmemb;
_stream->append(_ptr, realsize);
return realsize;
}
} // namespace CocoaTweet::API
@@ -1,11 +1,11 @@
#ifndef COCOATWEET_API_INTERFACE_H_ #ifndef COCOATWEET_API_INTERFACE_POSTINTERFACE_H_
#define COCOATWEET_API_INTERFACE_H_ #define COCOATWEET_API_INTERFACE_POSTINTERFACE_H_
#include <functional> #include <functional>
#include "cocoatweet/oauth/oauth.h" #include "cocoatweet/oauth/oauth.h"
namespace CocoaTweet::API { namespace CocoaTweet::API::Interface {
class Interface { class postInterface {
public: public:
virtual void process(std::weak_ptr<CocoaTweet::OAuth::OAuth1> _oauth, virtual void process(std::weak_ptr<CocoaTweet::OAuth::OAuth1> _oauth,
std::function<void(std::string)> _callback) = 0; std::function<void(std::string)> _callback) = 0;
+2 -2
View File
@@ -3,11 +3,11 @@
#include <memory> #include <memory>
#include "cocoatweet/api/interface/interface.h" #include "cocoatweet/api/interface/postInterface.h"
//#include "cocoatweet/oauth/oauth.h" //#include "cocoatweet/oauth/oauth.h"
namespace CocoaTweet::API::Statuses { namespace CocoaTweet::API::Statuses {
class Update : public Interface { class Update : public CocoaTweet::API::Interface::postInterface {
public: public:
Update(); Update();
void status(const std::string _status); void status(const std::string _status);