diff options
author | Jay Berkenbilt <ejb@ql.org> | 2010-08-05 22:20:52 +0200 |
---|---|---|
committer | Jay Berkenbilt <ejb@ql.org> | 2010-08-05 22:20:52 +0200 |
commit | 6f2bd7eb3a64ae6ffbdf9ae256d822056ddcb7b0 (patch) | |
tree | b2853762f4a564e1110ddf37f4821ea02d40a367 /libqpdf/QPDF_Stream.cc | |
parent | 11df7809af7131af139be2e76f2db87128700939 (diff) | |
download | qpdf-6f2bd7eb3a64ae6ffbdf9ae256d822056ddcb7b0.tar.zst |
newStream
git-svn-id: svn+q:///qpdf/trunk@991 71b93d88-0707-0410-a8cf-f5a4172ac649
Diffstat (limited to 'libqpdf/QPDF_Stream.cc')
-rw-r--r-- | libqpdf/QPDF_Stream.cc | 19 |
1 files changed, 19 insertions, 0 deletions
diff --git a/libqpdf/QPDF_Stream.cc b/libqpdf/QPDF_Stream.cc index 1f48b2c1..87c2daa9 100644 --- a/libqpdf/QPDF_Stream.cc +++ b/libqpdf/QPDF_Stream.cc @@ -40,6 +40,19 @@ QPDF_Stream::~QPDF_Stream() { } +void +QPDF_Stream::setObjGen(int objid, int generation) +{ + if (! ((this->objid == 0) && (this->generation == 0))) + { + throw std::logic_error( + "attempt to set object ID and generation of a stream" + " that already has them"); + } + this->objid = objid; + this->generation = generation; +} + std::string QPDF_Stream::unparse() { @@ -353,6 +366,12 @@ QPDF_Stream::pipeStreamData(Pipeline* pipeline, bool filter, QUtil::int_to_string(desired_length) + " bytes"); } } + else if (this->offset == 0) + { + QTC::TC("qpdf", "QPDF_Stream pipe no stream data"); + throw std::logic_error( + "pipeStreamData called for stream with no data"); + } else { QTC::TC("qpdf", "QPDF_Stream pipe original stream data"); |