diff options
Diffstat (limited to 'qpdf/test_tokenizer.cc')
-rw-r--r-- | qpdf/test_tokenizer.cc | 28 |
1 files changed, 8 insertions, 20 deletions
diff --git a/qpdf/test_tokenizer.cc b/qpdf/test_tokenizer.cc index d0ddf8a1..5e68eb88 100644 --- a/qpdf/test_tokenizer.cc +++ b/qpdf/test_tokenizer.cc @@ -17,7 +17,7 @@ static char const* whoami = 0; void usage() { std::cerr << "Usage: " << whoami - << " [-maxlen len | -no-ignorable | -old-ei] filename" + << " [-maxlen len | -no-ignorable] filename" << std::endl; exit(2); } @@ -133,7 +133,7 @@ try_skipping(QPDFTokenizer& tokenizer, PointerHolder<InputSource> is, static void dump_tokens(PointerHolder<InputSource> is, std::string const& label, size_t max_len, bool include_ignorable, - bool skip_streams, bool skip_inline_images, bool old_ei) + bool skip_streams, bool skip_inline_images) { Finder f1(is, "endstream"); std::cout << "--- BEGIN " << label << " ---" << std::endl; @@ -186,14 +186,7 @@ dump_tokens(PointerHolder<InputSource> is, std::string const& label, { char ch; is->read(&ch, 1); - if (old_ei) - { - tokenizer.expectInlineImage(); - } - else - { - tokenizer.expectInlineImage(is); - } + tokenizer.expectInlineImage(is); inline_image_offset = is->tell(); } else if (token.getType() == QPDFTokenizer::tt_eof) @@ -205,7 +198,7 @@ dump_tokens(PointerHolder<InputSource> is, std::string const& label, } static void process(char const* filename, bool include_ignorable, - size_t max_len, bool old_ei) + size_t max_len) { PointerHolder<InputSource> is; @@ -213,7 +206,7 @@ static void process(char const* filename, bool include_ignorable, FileInputSource* fis = new FileInputSource(); fis->setFilename(filename); is = fis; - dump_tokens(is, "FILE", max_len, include_ignorable, true, false, false); + dump_tokens(is, "FILE", max_len, include_ignorable, true, false); // Tokenize content streams, skipping inline images QPDF qpdf; @@ -232,7 +225,7 @@ static void process(char const* filename, bool include_ignorable, "content data", content_data.getPointer()); is = bis; dump_tokens(is, "PAGE " + QUtil::int_to_string(pageno), - max_len, include_ignorable, false, true, old_ei); + max_len, include_ignorable, false, true); } // Tokenize object streams @@ -251,7 +244,7 @@ static void process(char const* filename, bool include_ignorable, is = bis; dump_tokens(is, "OBJECT STREAM " + QUtil::int_to_string((*iter).getObjectID()), - max_len, include_ignorable, false, false, false); + max_len, include_ignorable, false, false); } } } @@ -276,7 +269,6 @@ int main(int argc, char* argv[]) char const* filename = 0; size_t max_len = 0; bool include_ignorable = true; - bool old_ei = false; for (int i = 1; i < argc; ++i) { if (argv[i][0] == '-') @@ -293,10 +285,6 @@ int main(int argc, char* argv[]) { include_ignorable = false; } - else if (strcmp(argv[i], "-old-ei") == 0) - { - old_ei = true; - } else { usage(); @@ -318,7 +306,7 @@ int main(int argc, char* argv[]) try { - process(filename, include_ignorable, max_len, old_ei); + process(filename, include_ignorable, max_len); } catch (std::exception& e) { |