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_ext.h" | 7 #include "../../include/fxcrt/fx_ext.h" |
8 #include "fxcrt_platforms.h" | 8 #include "fxcrt_platforms.h" |
9 #if (_FXM_PLATFORM_ != _FXM_PLATFORM_WINDOWS_ && _FXM_PLATFORM_ != _FXM_PLATFORM
_LINUX_ && _FXM_PLATFORM_ != _FXM_PLATFORM_APPLE_ && _FXM_PLATFORM_ != _FXM_PLAT
FORM_ANDROID_) | 9 #if (_FXM_PLATFORM_ != _FXM_PLATFORM_WINDOWS_ && _FXM_PLATFORM_ != _FXM_PLATFORM
_LINUX_ && _FXM_PLATFORM_ != _FXM_PLATFORM_APPLE_ && _FXM_PLATFORM_ != _FXM_PLAT
FORM_ANDROID_) |
10 IFXCRT_FileAccess* FXCRT_FileAccess_Create() | 10 IFXCRT_FileAccess* FXCRT_FileAccess_Create() |
(...skipping 28 matching lines...) Expand all Loading... |
39 { | 39 { |
40 Close(); | 40 Close(); |
41 } | 41 } |
42 FX_BOOL CFXCRT_FileAccess_CRT::Open(FX_BSTR fileName, FX_DWORD dwMode) | 42 FX_BOOL CFXCRT_FileAccess_CRT::Open(FX_BSTR fileName, FX_DWORD dwMode) |
43 { | 43 { |
44 if (m_hFile) { | 44 if (m_hFile) { |
45 return FALSE; | 45 return FALSE; |
46 } | 46 } |
47 CFX_ByteString strMode; | 47 CFX_ByteString strMode; |
48 FXCRT_GetFileModeString(dwMode, strMode); | 48 FXCRT_GetFileModeString(dwMode, strMode); |
49 m_hFile = FXSYS_fopen(fileName.GetCStr(), (FX_LPCSTR)strMode); | 49 m_hFile = FXSYS_fopen(fileName.GetCStr(), strMode.c_str()); |
50 return m_hFile != NULL; | 50 return m_hFile != NULL; |
51 } | 51 } |
52 FX_BOOL CFXCRT_FileAccess_CRT::Open(FX_WSTR fileName, FX_DWORD dwMode) | 52 FX_BOOL CFXCRT_FileAccess_CRT::Open(FX_WSTR fileName, FX_DWORD dwMode) |
53 { | 53 { |
54 if (m_hFile) { | 54 if (m_hFile) { |
55 return FALSE; | 55 return FALSE; |
56 } | 56 } |
57 CFX_WideString strMode; | 57 CFX_WideString strMode; |
58 FXCRT_GetFileModeString(dwMode, strMode); | 58 FXCRT_GetFileModeString(dwMode, strMode); |
59 m_hFile = FXSYS_wfopen(fileName.GetPtr(), strMode.c_str()); | 59 m_hFile = FXSYS_wfopen(fileName.GetPtr(), strMode.c_str()); |
(...skipping 126 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
186 } | 186 } |
187 FX_BOOL FX_File_Move(FX_BSTR fileNameSrc, FX_BSTR fileNameDst) | 187 FX_BOOL FX_File_Move(FX_BSTR fileNameSrc, FX_BSTR fileNameDst) |
188 { | 188 { |
189 return rename(fileNameSrc.GetCStr(), fileNameDst.GetCStr()); | 189 return rename(fileNameSrc.GetCStr(), fileNameDst.GetCStr()); |
190 } | 190 } |
191 FX_BOOL FX_File_Move(FX_WSTR fileNameSrc, FX_WSTR fileNameDst) | 191 FX_BOOL FX_File_Move(FX_WSTR fileNameSrc, FX_WSTR fileNameDst) |
192 { | 192 { |
193 return FX_File_Move(FX_UTF8Encode(fileNameSrc), FX_UTF8Encode(fileNameDst)); | 193 return FX_File_Move(FX_UTF8Encode(fileNameSrc), FX_UTF8Encode(fileNameDst)); |
194 } | 194 } |
195 #endif | 195 #endif |
OLD | NEW |