aboutsummaryrefslogtreecommitdiffstats
path: root/qpdf/test_pdf_unicode.cc
diff options
context:
space:
mode:
authorJay Berkenbilt <ejb@ql.org>2022-04-02 23:14:10 +0200
committerJay Berkenbilt <ejb@ql.org>2022-04-04 14:10:40 +0200
commit12f1eb15ca3fed6310402847559a7c99d3c77847 (patch)
tree8935675b623c6f3b4914b8b44f7fa5f2816a9241 /qpdf/test_pdf_unicode.cc
parentf20fa61eb4c323eb1642c69c236b3d9a1f8b2cdb (diff)
downloadqpdf-12f1eb15ca3fed6310402847559a7c99d3c77847.tar.zst
Programmatically apply new formatting to code
Run this: for i in **/*.cc **/*.c **/*.h **/*.hh; do clang-format < $i >| $i.new && mv $i.new $i done
Diffstat (limited to 'qpdf/test_pdf_unicode.cc')
-rw-r--r--qpdf/test_pdf_unicode.cc29
1 files changed, 13 insertions, 16 deletions
diff --git a/qpdf/test_pdf_unicode.cc b/qpdf/test_pdf_unicode.cc
index 8964e8a5..ead143b3 100644
--- a/qpdf/test_pdf_unicode.cc
+++ b/qpdf/test_pdf_unicode.cc
@@ -1,41 +1,38 @@
-#include <qpdf/QUtil.hh>
#include <qpdf/QPDFObjectHandle.hh>
+#include <qpdf/QUtil.hh>
#include <iostream>
#include <stdlib.h>
#include <string.h>
static char const* whoami = 0;
-void usage()
+void
+usage()
{
std::cerr << "Usage: " << whoami << " infile" << std::endl;
exit(2);
}
-int main(int argc, char* argv[])
+int
+main(int argc, char* argv[])
{
- if ((whoami = strrchr(argv[0], '/')) == NULL)
- {
+ if ((whoami = strrchr(argv[0], '/')) == NULL) {
whoami = argv[0];
- }
- else
- {
+ } else {
++whoami;
}
- if (argc != 2)
- {
+ if (argc != 2) {
usage();
}
char const* infilename = argv[1];
- std::list<std::string> lines =
- QUtil::read_lines_from_file(infilename);
+ std::list<std::string> lines = QUtil::read_lines_from_file(infilename);
for (std::list<std::string>::iterator iter = lines.begin();
- iter != lines.end(); ++iter)
- {
+ iter != lines.end();
+ ++iter) {
QPDFObjectHandle str = QPDFObjectHandle::newUnicodeString(*iter);
- std::cout << str.getUTF8Value() << " // "
- << str.unparseBinary() << std::endl;
+ std::cout << str.getUTF8Value() << " // " << str.unparseBinary()
+ << std::endl;
}
return 0;
}