blob: cf13009fb9b2ee049e6481501385d7cf073894f3 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
|
#include "response.hpp"
#include <optional>
#include <string>
#include <vector>
namespace bot::command {
Response::Response() {
this->single = std::nullopt;
this->multiple = std::nullopt;
}
Response::Response(std::string single) {
this->single = single;
this->multiple = std::nullopt;
}
Response::Response(std::vector<std::string> multiple) {
this->single = std::nullopt;
this->multiple = multiple;
}
const std::string Response::get_single() const {
return this->single.value();
}
const std::vector<std::string> Response::get_multiple() const {
return this->multiple.value();
}
const bool Response::is_single() const { return this->single.has_value(); }
const bool Response::is_multiple() const {
return this->multiple.has_value();
}
const bool Response::is_empty() const {
return !this->single.has_value() && !this->multiple.has_value();
}
}
|