[poppler] poppler/FlateStream.cc poppler/FlateStream.h

Albert Astals Cid aacid at kemper.freedesktop.org
Sun Dec 5 04:07:11 PST 2010


 poppler/FlateStream.cc |    9 ++++++---
 poppler/FlateStream.h  |    9 +++++++++
 2 files changed, 15 insertions(+), 3 deletions(-)

New commits:
commit f96f6a06cdc33b4654669ac74d5abd0d546a127d
Author: Albert Astals Cid <aacid at kde.org>
Date:   Sun Dec 5 12:06:21 2010 +0000

    Adapt the zlib-base FlateStream code to API changes
    
    Bug 32065

diff --git a/poppler/FlateStream.cc b/poppler/FlateStream.cc
index 487ce94..ef477b3 100644
--- a/poppler/FlateStream.cc
+++ b/poppler/FlateStream.cc
@@ -3,6 +3,7 @@
 // FlateStream.cc
 //
 // Copyright (C) 2005, Jeff Muizelaar <jeff at infidigm.net>
+// Copyright (C) 2010, Albert Astals Cid <aacid at kde.org>
 //
 // This file is under the GPLv2 or later license
 //
@@ -44,10 +45,12 @@ void FlateStream::reset() {
 }
 
 int FlateStream::getRawChar() {
-  if (fill_buffer())
-    return EOF;
+  return doGetRawChar();
+}
 
-  return out_buf[out_pos++];
+void FlateStream::getRawChars(int nChars, int *buffer) {
+  for (int i = 0; i < nChars; ++i)
+    buffer[i] = doGetRawChar();
 }
 
 int FlateStream::getChar() {
diff --git a/poppler/FlateStream.h b/poppler/FlateStream.h
index f4be9e4..99b3d0a 100644
--- a/poppler/FlateStream.h
+++ b/poppler/FlateStream.h
@@ -3,6 +3,7 @@
 // FlateStream.h
 //
 // Copyright (C) 2005, Jeff Muizelaar <jeff at infidigm.net>
+// Copyright (C) 2010, Albert Astals Cid <aacid at kde.org>
 //
 // This file is under the GPLv2 or later license
 //
@@ -51,10 +52,18 @@ public:
   virtual int getChar();
   virtual int lookChar();
   virtual int getRawChar();
+  virtual void getRawChars(int nChars, int *buffer);
   virtual GooString *getPSFilter(int psLevel, char *indent);
   virtual GBool isBinary(GBool last = gTrue);
 
 private:
+  inline int doGetRawChar() {
+    if (fill_buffer())
+      return EOF;
+
+    return out_buf[out_pos++];
+  }
+
   int fill_buffer(void);
   z_stream d_stream;
   StreamPredictor *pred;


More information about the poppler mailing list