| 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/fxcrt/fx_basic.h" | 7 #include "../../include/fxcrt/fx_basic.h" |
| 8 #include "../../include/fxcrt/fx_ext.h" | 8 #include "../../include/fxcrt/fx_ext.h" |
| 9 #include "extension.h" | 9 #include "extension.h" |
| 10 #if _FXM_PLATFORM_ == _FXM_PLATFORM_WINDOWS_ | 10 #if _FXM_PLATFORM_ == _FXM_PLATFORM_WINDOWS_ |
| (...skipping 18 matching lines...) Expand all Loading... |
| 29 IFXCRT_FileAccess* pFA = FXCRT_FileAccess_Create(); | 29 IFXCRT_FileAccess* pFA = FXCRT_FileAccess_Create(); |
| 30 if (!pFA) { | 30 if (!pFA) { |
| 31 return NULL; | 31 return NULL; |
| 32 } | 32 } |
| 33 if (!pFA->Open(filename, dwModes)) { | 33 if (!pFA->Open(filename, dwModes)) { |
| 34 pFA->Release(); | 34 pFA->Release(); |
| 35 return NULL; | 35 return NULL; |
| 36 } | 36 } |
| 37 return new CFX_CRTFileStream(pFA); | 37 return new CFX_CRTFileStream(pFA); |
| 38 } | 38 } |
| 39 IFX_FileWrite* FX_CreateFileWrite(const FX_CHAR* filename) { | |
| 40 return FX_CreateFileStream(filename, FX_FILEMODE_Truncate); | |
| 41 } | |
| 42 IFX_FileWrite* FX_CreateFileWrite(const FX_WCHAR* filename) { | |
| 43 return FX_CreateFileStream(filename, FX_FILEMODE_Truncate); | |
| 44 } | |
| 45 IFX_FileRead* FX_CreateFileRead(const FX_CHAR* filename) { | 39 IFX_FileRead* FX_CreateFileRead(const FX_CHAR* filename) { |
| 46 return FX_CreateFileStream(filename, FX_FILEMODE_ReadOnly); | 40 return FX_CreateFileStream(filename, FX_FILEMODE_ReadOnly); |
| 47 } | 41 } |
| 48 IFX_FileRead* FX_CreateFileRead(const FX_WCHAR* filename) { | 42 IFX_FileRead* FX_CreateFileRead(const FX_WCHAR* filename) { |
| 49 return FX_CreateFileStream(filename, FX_FILEMODE_ReadOnly); | 43 return FX_CreateFileStream(filename, FX_FILEMODE_ReadOnly); |
| 50 } | 44 } |
| 51 IFX_MemoryStream* FX_CreateMemoryStream(uint8_t* pBuffer, | 45 IFX_MemoryStream* FX_CreateMemoryStream(uint8_t* pBuffer, |
| 52 size_t dwSize, | 46 size_t dwSize, |
| 53 FX_BOOL bTakeOver) { | 47 FX_BOOL bTakeOver) { |
| 54 return new CFX_MemoryStream(pBuffer, dwSize, bTakeOver); | 48 return new CFX_MemoryStream(pBuffer, dwSize, bTakeOver); |
| (...skipping 244 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 299 void FX_Random_GenerateCrypto(FX_DWORD* pBuffer, int32_t iCount) { | 293 void FX_Random_GenerateCrypto(FX_DWORD* pBuffer, int32_t iCount) { |
| 300 #if _FXM_PLATFORM_ == _FXM_PLATFORM_WINDOWS_ | 294 #if _FXM_PLATFORM_ == _FXM_PLATFORM_WINDOWS_ |
| 301 FX_GenerateCryptoRandom(pBuffer, iCount); | 295 FX_GenerateCryptoRandom(pBuffer, iCount); |
| 302 #else | 296 #else |
| 303 FX_Random_GenerateBase(pBuffer, iCount); | 297 FX_Random_GenerateBase(pBuffer, iCount); |
| 304 #endif | 298 #endif |
| 305 } | 299 } |
| 306 #ifdef __cplusplus | 300 #ifdef __cplusplus |
| 307 } | 301 } |
| 308 #endif | 302 #endif |
| OLD | NEW |