JSON-parsing functions moved to namespace telebotxx.

This commit is contained in:
Kirill Kirilenko 2016-09-30 00:46:33 +03:00
parent 1c2c8384bc
commit 1e43989b77

View file

@ -13,8 +13,8 @@
#include <boost/log/trivial.hpp>
using namespace telebotxx;
namespace telebotxx
{
const rapidjson::Value& parseResponse(const rapidjson::Document& doc)
{
using namespace rapidjson;
@ -31,8 +31,7 @@ const rapidjson::Value& parseResponse(const rapidjson::Document& doc)
if (!doc.HasMember("result") || !doc["result"].IsObject())
throw ParseError("Field 'result' not found or has invalid type");
return doc["result"];
}
else
} else
{
if (!doc.HasMember("error_code") || !doc["error_code"].IsInt())
throw ParseError("Field 'error_code' not found or has invalid type");
@ -76,6 +75,9 @@ User parseUser(const rapidjson::Value& obj)
return User(id, firstName, lastName, username);
}
}
using namespace telebotxx;
class BotApi::Impl
{