summaryrefslogtreecommitdiff
path: root/external/vpc/public/vstdlib/ikeyvaluessystem.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 /external/vpc/public/vstdlib/ikeyvaluessystem.h
downloadarchived-source-engine-2018-hl2-src-master.tar.xz
archived-source-engine-2018-hl2-src-master.zip
Diffstat (limited to 'external/vpc/public/vstdlib/ikeyvaluessystem.h')
-rw-r--r--external/vpc/public/vstdlib/ikeyvaluessystem.h56
1 files changed, 56 insertions, 0 deletions
diff --git a/external/vpc/public/vstdlib/ikeyvaluessystem.h b/external/vpc/public/vstdlib/ikeyvaluessystem.h
new file mode 100644
index 0000000..3477ed3
--- /dev/null
+++ b/external/vpc/public/vstdlib/ikeyvaluessystem.h
@@ -0,0 +1,56 @@
+//========= Copyright � 1996-2005, Valve Corporation, All rights reserved. ============//
+//
+// Purpose:
+//
+// $NoKeywords: $
+//=============================================================================//
+#ifndef VSTDLIB_IKEYVALUESSYSTEM_H
+#define VSTDLIB_IKEYVALUESSYSTEM_H
+#ifdef _WIN32
+#pragma once
+#endif
+
+#include "vstdlib/vstdlib.h"
+
+// handle to a KeyValues key name symbol
+typedef int HKeySymbol;
+#define INVALID_KEY_SYMBOL (-1)
+
+//-----------------------------------------------------------------------------
+// Purpose: Interface to shared data repository for KeyValues (included in vgui_controls.lib)
+// allows for central data storage point of KeyValues symbol table
+//-----------------------------------------------------------------------------
+class IKeyValuesSystem
+{
+public:
+ // registers the size of the KeyValues in the specified instance
+ // so it can build a properly sized memory pool for the KeyValues objects
+ // the sizes will usually never differ but this is for versioning safety
+ virtual void RegisterSizeofKeyValues(int size) = 0;
+
+ // allocates/frees a KeyValues object from the shared mempool
+ virtual void *AllocKeyValuesMemory(int size) = 0;
+ virtual void FreeKeyValuesMemory(void *pMem) = 0;
+
+ // symbol table access (used for key names)
+ virtual HKeySymbol GetSymbolForString( const char *name, bool bCreate = true ) = 0;
+ virtual const char *GetStringForSymbol(HKeySymbol symbol) = 0;
+
+ // for debugging, adds KeyValues record into global list so we can track memory leaks
+ virtual void AddKeyValuesToMemoryLeakList(void *pMem, HKeySymbol name) = 0;
+ virtual void RemoveKeyValuesFromMemoryLeakList(void *pMem) = 0;
+
+ // set/get a value for keyvalues resolution symbol
+ // e.g.: SetKeyValuesExpressionSymbol( "LOWVIOLENCE", true ) - enables [$LOWVIOLENCE]
+ virtual void SetKeyValuesExpressionSymbol( const char *name, bool bValue ) = 0;
+ virtual bool GetKeyValuesExpressionSymbol( const char *name ) = 0;
+
+ // symbol table access from code with case-preserving requirements (used for key names)
+ virtual HKeySymbol GetSymbolForStringCaseSensitive( HKeySymbol &hCaseInsensitiveSymbol, const char *name, bool bCreate = true ) = 0;
+};
+
+VSTDLIB_INTERFACE IKeyValuesSystem *KeyValuesSystem();
+
+// #define KEYVALUESSYSTEM_INTERFACE_VERSION "KeyValuesSystem002"
+
+#endif // VSTDLIB_IKEYVALUESSYSTEM_H