2018-12-20 16:25:19 +00:00
|
|
|
#include <qpdf/QUtil.hh>
|
|
|
|
#include <iostream>
|
|
|
|
|
|
|
|
static void
|
|
|
|
test_numrange(char const* range)
|
|
|
|
{
|
2023-05-20 11:46:50 +00:00
|
|
|
if (range == nullptr) {
|
2018-12-20 16:25:19 +00:00
|
|
|
std::cout << "null" << std::endl;
|
|
|
|
} else {
|
|
|
|
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;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
int
|
|
|
|
main(int argc, char* argv[])
|
|
|
|
{
|
|
|
|
try {
|
|
|
|
test_numrange(argv[1]);
|
|
|
|
} 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;
|
|
|
|
}
|