summaryrefslogtreecommitdiffstats
path: root/include/qpdf/Buffer.hh
diff options
context:
space:
mode:
authorJay Berkenbilt <ejb@ql.org>2010-10-01 12:20:38 +0200
committerJay Berkenbilt <ejb@ql.org>2010-10-01 12:20:38 +0200
commit9f444ffef3c11201d0a460b14b6234d3319ce861 (patch)
treee9d89e8e9bc440b0ea2df3963833158d6dfdf866 /include/qpdf/Buffer.hh
parent359999a59cc1befdc94115d3cd17cb95a0ebdb49 (diff)
downloadqpdf-9f444ffef3c11201d0a460b14b6234d3319ce861.tar.zst
add QPDF::processMemoryFile and API additions to support it
git-svn-id: svn+q:///qpdf/trunk@1034 71b93d88-0707-0410-a8cf-f5a4172ac649
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;
};