2018-12-20 16:25:19 +00:00
|
|
|
#include <qpdf/QUtil.hh>
|
|
|
|
#include <iostream>
|
|
|
|
|
2022-04-02 21:14:10 +00:00
|
|
|
static void
|
|
|
|
test_numrange(char const* range)
|
2018-12-20 16:25:19 +00:00
|
|
|
{
|
2023-05-20 11:46:50 +00:00
|
|
|
if (range == nullptr) {
|
2018-12-20 16:25:19 +00:00
|
|
|
std::cout << "null" << std::endl;
|
2022-04-02 21:14:10 +00:00
|
|
|
} else {
|
2018-12-20 16:25:19 +00:00
|
|
|
std::vector<int> result = QUtil::parse_numrange(range, 15);
|
|
|
|
std::cout << "numeric range " << range << " ->";
|
2022-04-30 17:23:18 +00:00
|
|
|
for (int i: result) {
|
|
|
|
std::cout << " " << i;
|
2018-12-20 16:25:19 +00:00
|
|
|
}
|
|
|
|
std::cout << std::endl;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2022-04-02 21:14:10 +00:00
|
|
|
int
|
|
|
|
main(int argc, char* argv[])
|
2018-12-20 16:25:19 +00:00
|
|
|
{
|
2022-04-02 21:14:10 +00:00
|
|
|
try {
|
2018-12-20 16:25:19 +00:00
|
|
|
test_numrange(argv[1]);
|
2022-04-02 21:14:10 +00:00
|
|
|
} catch (std::exception& e) {
|
2022-02-08 14:18:08 +00:00
|
|
|
std::cout << e.what() << std::endl;
|
2018-12-20 16:25:19 +00:00
|
|
|
return 2;
|
|
|
|
}
|
|
|
|
|
|
|
|
return 0;
|
|
|
|
}
|