From ec9e310c9ea9cee8d9e16cad2a68f0ad096f3a4b Mon Sep 17 00:00:00 2001 From: Jay Berkenbilt Date: Wed, 30 Jan 2019 14:20:56 -0500 Subject: Refactor QPDFTokenizer's inline image handling Add a version of expectInlineImage that takes an input source and searches for EI. This is in preparation for improving the way EI is found. This commit just refactors the code without changing the functionality and adds tests to make sure the old and new code behave identically. --- include/qpdf/Pl_QPDFTokenizer.hh | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) (limited to 'include/qpdf/Pl_QPDFTokenizer.hh') diff --git a/include/qpdf/Pl_QPDFTokenizer.hh b/include/qpdf/Pl_QPDFTokenizer.hh index 52630d2a..a571b079 100644 --- a/include/qpdf/Pl_QPDFTokenizer.hh +++ b/include/qpdf/Pl_QPDFTokenizer.hh @@ -27,6 +27,7 @@ #include #include #include +#include // Tokenize the incoming text using QPDFTokenizer and pass the tokens // in turn to a QPDFObjectHandle::TokenFilter object. All bytes of @@ -56,9 +57,6 @@ class Pl_QPDFTokenizer: public Pipeline virtual void finish(); private: - void processChar(char ch); - void checkUnread(); - class Members { friend class Pl_QPDFTokenizer; @@ -73,9 +71,7 @@ class Pl_QPDFTokenizer: public Pipeline QPDFObjectHandle::TokenFilter* filter; QPDFTokenizer tokenizer; - bool last_char_was_cr; - bool unread_char; - char char_to_unread; + Pl_Buffer buf; }; PointerHolder m; }; -- cgit v1.2.3-54-g00ecf