Index: experimental/PdfViewer/pdfparser/native/SkNativeParsedPDF.h |
=================================================================== |
--- experimental/PdfViewer/pdfparser/native/SkNativeParsedPDF.h (revision 10286) |
+++ experimental/PdfViewer/pdfparser/native/SkNativeParsedPDF.h (working copy) |
@@ -19,6 +19,8 @@ |
class SkPdfNativeTokenizer; |
+class SkStream; |
+ |
class SkNativeParsedPDF { |
private: |
struct PublicObjectEntry { |
@@ -35,7 +37,10 @@ |
// TODO(edisonn): read page N asap, read all file |
// TODO(edisonn): allow corruptions of file (e.g. missing endobj, missing stream length, ...) |
// TODO(edisonn): encryption |
+ |
SkNativeParsedPDF(const char* path); |
+ SkNativeParsedPDF(SkStream* stream); |
+ |
~SkNativeParsedPDF(); |
int pages() const; |
@@ -65,6 +70,9 @@ |
private: |
+ // Takes ownership of bytes. |
+ void init(const void* bytes, size_t length); |
+ |
const unsigned char* readCrossReferenceSection(const unsigned char* xrefStart, const unsigned char* trailerEnd); |
long readTrailer(const unsigned char* trailerStart, const unsigned char* trailerEnd, bool storeCatalog); |