summaryrefslogtreecommitdiff
path: root/core/fxcrt/fx_stream.h
diff options
context:
space:
mode:
Diffstat (limited to 'core/fxcrt/fx_stream.h')
-rw-r--r--core/fxcrt/fx_stream.h5
1 files changed, 5 insertions, 0 deletions
diff --git a/core/fxcrt/fx_stream.h b/core/fxcrt/fx_stream.h
index b41d413723..5d473782a4 100644
--- a/core/fxcrt/fx_stream.h
+++ b/core/fxcrt/fx_stream.h
@@ -28,6 +28,11 @@ FX_FileHandle* FX_OpenFolder(const char* path);
bool FX_GetNextFile(FX_FileHandle* handle, ByteString* filename, bool* bFolder);
void FX_CloseFolder(FX_FileHandle* handle);
+// Used with std::unique_ptr to automatically call FX_CloseFolder().
+struct FxFolderHandleCloser {
+ inline void operator()(FX_FileHandle* h) const { FX_CloseFolder(h); }
+};
+
#define FX_FILEMODE_ReadOnly 1
#define FX_FILEMODE_Truncate 2