From aeb44f8c4675141e170329d5093b251fbfad8023 Mon Sep 17 00:00:00 2001 From: npm Date: Thu, 13 Oct 2016 11:10:03 -0700 Subject: Clean up fx_basic_util a little - Nit fixes. - Remove unused methods. - Replace FX_BOOL with bool. Review-Url: https://codereview.chromium.org/2419433004 --- core/fxcrt/fx_stream.h | 47 ++++++++++++++++++++++++++++++++++++----------- 1 file changed, 36 insertions(+), 11 deletions(-) (limited to 'core/fxcrt/fx_stream.h') diff --git a/core/fxcrt/fx_stream.h b/core/fxcrt/fx_stream.h index 5a5a650650..047fedf9bb 100644 --- a/core/fxcrt/fx_stream.h +++ b/core/fxcrt/fx_stream.h @@ -10,22 +10,18 @@ #include "core/fxcrt/fx_string.h" #include "core/fxcrt/fx_system.h" -void* FX_OpenFolder(const FX_CHAR* path); -void* FX_OpenFolder(const FX_WCHAR* path); -FX_BOOL FX_GetNextFile(void* handle, - CFX_ByteString& filename, - FX_BOOL& bFolder); -FX_BOOL FX_GetNextFile(void* handle, - CFX_WideString& filename, - FX_BOOL& bFolder); -void FX_CloseFolder(void* handle); -FX_WCHAR FX_GetFolderSeparator(); - #if _FXM_PLATFORM_ == _FXM_PLATFORM_WINDOWS_ +#include + +class CFindFileDataA; + +typedef CFindFileDataA FX_FileHandle; #define FX_FILESIZE int32_t #else +#include #include #include +#include #include #ifndef O_BINARY @@ -36,9 +32,17 @@ FX_WCHAR FX_GetFolderSeparator(); #define O_LARGEFILE 0 #endif // O_LARGEFILE +typedef DIR FX_FileHandle; #define FX_FILESIZE off_t #endif // _FXM_PLATFORM_ == _FXM_PLATFORM_WINDOWS_ +FX_FileHandle* FX_OpenFolder(const FX_CHAR* path); +bool FX_GetNextFile(FX_FileHandle* handle, + CFX_ByteString* filename, + bool* bFolder); +void FX_CloseFolder(FX_FileHandle* handle); +FX_WCHAR FX_GetFolderSeparator(); + #define FX_GETBYTEOFFSET32(a) 0 #define FX_GETBYTEOFFSET40(a) 0 #define FX_GETBYTEOFFSET48(a) 0 @@ -159,4 +163,25 @@ class IFX_BufferRead : public IFX_StreamRead { virtual FX_FILESIZE GetBlockOffset() = 0; }; +#if _FXM_PLATFORM_ == _FXM_PLATFORM_WINDOWS_ +class CFindFileData { + public: + virtual ~CFindFileData() {} + HANDLE m_Handle; + bool m_bEnd; +}; + +class CFindFileDataA : public CFindFileData { + public: + ~CFindFileDataA() override {} + WIN32_FIND_DATAA m_FindData; +}; + +class CFindFileDataW : public CFindFileData { + public: + ~CFindFileDataW() override {} + WIN32_FIND_DATAW m_FindData; +}; +#endif + #endif // CORE_FXCRT_FX_STREAM_H_ -- cgit v1.2.3