diff options
author | Jay Berkenbilt <ejb@ql.org> | 2022-04-16 19:21:57 +0200 |
---|---|---|
committer | Jay Berkenbilt <ejb@ql.org> | 2022-04-16 19:35:27 +0200 |
commit | 75fe4f60c3f59af30cb1d8f2b5902d866c05550a (patch) | |
tree | 81106c6129626417cb9f71ab31393b31f9c27078 /libqpdf/QPDF_Stream.cc | |
parent | 38edca820eac0a79fd860895b46dd03005e3c96b (diff) | |
download | qpdf-75fe4f60c3f59af30cb1d8f2b5902d866c05550a.tar.zst |
Use anonymous namespaces for file-private classes
Diffstat (limited to 'libqpdf/QPDF_Stream.cc')
-rw-r--r-- | libqpdf/QPDF_Stream.cc | 58 |
1 files changed, 31 insertions, 27 deletions
diff --git a/libqpdf/QPDF_Stream.cc b/libqpdf/QPDF_Stream.cc index fa64fb1f..cf52532b 100644 --- a/libqpdf/QPDF_Stream.cc +++ b/libqpdf/QPDF_Stream.cc @@ -19,38 +19,42 @@ #include <stdexcept> -class SF_Crypt: public QPDFStreamFilter +namespace { - public: - SF_Crypt() = default; - virtual ~SF_Crypt() = default; - - virtual bool - setDecodeParms(QPDFObjectHandle decode_parms) + class SF_Crypt: public QPDFStreamFilter { - if (decode_parms.isNull()) { - return true; - } - bool filterable = true; - for (auto const& key : decode_parms.getKeys()) { - if (((key == "/Type") || (key == "/Name")) && - ((!decode_parms.hasKey("/Type")) || - decode_parms.isDictionaryOfType("/CryptFilterDecodeParms"))) { - // we handle this in decryptStream - } else { - filterable = false; + public: + SF_Crypt() = default; + virtual ~SF_Crypt() = default; + + virtual bool + setDecodeParms(QPDFObjectHandle decode_parms) + { + if (decode_parms.isNull()) { + return true; } + bool filterable = true; + for (auto const& key : decode_parms.getKeys()) { + if (((key == "/Type") || (key == "/Name")) && + ((!decode_parms.hasKey("/Type")) || + decode_parms.isDictionaryOfType( + "/CryptFilterDecodeParms"))) { + // we handle this in decryptStream + } else { + filterable = false; + } + } + return filterable; } - return filterable; - } - virtual Pipeline* - getDecodePipeline(Pipeline*) - { - // Not used -- handled by pipeStreamData - return nullptr; - } -}; + virtual Pipeline* + getDecodePipeline(Pipeline*) + { + // Not used -- handled by pipeStreamData + return nullptr; + } + }; +} // namespace std::map<std::string, std::string> QPDF_Stream::filter_abbreviations = { // The PDF specification provides these filter abbreviations for |