uPDFParser

uPDFParser Commit Details

Date:2021-09-09 20:57:10 (1 month 8 days ago)
Author:Grégory Soutadé
Branch:master
Commit:7f2a84c10c677c2356c4be6c42cb01c2881438e6
Parents: 89e9fdc55ed78002e62c834646d281bf1320099a
Message:Add test sample

Changes:
Atests/test.cpp (full)
MMakefile (1 diff)

File differences

Makefile
4646
4747
4848
49
49
5050
5151
5252
53
53
libupdfparser.so: $(OBJECTS)
$(CXX) obj/*.o $(LDFLAGS) -o $@ -shared
test: test.c libupdfparser.a
test: tests/test.cpp libupdfparser.a
g++ -ggdb -O0 $^ -o $@ -Iinclude libupdfparser.a
clean:
rm -rf libupdfparser.so libupdfparser.a obj
rm -rf libupdfparser.so libupdfparser.a obj test
tests/test.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
#include <iostream>
#include <uPDFParser.h>
#include <uPDFParser_common.h>
int main(int argc, char** argv)
{
uPDFParser::Parser parser;
if (argc != 2 || std::string(argv[1]) == "-h" || std::string(argv[1]) == "--help")
{
std::cout << "Usage : " << argv[0] << " <file>" << std::endl;
return 0;
}
std::cout << "Parse " << argv[1] << std::endl;
try
{
parser.parse(argv[1]);
}
catch(uPDFParser::Exception e)
{
std::cout << e.what() << std::endl;
return -1;
}
return 0;
}

Archive Download the corresponding diff file

Branches