summaryrefslogtreecommitdiffstats
path: root/include/qpdf/Buffer.hh
diff options
context:
space:
mode:
Diffstat (limited to 'include/qpdf/Buffer.hh')
-rw-r--r--include/qpdf/Buffer.hh12
1 files changed, 11 insertions, 1 deletions
diff --git a/include/qpdf/Buffer.hh b/include/qpdf/Buffer.hh
index a5ad22cb..09d86996 100644
--- a/include/qpdf/Buffer.hh
+++ b/include/qpdf/Buffer.hh
@@ -15,8 +15,17 @@ class Buffer
public:
QPDF_DLL
Buffer();
+
+ // Create a Buffer object whose memory is owned by the class and
+ // will be freed when the Buffer object is destroyed.
QPDF_DLL
Buffer(unsigned long size);
+
+ // Create a Buffer object whose memory is owned by the caller and
+ // will not be freed when the Buffer is destroyed.
+ QPDF_DLL
+ Buffer(unsigned char* buf, unsigned long size);
+
QPDF_DLL
Buffer(Buffer const&);
QPDF_DLL
@@ -31,10 +40,11 @@ class Buffer
unsigned char* getBuffer();
private:
- void init(unsigned long size);
+ void init(unsigned long size, unsigned char* buf, bool own_memory);
void copy(Buffer const&);
void destroy();
+ bool own_memory;
unsigned long size;
unsigned char* buf;
};