Commit ad7e7bd692b9b8848f8d014f8fdd4fe305c4ffa2

Authored by m-holger
1 parent 0d48b0e6

Deprecate QPDFTokenizer push mode

Push mode is not used by qpdf and is not tested. It is difficult to see a
legitimate use for it.

Continuing to support it creates unnecessary constraints and effort when
adapting the tokenizer.
include/qpdf/QPDFTokenizer.hh
@@ -145,11 +145,11 @@ class QPDFTokenizer @@ -145,11 +145,11 @@ class QPDFTokenizer
145 145
146 // Push mode: 146 // Push mode:
147 147
  148 + // deprecated, please see <https:manual.qpdf.org/release-notes.html#r12-0-0-deprecate>
  149 +
148 // Keep presenting characters with presentCharacter() and presentEOF() and calling getToken() 150 // Keep presenting characters with presentCharacter() and presentEOF() and calling getToken()
149 // until getToken() returns true. When it does, be sure to check unread_ch and to unread ch if 151 // until getToken() returns true. When it does, be sure to check unread_ch and to unread ch if
150 - // it is true.  
151 -  
152 - // It these are called when a token is available, an exception will be thrown. 152 + // it is true. If these are called when a token is available, an exception will be thrown.
153 QPDF_DLL 153 QPDF_DLL
154 void presentCharacter(char ch); 154 void presentCharacter(char ch);
155 QPDF_DLL 155 QPDF_DLL
@@ -164,8 +164,8 @@ class QPDFTokenizer @@ -164,8 +164,8 @@ class QPDFTokenizer
164 // This function returns true of the current character is between tokens (i.e., white space that 164 // This function returns true of the current character is between tokens (i.e., white space that
165 // is not part of a string) or is part of a comment. A tokenizing filter can call this to 165 // is not part of a string) or is part of a comment. A tokenizing filter can call this to
166 // determine whether to output the character. 166 // determine whether to output the character.
167 - QPDF_DLL  
168 - bool betweenTokens(); 167 + [[deprecated("see <https:manual.qpdf.org/release-notes.html#r12-0-0-deprecate>")]] QPDF_DLL bool
  168 + betweenTokens();
169 169
170 // Pull mode: 170 // Pull mode:
171 171
manual/release-notes.rst
@@ -10,6 +10,8 @@ more detail. @@ -10,6 +10,8 @@ more detail.
10 10
11 .. x.y.z: not yet released 11 .. x.y.z: not yet released
12 12
  13 +.. _r12-0-0:
  14 +
13 12.0.0: not yet released 15 12.0.0: not yet released
14 - API: breaking changes 16 - API: breaking changes
15 17
@@ -29,6 +31,13 @@ more detail. @@ -29,6 +31,13 @@ more detail.
29 - ``QIntC.hh`` contained the typo ``substract`` in function names, 31 - ``QIntC.hh`` contained the typo ``substract`` in function names,
30 which has been fixed to ``subtract``. 32 which has been fixed to ``subtract``.
31 33
  34 +.. _r12-0-0-deprecate:
  35 +
  36 + - The following are believed to be not in use and have been deprecated.
  37 + If you are relying on them please open a `ticket <https://issues.qpdf.org>`__:
  38 +
  39 + - All ``QPDFTokenizer`` push-mode methods.
  40 +
32 - Library Enhancements 41 - Library Enhancements
33 42
34 - ``QPDFObjectHandle`` supports move construction/assignment. 43 - ``QPDFObjectHandle`` supports move construction/assignment.
@@ -114,7 +123,7 @@ more detail. @@ -114,7 +123,7 @@ more detail.
114 - Add ``QPDFObjectHandle operator bool``. The operator returns true 123 - Add ``QPDFObjectHandle operator bool``. The operator returns true
115 if the object handle is initialized and is a replacement for the 124 if the object handle is initialized and is a replacement for the
116 ``isInitialized`` method. For more details see the 125 ``isInitialized`` method. For more details see the
117 - `qpdf wiki <https://github.com/qpdf/qpdf/wiki/Use-of-default-constructed-object-handles-in-qpdf-to-indicate-failure-or-error>`__. 126 + `qpdf wiki <https://wiki.qpdf.org/Use-of-default-constructed-object-handles-in-qpdf-to-indicate-failure-or-error>`__.
118 127
119 - New C API function ``qpdf_oh_free_buffer`` to free malloc allocated 128 - New C API function ``qpdf_oh_free_buffer`` to free malloc allocated
120 buffers. 129 buffers.
@@ -408,6 +417,7 @@ more detail. @@ -408,6 +417,7 @@ more detail.
408 PDF files. 417 PDF files.
409 418
410 11.3.0: February 25, 2023 419 11.3.0: February 25, 2023
  420 +
411 - CLI Enhancements 421 - CLI Enhancements
412 422
413 - New option :qpdf:ref:`--remove-restrictions` removes security 423 - New option :qpdf:ref:`--remove-restrictions` removes security