summaryrefslogtreecommitdiff
path: root/public/panorama/uifileresource.h
diff options
context:
space:
mode:
authorFluorescentCIAAfricanAmerican <[email protected]>2020-04-22 12:56:21 -0400
committerFluorescentCIAAfricanAmerican <[email protected]>2020-04-22 12:56:21 -0400
commit3bf9df6b2785fa6d951086978a3e66f49427166a (patch)
tree2c0f1f0c63c4832882bc93814ebd2c2b1c6224e5 /public/panorama/uifileresource.h
downloadarchived-source-engine-2018-hl2-src-master.tar.xz
archived-source-engine-2018-hl2-src-master.zip
Diffstat (limited to 'public/panorama/uifileresource.h')
-rw-r--r--public/panorama/uifileresource.h87
1 files changed, 87 insertions, 0 deletions
diff --git a/public/panorama/uifileresource.h b/public/panorama/uifileresource.h
new file mode 100644
index 0000000..102875c
--- /dev/null
+++ b/public/panorama/uifileresource.h
@@ -0,0 +1,87 @@
+//=========== Copyright Valve Corporation, All rights reserved. ===============//
+//
+// Purpose:
+//=============================================================================//
+
+#ifndef UIFILERESOURCE_H
+#define UIFILERESOURCE_H
+
+
+#ifdef _WIN32
+#pragma once
+#endif
+
+#include "tier1/utlstring.h"
+
+namespace panorama
+{
+
+//
+// A file reference container, you pass in an opaque string and it interprets what kind of reference is it
+// Supports local file and HTTP url right now
+//
+class CFileResource
+{
+public:
+ CFileResource();
+ CFileResource( const char *pchUTF8Path );
+ CFileResource( const CFileResource &src) { operator=(src); }
+ ~CFileResource();
+
+ bool BIsValid() const;
+ bool BIsHTTPURL() const;
+ bool BIsLocalPath() const;
+ bool BIsSMBShare() const;
+ const CUtlVector<CUtlString> &GetCookieHeadersForHTTPURL() const;
+
+ const CUtlString &GetReferencePath() const;
+ CUtlString &GetReferencePathForModify();
+
+ void Set( const char *pchUTF8Path );
+ CFileResource &operator=( const CFileResource & src);
+ bool operator<( const CFileResource &left ) const;
+ bool operator==( const CFileResource &left);
+#ifdef DBGFLAG_VALIDATE
+ void Validate( CValidator &validator, const tchar *pchName )
+ {
+ VALIDATE_SCOPE();
+ ValidateObj( m_sReference );
+ ValidateObj( m_vecCookieHeaders );
+ FOR_EACH_VEC( m_vecCookieHeaders, iVec )
+ ValidateObj( m_vecCookieHeaders[iVec] );
+ }
+#endif
+private:
+
+ enum EReferenceType
+ {
+ eNone,
+ eHTTPURL,
+ eFile,
+ eSMB,
+ eSource2Relative
+ };
+ EReferenceType m_eRefType;
+ CUtlString m_sReference;
+
+ // Only used for eHTTPURL type
+ CUtlVector<CUtlString> m_vecCookieHeaders;
+};
+
+
+//-----------------------------------------------------------------------------
+// Purpose: ResourceImage types
+//-----------------------------------------------------------------------------
+enum EResourceImageType
+{
+ k_EResourceImageTypeUnknown = 0,
+ k_EResourceImageTypeImage,
+ k_EResourceImageTypeMovie
+};
+
+// Function to determine resource type for a file resource
+EResourceImageType DetermineResourceType( const CFileResource &resource );
+
+} // namespace panorama
+
+#endif // UIFILERESOURCE_H \ No newline at end of file