-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathsplit.cpp
28 lines (24 loc) · 1.04 KB
/
split.cpp
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
#include <bbqr/bbqr.hpp>
#include <format>
#include <iostream>
#include <string>
using namespace bbqr;
int main(int argc, char** argv) {
std::string raw = "Nunchuk";
FileType file_type = FileType::U;
SplitResult result = split_qrs(raw, file_type);
// or passing custom option
SplitResult result2 = split_qrs(raw, file_type, SplitOption{
.encoding = Encoding::Z,
.force_encoding = true,
.min_version = 1,
.max_version = 40,
.min_split = 1,
.max_split = 1295,
});
std::cout << "encoding: " << static_cast<char>(result.encoding) << "\n";
std::cout << "qr version: " << result.version << "\n";
for (const std::string& part : result.parts) {
std::cout << part << "\n";
}
}