aboutsummaryrefslogtreecommitdiffstats
path: root/libqpdf/Pipeline.cc
diff options
context:
space:
mode:
authorJay Berkenbilt <ejb@ql.org>2022-05-03 23:58:58 +0200
committerJay Berkenbilt <ejb@ql.org>2022-05-04 00:31:22 +0200
commitf1c6bb97db659faf84e59dbe973b969e9fc1a066 (patch)
treee9f8a87e78cad1c9b856c8d61eaec9b90ab100a6 /libqpdf/Pipeline.cc
parent59f3e09edfc71556208a866bb97ed9e173bd827f (diff)
downloadqpdf-f1c6bb97db659faf84e59dbe973b969e9fc1a066.tar.zst
Add new Pipeline convenience methods
Diffstat (limited to 'libqpdf/Pipeline.cc')
-rw-r--r--libqpdf/Pipeline.cc32
1 files changed, 32 insertions, 0 deletions
diff --git a/libqpdf/Pipeline.cc b/libqpdf/Pipeline.cc
index b63dff9f..12a98d04 100644
--- a/libqpdf/Pipeline.cc
+++ b/libqpdf/Pipeline.cc
@@ -25,3 +25,35 @@ Pipeline::getIdentifier() const
{
return this->identifier;
}
+
+void
+Pipeline::writeCStr(char const* cstr)
+{
+ this->write(cstr, strlen(cstr));
+}
+
+void
+Pipeline::writeString(std::string const& str)
+{
+ this->write(str.c_str(), str.length());
+}
+
+Pipeline&
+Pipeline::operator<<(char const* cstr)
+{
+ this->writeCStr(cstr);
+ return *this;
+}
+
+Pipeline&
+Pipeline::operator<<(std::string const& str)
+{
+ this->writeString(str);
+ return *this;
+}
+
+void
+Pipeline::write(char const* data, size_t len)
+{
+ this->write(reinterpret_cast<unsigned char const*>(data), len);
+}