aegis.cpp
Main Page
Related Pages
Classes
Files
File List
All
Classes
Functions
Variables
Typedefs
Enumerations
Enumerator
Friends
Pages
include
aegis
gateway
objects
video.hpp
1
//
2
// video.hpp
3
// *********
4
//
5
// Copyright (c) 2019 Sharon W (sharon at aegis dot gg)
6
//
7
// Distributed under the MIT License. (See accompanying file LICENSE)
8
//
9
10
#pragma once
11
12
#include "aegis/config.hpp"
13
#include <nlohmann/json.hpp>
14
#include <string>
15
#include <vector>
16
17
namespace
aegis
18
{
19
20
namespace
gateway
21
{
22
23
namespace
objects
24
{
25
28
struct
video
29
{
30
std::string
url
;
31
int32_t
height
= 0;
32
int32_t
width
= 0;
33
};
34
36
inline
void
from_json(
const
nlohmann::json& j,
video
& m)
37
{
38
if
(j.count(
"url"
))
39
m.
url
= j[
"url"
].get<std::string>();
40
if
(j.count(
"height"
) && !j[
"height"
].is_null())
41
m.
height
= j[
"height"
];
42
if (j.count(
"width"
) && !j[
"width"
].is_null())
43
m.
width
= j[
"width"
];
44
}
46
48
inline
void
to_json(nlohmann::json& j,
const
video& m)
49
{
50
j[
"url"
] = m.url;
51
j[
"height"
] = m.height;
52
j[
"width"
] = m.width;
53
}
55
56
}
57
58
}
59
60
}
aegis::gateway::objects::video::height
int32_t height
Definition:
video.hpp:31
aegis::gateway::objects::video::width
int32_t width
Definition:
video.hpp:32
aegis::gateway::objects::video
Definition:
video.hpp:28
aegis::gateway::objects::video::url
std::string url
Definition:
video.hpp:30
Generated on Sun Aug 2 2020 09:17:34 for aegis.cpp by
1.8.7