diff options
author | m-holger <m-holger@kubitscheck.org> | 2022-10-04 21:50:36 +0200 |
---|---|---|
committer | Jay Berkenbilt <jberkenbilt@users.noreply.github.com> | 2023-01-07 21:24:51 +0100 |
commit | 863d95e5676b0c03539c1cd9bacb31039d53b433 (patch) | |
tree | 0965ac3242a6e4eb4bb06eae230048dee3ad339c /include | |
parent | a07d2b4190bc0db778a254733dac88dccd5757fd (diff) | |
download | qpdf-863d95e5676b0c03539c1cd9bacb31039d53b433.tar.zst |
Add new method QPDFTokenizer::nextToken
Diffstat (limited to 'include')
-rw-r--r-- | include/qpdf/QPDFTokenizer.hh | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/include/qpdf/QPDFTokenizer.hh b/include/qpdf/QPDFTokenizer.hh index 0fd34fb9..db95eff6 100644 --- a/include/qpdf/QPDFTokenizer.hh +++ b/include/qpdf/QPDFTokenizer.hh @@ -204,6 +204,18 @@ class QPDFTokenizer QPDF_DLL void expectInlineImage(std::shared_ptr<InputSource> input); + // Read a token from an input source. Context describes the + // context in which the token is being read and is used in the + // exception thrown if there is an error. After a token is read, + // the position of the input source returned by input->tell() + // points to just after the token, and the input source's "last + // offset" as returned by input->getLastOffset() points to the + // beginning of the token. Returns false if the token is bad + // or if scanning produced an error message for any reason. + QPDF_DLL + bool nextToken( + InputSource& input, std::string const& context, size_t max_len = 0); + private: QPDFTokenizer(QPDFTokenizer const&) = delete; QPDFTokenizer& operator=(QPDFTokenizer const&) = delete; |