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 38 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
49 m_hFile = FXSYS_fopen(fileName.GetCStr(), (FX_LPCSTR)strMode); | 49 m_hFile = FXSYS_fopen(fileName.GetCStr(), (FX_LPCSTR)strMode); |
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(), (FX_LPCWSTR)strMode); | 59 m_hFile = FXSYS_wfopen(fileName.GetPtr(), strMode.c_str()); |
60 return m_hFile != NULL; | 60 return m_hFile != NULL; |
61 } | 61 } |
62 void CFXCRT_FileAccess_CRT::Close() | 62 void CFXCRT_FileAccess_CRT::Close() |
63 { | 63 { |
64 if (!m_hFile) { | 64 if (!m_hFile) { |
65 return; | 65 return; |
66 } | 66 } |
67 FXSYS_fclose(m_hFile); | 67 FXSYS_fclose(m_hFile); |
68 m_hFile = NULL; | 68 m_hFile = NULL; |
69 } | 69 } |
(...skipping 116 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 |