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 #include <cctype> | 10 #include <cctype> |
(...skipping 192 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
203 class CFindFileDataW : public CFindFileData { | 203 class CFindFileDataW : public CFindFileData { |
204 public: | 204 public: |
205 virtual ~CFindFileDataW() {} | 205 virtual ~CFindFileDataW() {} |
206 WIN32_FIND_DATAW m_FindData; | 206 WIN32_FIND_DATAW m_FindData; |
207 }; | 207 }; |
208 #endif | 208 #endif |
209 void* FX_OpenFolder(const FX_CHAR* path) { | 209 void* FX_OpenFolder(const FX_CHAR* path) { |
210 #if _FXM_PLATFORM_ == _FXM_PLATFORM_WINDOWS_ | 210 #if _FXM_PLATFORM_ == _FXM_PLATFORM_WINDOWS_ |
211 #ifndef _WIN32_WCE | 211 #ifndef _WIN32_WCE |
212 CFindFileDataA* pData = new CFindFileDataA; | 212 CFindFileDataA* pData = new CFindFileDataA; |
213 pData->m_Handle = | 213 pData->m_Handle = FindFirstFileExA((CFX_ByteString(path) + "/*.*").c_str(), |
214 FindFirstFileExA(CFX_ByteString(path) + "/*.*", FindExInfoStandard, | 214 FindExInfoStandard, &pData->m_FindData, |
215 &pData->m_FindData, FindExSearchNameMatch, NULL, 0); | 215 FindExSearchNameMatch, NULL, 0); |
216 #else | 216 #else |
217 CFindFileDataW* pData = new CFindFileDataW; | 217 CFindFileDataW* pData = new CFindFileDataW; |
218 pData->m_Handle = FindFirstFileW(CFX_WideString::FromLocal(path) + L"/*.*", | 218 pData->m_Handle = FindFirstFileW(CFX_WideString::FromLocal(path) + L"/*.*", |
219 &pData->m_FindData); | 219 &pData->m_FindData); |
220 #endif | 220 #endif |
221 if (pData->m_Handle == INVALID_HANDLE_VALUE) { | 221 if (pData->m_Handle == INVALID_HANDLE_VALUE) { |
222 delete pData; | 222 delete pData; |
223 return NULL; | 223 return NULL; |
224 } | 224 } |
225 pData->m_bEnd = FALSE; | 225 pData->m_bEnd = FALSE; |
226 return pData; | 226 return pData; |
227 #else | 227 #else |
228 DIR* dir = opendir(path); | 228 DIR* dir = opendir(path); |
229 return dir; | 229 return dir; |
230 #endif | 230 #endif |
231 } | 231 } |
232 void* FX_OpenFolder(const FX_WCHAR* path) { | 232 void* FX_OpenFolder(const FX_WCHAR* path) { |
233 #if _FXM_PLATFORM_ == _FXM_PLATFORM_WINDOWS_ | 233 #if _FXM_PLATFORM_ == _FXM_PLATFORM_WINDOWS_ |
234 CFindFileDataW* pData = new CFindFileDataW; | 234 CFindFileDataW* pData = new CFindFileDataW; |
235 pData->m_Handle = FindFirstFileExW((CFX_WideString(path) + L"/*.*").c_str(), | 235 pData->m_Handle = FindFirstFileExW((CFX_WideString(path) + L"/*.*").c_str(), |
236 FindExInfoStandard, &pData->m_FindData, | 236 FindExInfoStandard, &pData->m_FindData, |
237 FindExSearchNameMatch, NULL, 0); | 237 FindExSearchNameMatch, NULL, 0); |
238 if (pData->m_Handle == INVALID_HANDLE_VALUE) { | 238 if (pData->m_Handle == INVALID_HANDLE_VALUE) { |
239 delete pData; | 239 delete pData; |
240 return NULL; | 240 return NULL; |
241 } | 241 } |
242 pData->m_bEnd = FALSE; | 242 pData->m_bEnd = FALSE; |
243 return pData; | 243 return pData; |
244 #else | 244 #else |
245 DIR* dir = opendir(CFX_ByteString::FromUnicode(path)); | 245 DIR* dir = opendir(CFX_ByteString::FromUnicode(path).c_str()); |
246 return dir; | 246 return dir; |
247 #endif | 247 #endif |
248 } | 248 } |
249 FX_BOOL FX_GetNextFile(void* handle, | 249 FX_BOOL FX_GetNextFile(void* handle, |
250 CFX_ByteString& filename, | 250 CFX_ByteString& filename, |
251 FX_BOOL& bFolder) { | 251 FX_BOOL& bFolder) { |
252 if (!handle) { | 252 if (!handle) { |
253 return FALSE; | 253 return FALSE; |
254 } | 254 } |
255 #if _FXM_PLATFORM_ == _FXM_PLATFORM_WINDOWS_ | 255 #if _FXM_PLATFORM_ == _FXM_PLATFORM_WINDOWS_ |
(...skipping 102 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
358 d * m.b + e * m.e + f * m.h, d * m.c + e * m.f + f * m.i, | 358 d * m.b + e * m.e + f * m.h, d * m.c + e * m.f + f * m.i, |
359 g * m.a + h * m.d + i * m.g, g * m.b + h * m.e + i * m.h, | 359 g * m.a + h * m.d + i * m.g, g * m.b + h * m.e + i * m.h, |
360 g * m.c + h * m.f + i * m.i); | 360 g * m.c + h * m.f + i * m.i); |
361 } | 361 } |
362 | 362 |
363 CFX_Vector_3by1 CFX_Matrix_3by3::TransformVector(const CFX_Vector_3by1& v) { | 363 CFX_Vector_3by1 CFX_Matrix_3by3::TransformVector(const CFX_Vector_3by1& v) { |
364 return CFX_Vector_3by1(a * v.a + b * v.b + c * v.c, | 364 return CFX_Vector_3by1(a * v.a + b * v.b + c * v.c, |
365 d * v.a + e * v.b + f * v.c, | 365 d * v.a + e * v.b + f * v.c, |
366 g * v.a + h * v.b + i * v.c); | 366 g * v.a + h * v.b + i * v.c); |
367 } | 367 } |
OLD | NEW |