summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--include/Buffer.h3
-rw-r--r--lib/Buffer.cc10
2 files changed, 11 insertions, 2 deletions
diff --git a/include/Buffer.h b/include/Buffer.h
index f62ad72..73225bc 100644
--- a/include/Buffer.h
+++ b/include/Buffer.h
@@ -17,7 +17,7 @@
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*/
-/* $Id: Buffer.h,v 1.21 2007-05-30 11:57:08 pixel Exp $ */
+/* $Id: Buffer.h,v 1.22 2007-06-23 15:36:02 pixel Exp $ */
#ifndef __BUFFER_H__
#define __BUFFER_H__
@@ -51,6 +51,7 @@ class Buffer : public Handle {
off_t wseek(off_t, int = SEEK_SET) throw (GeneralException);
off_t wtell() const;
void reset();
+ const Byte * GetBuffer() const;
private:
Byte * buffer, zero;
diff --git a/lib/Buffer.cc b/lib/Buffer.cc
index 58a8cd0..575503c 100644
--- a/lib/Buffer.cc
+++ b/lib/Buffer.cc
@@ -17,7 +17,7 @@
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*/
-/* $Id: Buffer.cc,v 1.27 2007-05-30 11:57:09 pixel Exp $ */
+/* $Id: Buffer.cc,v 1.28 2007-06-23 15:36:02 pixel Exp $ */
#include <string.h>
#ifdef HAVE_CONFIG_H
@@ -155,6 +155,14 @@ Byte & Buffer::operator[](size_t p) {
}
}
+const Byte * Buffer::GetBuffer() const {
+ if (seekable) {
+ return buffer;
+ } else {
+ return buffer + ptr;
+ }
+}
+
bool Buffer::CanSeek() const {
return seekable;
}