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
|
|
|
{
|
2022-04-02 21:14:10 +00:00
|
|
|
if (range == 0) {
|
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 << " ->";
|
|
|
|
for (std::vector<int>::iterator iter = result.begin();
|
2022-04-02 21:14:10 +00:00
|
|
|
iter != result.end();
|
|
|
|
++iter) {
|
2018-12-20 16:25:19 +00:00
|
|
|
std::cout << " " << *iter;
|
|
|
|
}
|
|
|
|
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;
|
|
|
|
}
|