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_string.h" | |
8 #include "fxcrt_windows.h" | 7 #include "fxcrt_windows.h" |
9 | 8 |
| 9 #include "core/include/fxcrt/fx_string.h" |
| 10 |
10 #if _FXM_PLATFORM_ == _FXM_PLATFORM_WINDOWS_ | 11 #if _FXM_PLATFORM_ == _FXM_PLATFORM_WINDOWS_ |
11 FX_BOOL FX_File_Exist(const CFX_ByteStringC& fileName) { | 12 FX_BOOL FX_File_Exist(const CFX_ByteStringC& fileName) { |
12 FX_DWORD dwAttri = ::GetFileAttributesA(fileName.GetCStr()); | 13 FX_DWORD dwAttri = ::GetFileAttributesA(fileName.GetCStr()); |
13 if (dwAttri == -1) { | 14 if (dwAttri == -1) { |
14 return FALSE; | 15 return FALSE; |
15 } | 16 } |
16 return (dwAttri & FILE_ATTRIBUTE_DIRECTORY) == 0; | 17 return (dwAttri & FILE_ATTRIBUTE_DIRECTORY) == 0; |
17 } | 18 } |
18 FX_BOOL FX_File_Exist(const CFX_WideStringC& fileName) { | 19 FX_BOOL FX_File_Exist(const CFX_WideStringC& fileName) { |
19 FX_DWORD dwAttri = ::GetFileAttributesW((LPCWSTR)fileName.GetPtr()); | 20 FX_DWORD dwAttri = ::GetFileAttributesW((LPCWSTR)fileName.GetPtr()); |
(...skipping 180 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
200 FX_BOOL FX_File_Move(const CFX_ByteStringC& fileNameSrc, | 201 FX_BOOL FX_File_Move(const CFX_ByteStringC& fileNameSrc, |
201 const CFX_ByteStringC& fileNameDst) { | 202 const CFX_ByteStringC& fileNameDst) { |
202 return ::MoveFileA(fileNameSrc.GetCStr(), fileNameDst.GetCStr()); | 203 return ::MoveFileA(fileNameSrc.GetCStr(), fileNameDst.GetCStr()); |
203 } | 204 } |
204 FX_BOOL FX_File_Move(const CFX_WideStringC& fileNameSrc, | 205 FX_BOOL FX_File_Move(const CFX_WideStringC& fileNameSrc, |
205 const CFX_WideStringC& fileNameDst) { | 206 const CFX_WideStringC& fileNameDst) { |
206 return ::MoveFileW((LPCWSTR)fileNameSrc.GetPtr(), | 207 return ::MoveFileW((LPCWSTR)fileNameSrc.GetPtr(), |
207 (LPCWSTR)fileNameDst.GetPtr()); | 208 (LPCWSTR)fileNameDst.GetPtr()); |
208 } | 209 } |
209 #endif | 210 #endif |
OLD | NEW |