| 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_posix.h" | 8 #include "fxcrt_posix.h" |
| 9 #if _FXM_PLATFORM_ == _FXM_PLATFORM_LINUX_ || _FXM_PLATFORM_ == _FXM_PLATFORM_AP
PLE_ || _FXM_PLATFORM_ == _FXM_PLATFORM_ANDROID_ | 9 #if _FXM_PLATFORM_ == _FXM_PLATFORM_LINUX_ || _FXM_PLATFORM_ == _FXM_PLATFORM_AP
PLE_ || _FXM_PLATFORM_ == _FXM_PLATFORM_ANDROID_ |
| 10 IFXCRT_FileAccess* FXCRT_FileAccess_Create() | 10 IFXCRT_FileAccess* FXCRT_FileAccess_Create() |
| 11 { | 11 { |
| 12 return FX_NEW CFXCRT_FileAccess_Posix; | 12 return new CFXCRT_FileAccess_Posix; |
| 13 } | 13 } |
| 14 void FXCRT_Posix_GetFileMode(FX_DWORD dwModes, FX_INT32 &nFlags, FX_INT32 &nMask
s) | 14 void FXCRT_Posix_GetFileMode(FX_DWORD dwModes, FX_INT32 &nFlags, FX_INT32 &nMask
s) |
| 15 { | 15 { |
| 16 nFlags = O_BINARY | O_LARGEFILE; | 16 nFlags = O_BINARY | O_LARGEFILE; |
| 17 if (dwModes & FX_FILEMODE_ReadOnly) { | 17 if (dwModes & FX_FILEMODE_ReadOnly) { |
| 18 nFlags |= O_RDONLY; | 18 nFlags |= O_RDONLY; |
| 19 nMasks = 0; | 19 nMasks = 0; |
| 20 } else { | 20 } else { |
| 21 nFlags |= O_RDWR | O_CREAT; | 21 nFlags |= O_RDWR | O_CREAT; |
| 22 if (dwModes & FX_FILEMODE_Truncate) { | 22 if (dwModes & FX_FILEMODE_Truncate) { |
| (...skipping 161 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 184 } | 184 } |
| 185 FX_BOOL FX_File_Move(FX_BSTR fileNameSrc, FX_BSTR fileNameDst) | 185 FX_BOOL FX_File_Move(FX_BSTR fileNameSrc, FX_BSTR fileNameDst) |
| 186 { | 186 { |
| 187 return rename(fileNameSrc.GetCStr(), fileNameDst.GetCStr()); | 187 return rename(fileNameSrc.GetCStr(), fileNameDst.GetCStr()); |
| 188 } | 188 } |
| 189 FX_BOOL FX_File_Move(FX_WSTR fileNameSrc, FX_WSTR fileNameDst) | 189 FX_BOOL FX_File_Move(FX_WSTR fileNameSrc, FX_WSTR fileNameDst) |
| 190 { | 190 { |
| 191 return FX_File_Move(FX_UTF8Encode(fileNameSrc), FX_UTF8Encode(fileNameDst)); | 191 return FX_File_Move(FX_UTF8Encode(fileNameSrc), FX_UTF8Encode(fileNameDst)); |
| 192 } | 192 } |
| 193 #endif | 193 #endif |
| OLD | NEW |