Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(733)

Unified Diff: core/fxcrt/fx_stream.h

Issue 2419433004: Clean up fx_basic_util a little (Closed)
Patch Set: Fix win Created 4 years, 2 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: core/fxcrt/fx_stream.h
diff --git a/core/fxcrt/fx_stream.h b/core/fxcrt/fx_stream.h
index 5a5a650650ccf5c38a571697a8cbb97f7f19c321..fcb219eaa4b2bdcea3b15c5a80a04b5a8f369021 100644
--- a/core/fxcrt/fx_stream.h
+++ b/core/fxcrt/fx_stream.h
@@ -10,15 +10,26 @@
#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);
+#if _FXM_PLATFORM_ != _FXM_PLATFORM_WINDOWS_
+#include <dirent.h>
+#include <sys/types.h>
+#else
+#include <direct.h>
+#endif
+
+#if _FXM_PLATFORM_ == _FXM_PLATFORM_WINDOWS_
+class CFindFileDataA;
+
+typedef CFindFileDataA FX_FileHandle;
+#else
+typedef DIR FX_FileHandle;
dsinclair 2016/10/13 13:45:47 Can this if/else move into the if/else above?
npm 2016/10/13 17:49:01 Done.
+#endif
+
+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();
#if _FXM_PLATFORM_ == _FXM_PLATFORM_WINDOWS_
dsinclair 2016/10/13 13:45:47 Combine with this as well?
npm 2016/10/13 17:49:01 Done.
@@ -159,4 +170,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_

Powered by Google App Engine
This is Rietveld 408576698