summaryrefslogtreecommitdiff
path: root/datamodel/dmattributeinternal.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 /datamodel/dmattributeinternal.h
downloadarchived-source-engine-2018-hl2-src-master.tar.xz
archived-source-engine-2018-hl2-src-master.zip
Diffstat (limited to 'datamodel/dmattributeinternal.h')
-rw-r--r--datamodel/dmattributeinternal.h75
1 files changed, 75 insertions, 0 deletions
diff --git a/datamodel/dmattributeinternal.h b/datamodel/dmattributeinternal.h
new file mode 100644
index 0000000..d6c9453
--- /dev/null
+++ b/datamodel/dmattributeinternal.h
@@ -0,0 +1,75 @@
+//========= Copyright Valve Corporation, All rights reserved. ============//
+//
+// Purpose:
+//
+//=============================================================================
+
+#ifndef DMATTRIBUTEINTERNAL_H
+#define DMATTRIBUTEINTERNAL_H
+#ifdef _WIN32
+#pragma once
+#endif
+
+#include "datamodel/dmattribute.h"
+#include "wchar.h"
+
+
+//-----------------------------------------------------------------------------
+// Forward declarations:
+//-----------------------------------------------------------------------------
+class IDataModelFactory;
+class CUtlBuffer;
+class Vector;
+class Color;
+class CUtlCharConversion;
+class CDmElement;
+
+
+//-----------------------------------------------------------------------------
+// Utility class to allow datamodel objects to access private members of CDmAttribute
+//-----------------------------------------------------------------------------
+class CDmAttributeAccessor
+{
+public:
+ static void OnChanged( CDmAttribute *pAttribute, bool bArrayCountChanged = false, bool bIsTopological = false )
+ {
+ pAttribute->OnChanged( bArrayCountChanged, bIsTopological );
+ }
+
+ static void DestroyAttribute( CDmAttribute *pOldAttribute )
+ {
+ CDmAttribute::DestroyAttribute( pOldAttribute );
+ }
+
+ static bool MarkDirty( CDmAttribute *pAttribute )
+ {
+ return pAttribute->MarkDirty();
+ }
+};
+
+//-----------------------------------------------------------------------------
+// For serialization, set the delimiter rules
+//-----------------------------------------------------------------------------
+void SetSerializationDelimiter( CUtlCharConversion *pConv );
+void SetSerializationArrayDelimiter( const char *pDelimiter );
+
+
+//-----------------------------------------------------------------------------
+// Skip unserialization for an attribute type (unserialize into a dummy variable)
+//-----------------------------------------------------------------------------
+bool SkipUnserialize( CUtlBuffer &buf, DmAttributeType_t type );
+
+
+//-----------------------------------------------------------------------------
+// Attribute names/types
+//-----------------------------------------------------------------------------
+const char *AttributeTypeName( DmAttributeType_t type );
+DmAttributeType_t AttributeType( const char *pAttributeType );
+
+
+//-----------------------------------------------------------------------------
+// returns the number of attributes currently allocated
+//-----------------------------------------------------------------------------
+int GetAllocatedAttributeCount();
+
+#endif // DMATTRIBUTEINTERNAL_H