summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorEgor Pugin <egor.pugin@gmail.com>2018-07-04 19:27:20 +0300
committerEgor Pugin <egor.pugin@gmail.com>2018-07-04 19:27:20 +0300
commitac3e87822afb6065a82dfe547ecbc0c307a04147 (patch)
treeb1d3895de28ce746cf15e7378e1bd22c2fac2f0e /src
parentdf3898ed79dec253b7f013ed1a6c2f1f0e98cb40 (diff)
Remove string literal.
Diffstat (limited to 'src')
-rw-r--r--src/Api.cpp8
-rw-r--r--src/net/HttpClient.cpp6
2 files changed, 7 insertions, 7 deletions
diff --git a/src/Api.cpp b/src/Api.cpp
index 3bb200b..abc99de 100644
--- a/src/Api.cpp
+++ b/src/Api.cpp
@@ -861,7 +861,7 @@ Message::Ptr Api::editMessageText(const string& text, int64_t chatId, int32_t me
return TgTypeParser::getInstance().parseJsonAndGetMessage(p);
} else {
return nullptr;
- }
+ }
}
Message::Ptr Api::editMessageCaption(int64_t chatId, int32_t messageId, const string& caption,
@@ -983,7 +983,7 @@ WebhookInfo::Ptr Api::getWebhookInfo() const {
}
if (p.get<string>("url","") != string("")) {
return TgTypeParser::getInstance().parseJsonAndGetWebhookInfo(p);
- }
+ }
else {
return nullptr;
}
@@ -1199,7 +1199,7 @@ ptree Api::sendRequest(const string& method, const vector<HttpReqArg>& args) con
url += "/";
url += method;
- string serverResponse = _httpClientDriver.makeRequest(url, args);
+ string serverResponse = _httpClientDriver.makeRequest(url, args);
if (!serverResponse.compare(0, 6, "<html>")) {
throw TgException("tgbot-cpp library have got html page instead of json response. Maybe you entered wrong bot token.");
}
@@ -1222,7 +1222,7 @@ string Api::downloadFile(const string& filePath, const std::vector<HttpReqArg>&
url += "/";
url += filePath;
- string serverResponse = _httpClientDriver.makeRequest(url, args);
+ string serverResponse = _httpClientDriver.makeRequest(url, args);
return serverResponse;
}
diff --git a/src/net/HttpClient.cpp b/src/net/HttpClient.cpp
index 479b72a..b61285c 100644
--- a/src/net/HttpClient.cpp
+++ b/src/net/HttpClient.cpp
@@ -32,7 +32,7 @@ using namespace boost::asio::ip;
namespace TgBot {
BoostHttpClient& BoostHttpClient::getInstance() {
- static BoostHttpClient result;
+ static BoostHttpClient result;
return result;
}
@@ -78,7 +78,7 @@ string BoostHttpClient::makeRequest(const Url& url, const vector<HttpReqArg>& ar
#else
char buff[1024];
#endif //TGBOT_CHANGE_READ_BUFFER_SIZE
-
+
boost::system::error_code error;
while (!error) {
size_t bytes = read(socket, buffer(buff), error);
@@ -138,7 +138,7 @@ string CurlHttpClient::makeRequest(const Url& url, const vector<HttpReqArg>& arg
curl_easy_cleanup(curl);
if (res != CURLE_OK)
- throw std::runtime_error("curl error: "s + curl_easy_strerror(res));
+ throw std::runtime_error(std::string("curl error: ") + curl_easy_strerror(res));
if (http_code != 200)
throw std::runtime_error("curl request returned with code = " + std::to_string(http_code));