aboutsummaryrefslogtreecommitdiffstats
path: root/libqpdf/qpdf/SF_ASCIIHexDecode.hh
diff options
context:
space:
mode:
authorJay Berkenbilt <ejb@ql.org>2020-12-23 12:12:49 +0100
committerJay Berkenbilt <ejb@ql.org>2020-12-28 18:58:19 +0100
commit39bfa0130713defc9abb478a70717ca07377cdab (patch)
tree18b6370d5f2f7d10a3f1ef09a8f0dd3b9281bd3c /libqpdf/qpdf/SF_ASCIIHexDecode.hh
parent1fb26f08ad91d08f67ac30e2557ddcadd8b9ccac (diff)
downloadqpdf-39bfa0130713defc9abb478a70717ca07377cdab.tar.zst
Implement user-provided stream filters
Refactor QPDF_Stream to use stream filter classes to handle supported stream filters as well.
Diffstat (limited to 'libqpdf/qpdf/SF_ASCIIHexDecode.hh')
-rw-r--r--libqpdf/qpdf/SF_ASCIIHexDecode.hh30
1 files changed, 30 insertions, 0 deletions
diff --git a/libqpdf/qpdf/SF_ASCIIHexDecode.hh b/libqpdf/qpdf/SF_ASCIIHexDecode.hh
new file mode 100644
index 00000000..869d0722
--- /dev/null
+++ b/libqpdf/qpdf/SF_ASCIIHexDecode.hh
@@ -0,0 +1,30 @@
+#include <qpdf/QPDFStreamFilter.hh>
+#include <qpdf/Pl_ASCIIHexDecoder.hh>
+#include <memory>
+
+#ifndef SF_ASCIIHEXDECODE_HH
+#define SF_ASCIIHEXDECODE_HH
+
+class SF_ASCIIHexDecode: public QPDFStreamFilter
+{
+ public:
+ SF_ASCIIHexDecode() = default;
+ virtual ~SF_ASCIIHexDecode() = default;
+
+ virtual Pipeline* getDecodePipeline(Pipeline* next) override
+ {
+ this->pipeline = std::make_shared<Pl_ASCIIHexDecoder>(
+ "asciiHex decode", next);
+ return this->pipeline.get();
+ }
+
+ static std::shared_ptr<QPDFStreamFilter> factory()
+ {
+ return std::make_shared<SF_ASCIIHexDecode>();
+ }
+
+ private:
+ std::shared_ptr<Pipeline> pipeline;
+};
+
+#endif // SF_ASCIIHEXDECODE_HH