aboutsummaryrefslogtreecommitdiffstats
path: root/libqpdf/Pl_Count.cc
diff options
context:
space:
mode:
authorJay Berkenbilt <ejb@ql.org>2019-06-22 03:32:47 +0200
committerJay Berkenbilt <ejb@ql.org>2019-06-22 16:13:27 +0200
commit79f6b4823b95b65290a045a59fdd4a8d9b302708 (patch)
treeb94d273dd51e64a7144b669cf5ed91d826cc1387 /libqpdf/Pl_Count.cc
parent864a546af6e1c17e0de2dc2be6da105f454b6e54 (diff)
downloadqpdf-79f6b4823b95b65290a045a59fdd4a8d9b302708.tar.zst
Convert remaining public classes to use Members pattern
Have classes contain only a single private member of type PointerHolder<Members>. This makes it safe to change the structure of the Members class without breaking binary compatibility. Many of the classes already follow this pattern quite successfully. This brings in the rest of the class that are part of the public API.
Diffstat (limited to 'libqpdf/Pl_Count.cc')
-rw-r--r--libqpdf/Pl_Count.cc21
1 files changed, 15 insertions, 6 deletions
diff --git a/libqpdf/Pl_Count.cc b/libqpdf/Pl_Count.cc
index b4b13640..8077092a 100644
--- a/libqpdf/Pl_Count.cc
+++ b/libqpdf/Pl_Count.cc
@@ -1,13 +1,22 @@
#include <qpdf/Pl_Count.hh>
#include <qpdf/QIntC.hh>
-Pl_Count::Pl_Count(char const* identifier, Pipeline* next) :
- Pipeline(identifier, next),
+Pl_Count::Members::Members() :
count(0),
last_char('\0')
{
}
+Pl_Count::Members::~Members()
+{
+}
+
+Pl_Count::Pl_Count(char const* identifier, Pipeline* next) :
+ Pipeline(identifier, next),
+ m(new Members())
+{
+}
+
Pl_Count::~Pl_Count()
{
}
@@ -17,9 +26,9 @@ Pl_Count::write(unsigned char* buf, size_t len)
{
if (len)
{
- this->count += QIntC::to_offset(len);
+ this->m->count += QIntC::to_offset(len);
getNext()->write(buf, len);
- this->last_char = buf[len - 1];
+ this->m->last_char = buf[len - 1];
}
}
@@ -32,11 +41,11 @@ Pl_Count::finish()
qpdf_offset_t
Pl_Count::getCount() const
{
- return this->count;
+ return this->m->count;
}
unsigned char
Pl_Count::getLastChar() const
{
- return this->last_char;
+ return this->m->last_char;
}