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

Unified Diff: core/fxcrt/fx_stream.h

Issue 2419433004: Clean up fx_basic_util a little (Closed)
Patch Set: Comments 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
« no previous file with comments | « core/fxcrt/fx_basic_util.cpp ('k') | core/fxge/android/fpf_skiafontmgr.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: core/fxcrt/fx_stream.h
diff --git a/core/fxcrt/fx_stream.h b/core/fxcrt/fx_stream.h
index 5a5a650650ccf5c38a571697a8cbb97f7f19c321..047fedf9bb12a7c122d9b8efdc4bdb57ce112b82 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 <direct.h>
+
+class CFindFileDataA;
+
+typedef CFindFileDataA FX_FileHandle;
#define FX_FILESIZE int32_t
#else
+#include <dirent.h>
#include <fcntl.h>
#include <sys/stat.h>
+#include <sys/types.h>
#include <unistd.h>
#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_
« no previous file with comments | « core/fxcrt/fx_basic_util.cpp ('k') | core/fxge/android/fpf_skiafontmgr.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698