OLD | NEW |
---|---|
1 /* | 1 /* |
2 * Copyright 2013 Google Inc. | 2 * Copyright 2013 Google Inc. |
3 * | 3 * |
4 * Use of this source code is governed by a BSD-style license that can be | 4 * Use of this source code is governed by a BSD-style license that can be |
5 * found in the LICENSE file. | 5 * found in the LICENSE file. |
6 */ | 6 */ |
7 | 7 |
8 #ifndef SkPdfNativeTokenizer_DEFINED | 8 #ifndef SkPdfNativeTokenizer_DEFINED |
9 #define SkPdfNativeTokenizer_DEFINED | 9 #define SkPdfNativeTokenizer_DEFINED |
10 | 10 |
(...skipping 147 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
158 class SkPdfNativeTokenizer { | 158 class SkPdfNativeTokenizer { |
159 public: | 159 public: |
160 SkPdfNativeTokenizer(SkPdfNativeObject* objWithStream, | 160 SkPdfNativeTokenizer(SkPdfNativeObject* objWithStream, |
161 SkPdfAllocator* allocator, SkPdfNativeDoc* doc); | 161 SkPdfAllocator* allocator, SkPdfNativeDoc* doc); |
162 SkPdfNativeTokenizer(const unsigned char* buffer, int len, | 162 SkPdfNativeTokenizer(const unsigned char* buffer, int len, |
163 SkPdfAllocator* allocator, SkPdfNativeDoc* doc); | 163 SkPdfAllocator* allocator, SkPdfNativeDoc* doc); |
164 | 164 |
165 virtual ~SkPdfNativeTokenizer(); | 165 virtual ~SkPdfNativeTokenizer(); |
166 | 166 |
167 // Reads one token. Returns false if there are no more tokens. | 167 // Reads one token. Returns false if there are no more tokens. |
168 bool readToken(PdfToken* token); | 168 // If write is true, and a token was read, write the difference caused by |
169 // token to a file. | |
170 bool readToken(PdfToken* token, bool write = false); | |
mtklein
2013/11/22 14:46:12
maybe writeDiff?
scroggo
2013/11/22 15:47:16
Done.
| |
169 | 171 |
170 // Put back a token to be read in the nextToken read. Only one token is allo wed to be put | 172 // Put back a token to be read in the nextToken read. Only one token is allo wed to be put |
171 // back. Must not necesaarely be the last token read. | 173 // back. Must not necesaarely be the last token read. |
172 void PutBack(PdfToken token); | 174 void PutBack(PdfToken token); |
173 | 175 |
174 // Reads the inline image that is present in the stream. At this point we ju st consumed the ID | 176 // Reads the inline image that is present in the stream. At this point we ju st consumed the ID |
175 // token already. | 177 // token already. |
176 SkPdfImageDictionary* readInlineImage(); | 178 SkPdfImageDictionary* readInlineImage(); |
177 | 179 |
178 private: | 180 private: |
(...skipping 10 matching lines...) Expand all Loading... | |
189 bool fHasPutBack; | 191 bool fHasPutBack; |
190 PdfToken fPutBack; | 192 PdfToken fPutBack; |
191 }; | 193 }; |
192 | 194 |
193 const unsigned char* nextObject(const unsigned char* start, const unsigned char* end, | 195 const unsigned char* nextObject(const unsigned char* start, const unsigned char* end, |
194 SkPdfNativeObject* token, | 196 SkPdfNativeObject* token, |
195 SkPdfAllocator* allocator, | 197 SkPdfAllocator* allocator, |
196 SkPdfNativeDoc* doc); | 198 SkPdfNativeDoc* doc); |
197 | 199 |
198 #endif // SkPdfNativeTokenizer_DEFINED | 200 #endif // SkPdfNativeTokenizer_DEFINED |
OLD | NEW |