-
-
Notifications
You must be signed in to change notification settings - Fork 492
/
Copy pathQrBuffer.h
58 lines (45 loc) · 1.24 KB
/
QrBuffer.h
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
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
#pragma once
#include "QrBuffer.g.h"
#include <winrt/Windows.Foundation.Collections.h>
using namespace winrt::Windows::Foundation::Collections;
namespace winrt::Telegram::Native::implementation
{
struct QrData {
int size = 0;
std::vector<bool> values; // size x size
};
struct QrBuffer : QrBufferT<QrBuffer>
{
QrBuffer(int32_t size, IVector<bool> values, int32_t replaceFrom, int32_t replaceTill) :
m_size(size),
m_values(values),
m_replaceFrom(replaceFrom),
m_replaceTill(replaceTill)
{
}
int32_t Size() {
return m_size;
}
IVector<bool> Values() {
return m_values;
}
int32_t ReplaceFrom() {
return m_replaceFrom;
}
int32_t ReplaceTill() {
return m_replaceTill;
}
static winrt::Telegram::Native::QrBuffer FromString(hstring text);
private:
int32_t m_size;
IVector<bool> m_values{ nullptr };
int32_t m_replaceFrom;
int32_t m_replaceTill;
};
}
namespace winrt::Telegram::Native::factory_implementation
{
struct QrBuffer : QrBufferT<QrBuffer, implementation::QrBuffer>
{
};
}