summaryrefslogtreecommitdiff
path: root/public/panorama/iuifilesystem.h
diff options
context:
space:
mode:
Diffstat (limited to 'public/panorama/iuifilesystem.h')
-rw-r--r--public/panorama/iuifilesystem.h51
1 files changed, 51 insertions, 0 deletions
diff --git a/public/panorama/iuifilesystem.h b/public/panorama/iuifilesystem.h
new file mode 100644
index 0000000..10aaf42
--- /dev/null
+++ b/public/panorama/iuifilesystem.h
@@ -0,0 +1,51 @@
+//=========== Copyright Valve Corporation, All rights reserved. ===============//
+//
+// Purpose:
+//=============================================================================//
+
+#ifndef IUIFILESYSTEM_H
+#define IUIFILESYSTEM_H
+
+#ifdef _WIN32
+#pragma once
+#endif
+
+
+#include "panoramatypes.h"
+#include "utlbuffer.h"
+
+namespace panorama
+{
+
+typedef void( __cdecl *FileChangeCallback_t )( const char *pFullPath );
+
+//-----------------------------------------------------------------------------
+// Purpose: FileSystem support
+//-----------------------------------------------------------------------------
+
+typedef void (LoadFileIntoBufferCallback_t)( const char * pchFile, CUtlBuffer &buf, bool bSuccess );
+
+class IUIFileSystem
+{
+public:
+ // fully load the file into the buffer object
+ virtual bool LoadFileIntoBuffer( const char *pchFile, CUtlBuffer &buf, bool bText, FileChangeCallback_t fileChangeCallback = NULL ) = 0;
+
+ virtual void LoadFileIntoBufferAsync( const char *pchFile, CUtlBuffer &buf, bool bText, CUtlDelegate< LoadFileIntoBufferCallback_t > del ) = 0;
+
+ // replace this file with the contents of the buffer object
+ virtual bool SaveBufferToFile( CUtlBuffer &buf, const char *pchFile ) = 0;
+
+ // return true if this file is on disk (or in a resource file)
+ virtual bool FileExists( const char *pchFile ) = 0;
+
+ virtual bool RestoreContentFilename( const char *pchFile, CUtlString &fixedFilename ) { return false; }
+ virtual bool RestoreResourceFilename( const char *pchFile, CUtlString &fixedFilename ) { return false; }
+
+ // Run frame on main thread
+ virtual void RunFrame() = 0;
+};
+
+
+}
+#endif // IUIFILESYSTEM_H