yatbcpp
0.0.1
Yet another Telegram Bot CPP Library
src
types_fromJson
ChatPhoto_fromJson.cc
Go to the documentation of this file.
1
// From JSON Specialication //
4
#include <jsoncpp/json/json.h>
5
#include "
types/telegram_type.h
"
6
#include "
exceptions/essential_key_missing.h
"
7
#include "
types/ChatPhoto.h
"
8
9
using namespace
std
;
10
11
namespace
yatbcpp
{
17
template
<>
ChatPhoto
fromJson
(Json::Value Data) {
18
if
(!Data.isMember(
"small_file_id"
)) {
19
throw
essential_key_missing
(
"ChatPhoto::small_file_id is missing"
);
20
}
21
if
(!Data.isMember(
"big_file_id"
)) {
22
throw
essential_key_missing
(
"ChatPhoto::big_file_id is missing"
);
23
}
24
25
std::string small_file_id = Data[
"file_id"
].asString();
26
std::string big_file_id = Data[
"file_id"
].asString();
27
28
ChatPhoto
ret(small_file_id, big_file_id);
29
30
return
ret;
31
}
32
}
yatbcpp::ChatPhoto
Definition:
ChatPhoto.h:8
yatbcpp::essential_key_missing
Definition:
essential_key_missing.h:12
std
yatbcpp::fromJson
ChatPhoto fromJson(Json::Value Data)
Definition:
ChatPhoto_fromJson.cc:17
yatbcpp
Definition:
Bot.h:27
ChatPhoto.h
telegram_type.h
essential_key_missing.h
Generated by
1.8.13