aboutsummaryrefslogtreecommitdiffstats
path: root/include
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 /include
parent59f3e09edfc71556208a866bb97ed9e173bd827f (diff)
downloadqpdf-f1c6bb97db659faf84e59dbe973b969e9fc1a066.tar.zst
Add new Pipeline convenience methods
Diffstat (limited to 'include')
-rw-r--r--include/qpdf/Pipeline.hh20
1 files changed, 20 insertions, 0 deletions
diff --git a/include/qpdf/Pipeline.hh b/include/qpdf/Pipeline.hh
index 8c1dfe17..c3eb787e 100644
--- a/include/qpdf/Pipeline.hh
+++ b/include/qpdf/Pipeline.hh
@@ -71,6 +71,26 @@ class QPDF_DLL_CLASS Pipeline
QPDF_DLL
std::string getIdentifier() const;
+ // These are convenience methods for making it easier to write
+ // certain other types of data to pipelines without having to
+ // cast. The methods that take char const* expect null-terminated
+ // C strings and do not write the null terminators.
+ QPDF_DLL
+ void writeCStr(char const* cstr);
+ QPDF_DLL
+ void writeString(std::string const&);
+ // This allows *p << "x" << "y" but is not intended to be a
+ // general purpose << compatible with ostream and does not have
+ // local awareness or the ability to be "imbued" with properties.
+ QPDF_DLL
+ Pipeline& operator<<(char const* cstr);
+ QPDF_DLL
+ Pipeline& operator<<(std::string const&);
+
+ // Overloaded write to reduce casting
+ QPDF_DLL
+ void write(char const* data, size_t len);
+
protected:
QPDF_DLL
Pipeline* getNext(bool allow_null = false);