yatbcpp
0.0.1
Yet another Telegram Bot CPP Library
src
types_fromString
chat_type.cc
Go to the documentation of this file.
1
// From JSON Specialication //
4
#include <string>
5
#include "
types/telegram_type.h
"
6
#include "
exceptions/essential_key_missing.h
"
7
#include "
types/chat_type.h
"
8
9
using namespace
std
;
10
11
namespace
yatbcpp
{
17
template
<>
chat_type
fromString
(
string
Data) {
18
if
(Data.compare(
"private"
)==0){
19
return
chat_type::Private;
20
}
21
else
if
(Data.compare(
"group"
)==0){
22
return
chat_type::Group;
23
}
24
else
if
(Data.compare(
"supergroup"
)==0){
25
return
chat_type::Supergroup;
26
}
27
else
if
(Data.compare(
"channel"
)==0){
28
return
chat_type::Channel;
29
}
30
else
{
31
throw
essential_key_missing
(
"chat_type parsable key is not known how to be parsed to"
);
32
}
33
}
34
35
}
yatbcpp::fromString
chat_type fromString(string Data)
Definition:
chat_type.cc:17
yatbcpp::essential_key_missing
Definition:
essential_key_missing.h:12
chat_type.h
std
yatbcpp::chat_type
chat_type
Definition:
chat_type.h:6
yatbcpp
Definition:
Bot.h:27
telegram_type.h
essential_key_missing.h
Generated by
1.8.13