File: numrange.cc

package info (click to toggle)
qpdf 12.2.0-1
  • links: PTS
  • area: main
  • in suites: forky, trixie
  • size: 71,572 kB
  • sloc: cpp: 56,805; perl: 12,015; ansic: 6,547; sh: 1,181; python: 1,027; xml: 43; makefile: 42
file content (30 lines) | stat: -rw-r--r-- 613 bytes parent folder | download
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
#include <qpdf/QUtil.hh>
#include <iostream>

static void
test_numrange(char const* range)
{
    if (range == nullptr) {
        std::cout << "null" << std::endl;
    } else {
        std::vector<int> result = QUtil::parse_numrange(range, 15);
        std::cout << "numeric range " << range << " ->";
        for (int i: result) {
            std::cout << " " << i;
        }
        std::cout << std::endl;
    }
}

int
main(int argc, char* argv[])
{
    try {
        test_numrange(argv[1]);
    } catch (std::exception& e) {
        std::cout << e.what() << std::endl;
        return 2;
    }

    return 0;
}