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 "core/fxcrt/include/fx_basic.h" | 7 #include "core/fxcrt/include/fx_basic.h" |
8 #include "core/fxcrt/include/fx_ext.h" | 8 #include "core/fxcrt/include/fx_ext.h" |
9 | 9 |
10 #if _FXM_PLATFORM_ != _FXM_PLATFORM_WINDOWS_ | 10 #if _FXM_PLATFORM_ != _FXM_PLATFORM_WINDOWS_ |
(...skipping 99 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
110 } | 110 } |
111 #endif // _FXM_PLATFORM_WINDOWS_ && _MSC_VER < 1900 | 111 #endif // _FXM_PLATFORM_WINDOWS_ && _MSC_VER < 1900 |
112 | 112 |
113 #if _FXM_PLATFORM_ == _FXM_PLATFORM_WINDOWS_ | 113 #if _FXM_PLATFORM_ == _FXM_PLATFORM_WINDOWS_ |
114 class CFindFileData { | 114 class CFindFileData { |
115 public: | 115 public: |
116 virtual ~CFindFileData() {} | 116 virtual ~CFindFileData() {} |
117 HANDLE m_Handle; | 117 HANDLE m_Handle; |
118 FX_BOOL m_bEnd; | 118 FX_BOOL m_bEnd; |
119 }; | 119 }; |
| 120 |
120 class CFindFileDataA : public CFindFileData { | 121 class CFindFileDataA : public CFindFileData { |
121 public: | 122 public: |
122 virtual ~CFindFileDataA() {} | 123 ~CFindFileDataA() override {} |
123 WIN32_FIND_DATAA m_FindData; | 124 WIN32_FIND_DATAA m_FindData; |
124 }; | 125 }; |
| 126 |
125 class CFindFileDataW : public CFindFileData { | 127 class CFindFileDataW : public CFindFileData { |
126 public: | 128 public: |
127 virtual ~CFindFileDataW() {} | 129 ~CFindFileDataW() override {} |
128 WIN32_FIND_DATAW m_FindData; | 130 WIN32_FIND_DATAW m_FindData; |
129 }; | 131 }; |
130 #endif | 132 #endif |
131 | 133 |
132 void* FX_OpenFolder(const FX_CHAR* path) { | 134 void* FX_OpenFolder(const FX_CHAR* path) { |
133 #if _FXM_PLATFORM_ == _FXM_PLATFORM_WINDOWS_ | 135 #if _FXM_PLATFORM_ == _FXM_PLATFORM_WINDOWS_ |
134 std::unique_ptr<CFindFileDataA> pData(new CFindFileDataA); | 136 std::unique_ptr<CFindFileDataA> pData(new CFindFileDataA); |
135 pData->m_Handle = FindFirstFileExA((CFX_ByteString(path) + "/*.*").c_str(), | 137 pData->m_Handle = FindFirstFileExA((CFX_ByteString(path) + "/*.*").c_str(), |
136 FindExInfoStandard, &pData->m_FindData, | 138 FindExInfoStandard, &pData->m_FindData, |
137 FindExSearchNameMatch, nullptr, 0); | 139 FindExSearchNameMatch, nullptr, 0); |
(...skipping 152 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
290 dstShift -= 8; | 292 dstShift -= 8; |
291 result |= *dataPtr++ << dstShift; | 293 result |= *dataPtr++ << dstShift; |
292 } | 294 } |
293 if (dstShift > 0) { | 295 if (dstShift > 0) { |
294 bitShift = 8 - dstShift; | 296 bitShift = 8 - dstShift; |
295 bitMask = (1 << dstShift) - 1; | 297 bitMask = (1 << dstShift) - 1; |
296 result |= *dataPtr++ >> bitShift & bitMask; | 298 result |= *dataPtr++ >> bitShift & bitMask; |
297 } | 299 } |
298 return result; | 300 return result; |
299 } | 301 } |
OLD | NEW |