Commit 41228e0d32b94cfc5a6b7d78958a5b7210d20b93
1 parent
38f45c73
Add default special member functions to `Stream` class
Implement default constructor, copy/move constructors, and assignment operators for `Stream`. Add overloads for initializing `Stream` with `QPDFObjectHandle`.
Showing
2 changed files
with
17 additions
and
1 deletions
libqpdf/QPDF_Stream.cc
| @@ -4,7 +4,6 @@ | @@ -4,7 +4,6 @@ | ||
| 4 | #include <qpdf/JSON_writer.hh> | 4 | #include <qpdf/JSON_writer.hh> |
| 5 | #include <qpdf/Pipeline.hh> | 5 | #include <qpdf/Pipeline.hh> |
| 6 | #include <qpdf/Pipeline_private.hh> | 6 | #include <qpdf/Pipeline_private.hh> |
| 7 | -#include <qpdf/Pl_Base64.hh> | ||
| 8 | #include <qpdf/Pl_Buffer.hh> | 7 | #include <qpdf/Pl_Buffer.hh> |
| 9 | #include <qpdf/Pl_Count.hh> | 8 | #include <qpdf/Pl_Count.hh> |
| 10 | #include <qpdf/Pl_Discard.hh> | 9 | #include <qpdf/Pl_Discard.hh> |
libqpdf/qpdf/QPDFObjectHandle_private.hh
| @@ -445,6 +445,23 @@ namespace qpdf | @@ -445,6 +445,23 @@ namespace qpdf | ||
| 445 | { | 445 | { |
| 446 | } | 446 | } |
| 447 | 447 | ||
| 448 | + Stream() = default; | ||
| 449 | + Stream(Stream const&) = default; | ||
| 450 | + Stream(Stream&&) = default; | ||
| 451 | + Stream& operator=(Stream const&) = default; | ||
| 452 | + Stream& operator=(Stream&&) = default; | ||
| 453 | + ~Stream() = default; | ||
| 454 | + | ||
| 455 | + Stream(QPDFObjectHandle const& oh) : | ||
| 456 | + BaseHandle(oh.type_code() == ::ot_stream ? oh : QPDFObjectHandle()) | ||
| 457 | + { | ||
| 458 | + } | ||
| 459 | + | ||
| 460 | + Stream(QPDFObjectHandle&& oh) : | ||
| 461 | + BaseHandle(oh.type_code() == ::ot_stream ? std::move(oh) : QPDFObjectHandle()) | ||
| 462 | + { | ||
| 463 | + } | ||
| 464 | + | ||
| 448 | Stream( | 465 | Stream( |
| 449 | QPDF& qpdf, | 466 | QPDF& qpdf, |
| 450 | QPDFObjGen og, | 467 | QPDFObjGen og, |