OLD | NEW |
1 // Copyright 2014 PDFium Authors. All rights reserved. | 1 // Copyright 2014 PDFium Authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 // Original code copyright 2014 Foxit Software Inc. http://www.foxitsoftware.com | 5 // Original code copyright 2014 Foxit Software Inc. http://www.foxitsoftware.com |
6 | 6 |
7 #include "../include/fsdk_define.h" | 7 #include "../include/fsdk_define.h" |
8 #include "../include/fsdk_mgr.h" | 8 #include "../include/fsdk_mgr.h" |
9 #include "../include/fpdfview.h" | 9 #include "../include/fpdfview.h" |
10 #include "../include/fsdk_rendercontext.h" | 10 #include "../include/fsdk_rendercontext.h" |
(...skipping 180 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
191 if (err_code) { | 191 if (err_code) { |
192 delete pParser; | 192 delete pParser; |
193 ProcessParseError(err_code); | 193 ProcessParseError(err_code); |
194 return NULL; | 194 return NULL; |
195 } | 195 } |
196 return pParser->GetDocument(); | 196 return pParser->GetDocument(); |
197 } | 197 } |
198 | 198 |
199 extern void CheckUnSupportError(CPDF_Document * pDoc, FX_DWORD err_code); | 199 extern void CheckUnSupportError(CPDF_Document * pDoc, FX_DWORD err_code); |
200 | 200 |
201 class CMemFile FX_FINAL: public IFX_FileRead, public CFX_Object | 201 class CMemFile FX_FINAL: public IFX_FileRead |
202 { | 202 { |
203 public: | 203 public: |
204 CMemFile(FX_BYTE* pBuf, FX_FILESIZE size):m_pBuf(pBuf),m_size(size) {} | 204 CMemFile(FX_BYTE* pBuf, FX_FILESIZE size):m_pBuf(pBuf),m_size(size) {} |
205 | 205 |
206 virtual void Release() {delete this;} | 206 virtual void Release() {delete this;} |
207 virtual FX_FILESIZE GetSize() {return m_size;} | 207 virtual FX_FILESIZE GetSize() {return m_size;} |
208 virtual FX_BOOL ReadBlock(void* buffer, FX_FILESIZE offs
et, size_t size) | 208 virtual FX_BOOL ReadBlock(void* buffer, FX_FILESIZE offs
et, size_t size) |
209 { | 209 { |
210 if (offset < 0) { | 210 if (offset < 0) { |
211 return FALSE; | 211 return FALSE; |
(...skipping 651 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
863 if (!buffer) { | 863 if (!buffer) { |
864 buflen = len; | 864 buflen = len; |
865 } else if (buflen >= len) { | 865 } else if (buflen >= len) { |
866 memcpy(buffer, utf16Name.c_str(), len); | 866 memcpy(buffer, utf16Name.c_str(), len); |
867 buflen = len; | 867 buflen = len; |
868 } else { | 868 } else { |
869 buflen = -1; | 869 buflen = -1; |
870 } | 870 } |
871 return (FPDF_DEST)pDestObj; | 871 return (FPDF_DEST)pDestObj; |
872 } | 872 } |
OLD | NEW |