Commit 8f5de08c2ae5d2c01488887f3141b6fe3eb67779
1 parent
0873e423
Comment about non-const Pipeline data
Showing
1 changed file
with
7 additions
and
1 deletions
include/qpdf/Pipeline.hh
| ... | ... | @@ -44,7 +44,13 @@ class Pipeline |
| 44 | 44 | |
| 45 | 45 | // Subclasses should implement write and finish to do their jobs |
| 46 | 46 | // and then, if they are not end-of-line pipelines, call |
| 47 | - // getNext()->write or getNext()->finish. | |
| 47 | + // getNext()->write or getNext()->finish. It would be really nice | |
| 48 | + // if write could take unsigned char const*, but this would make | |
| 49 | + // it much more difficult to write pipelines around legacy | |
| 50 | + // interfaces whose calls don't want pointers to const data. As a | |
| 51 | + // rule, pipelines should generally not be modifying the data | |
| 52 | + // passed to them. They should, instead, create new data to pass | |
| 53 | + // downstream. | |
| 48 | 54 | QPDF_DLL |
| 49 | 55 | virtual void write(unsigned char* data, size_t len) = 0; |
| 50 | 56 | QPDF_DLL | ... | ... |