diff --git a/src/cocoatweet/api/interface/postInterface.cc b/src/cocoatweet/api/interface/postInterface.cc index 94660fa..35b921b 100644 --- a/src/cocoatweet/api/interface/postInterface.cc +++ b/src/cocoatweet/api/interface/postInterface.cc @@ -18,7 +18,7 @@ size_t postInterface::curlCallback_(char* _ptr, size_t _size, size_t _nmemb, } void postInterface::process(std::weak_ptr _oauth, - std::function _callback) { + std::function _callback) { // エンドポイントへのパラメータにOAuthパラメータを付加して署名作成 auto oauth = _oauth.lock(); auto oauthParam = oauth->oauthParam(); diff --git a/src/cocoatweet/api/interface/postInterface.h b/src/cocoatweet/api/interface/postInterface.h index ea5a4a7..42f73f0 100644 --- a/src/cocoatweet/api/interface/postInterface.h +++ b/src/cocoatweet/api/interface/postInterface.h @@ -8,7 +8,7 @@ namespace CocoaTweet::API::Interface { class postInterface { public: void process(std::weak_ptr _oauth, - std::function _callback); + std::function _callback); protected: std::weak_ptr oauth_; diff --git a/src/cocoatweet/oauth/key.cc b/src/cocoatweet/oauth/key.cc index f6e9333..41685ac 100644 --- a/src/cocoatweet/oauth/key.cc +++ b/src/cocoatweet/oauth/key.cc @@ -3,13 +3,13 @@ #include #include -namespace CocoaTweet::OAuth{ -Key Key::fromJsonFile(const std::string _jsonFile){ - - std::ifstream ifs(_jsonFile); - std::string str((std::istreambuf_iterator(ifs)), std::istreambuf_iterator()); +namespace CocoaTweet::OAuth { +Key Key::fromJsonFile(const std::string _jsonFile) { + std::ifstream ifs(_jsonFile); + std::string str((std::istreambuf_iterator(ifs)), std::istreambuf_iterator()); - auto j = nlohmann::json::parse(str); - return Key(j["consumer_key"], j["consumer_secret"], j["access_token"], j["access_token_secret"]); -} + auto j = nlohmann::json::parse(str); + return Key(j["consumer_key"], j["consumer_secret"], j["access_token"], + j["access_token_secret"]); } +} // namespace CocoaTweet::OAuth diff --git a/src/cocoatweet/oauth/key.h b/src/cocoatweet/oauth/key.h index 425ba0b..3b4b29f 100644 --- a/src/cocoatweet/oauth/key.h +++ b/src/cocoatweet/oauth/key.h @@ -39,7 +39,7 @@ public: {"oauth_token", accessTokenSecret_}}; } - static Key fromJsonFile(const std::string _jsonFile); + static Key fromJsonFile(const std::string _jsonFile); }; } // namespace CocoaTweet::OAuth diff --git a/src/cocoatweet/oauth/oauth.cc b/src/cocoatweet/oauth/oauth.cc index 6ac8217..1fdd1fd 100644 --- a/src/cocoatweet/oauth/oauth.cc +++ b/src/cocoatweet/oauth/oauth.cc @@ -42,8 +42,7 @@ std::map OAuth1::signature( std::cout << "significate base : " << significateBase << std::endl; std::cout << "hmac-sha1 : " << k64Sha1 << std::endl; - auto ret = std::map{ - {"oauth_signature", k64Sha1}}; + auto ret = std::map{{"oauth_signature", k64Sha1}}; return ret; } diff --git a/src/cocoatweet/util/util.cc b/src/cocoatweet/util/util.cc index d3c7a2d..1ebfe89 100644 --- a/src/cocoatweet/util/util.cc +++ b/src/cocoatweet/util/util.cc @@ -11,7 +11,8 @@ std::string urlEncode(const std::string& _str) { (c == '.' || (c == '_') || (c == '-' || (c == '~')))) { out << c; } else { - out << '%' << std::setw(2) << std::setfill('0') << std::hex << std::uppercase << (0xFF & static_cast(c)); + out << '%' << std::setw(2) << std::setfill('0') << std::hex << std::uppercase + << (0xFF & static_cast(c)); } }