2
1
mirror of https://github.com/qpdf/qpdf.git synced 2024-11-05 21:07:50 +00:00
qpdf/qpdf/test_pdf_doc_encoding.cc
m-holger 6c69a747b9 Code clean up: use range-style for loops wherever possible
Remove variables obsoleted by commit 4f24617.
2022-05-21 16:06:29 -04:00

35 lines
694 B
C++

#include <qpdf/QPDFObjectHandle.hh>
#include <qpdf/QUtil.hh>
#include <iostream>
#include <stdlib.h>
#include <string.h>
static char const* whoami = 0;
void
usage()
{
std::cerr << "Usage: " << whoami << " infile" << std::endl;
exit(2);
}
int
main(int argc, char* argv[])
{
if ((whoami = strrchr(argv[0], '/')) == NULL) {
whoami = argv[0];
} else {
++whoami;
}
if (argc != 2) {
usage();
}
char const* infilename = argv[1];
for (auto const& line: QUtil::read_lines_from_file(infilename)) {
QPDFObjectHandle str = QPDFObjectHandle::newString(line);
std::cout << str.getUTF8Value() << std::endl;
}
return 0;
}