started working on ini parser

This commit is contained in:
2025-08-20 01:27:25 +03:00
parent 5635cd1d69
commit eff681ca33
47 changed files with 1465 additions and 112 deletions

View File

@@ -23,10 +23,11 @@ template <typename T>
class CUtlBuffer
{
public:
CUtlBuffer( void );
CUtlBuffer( void );
CUtlBuffer( size_t nSize );
CUtlBuffer( const CUtlBuffer<T>& buffer );
CUtlBuffer( const CUtlResizableBuffer<T>& buffer );
~CUtlBuffer( void );
size_t GetSize( void ) const;
T* GetMemory(void) const;
@@ -81,6 +82,12 @@ CUtlBuffer<T>::CUtlBuffer( const CUtlResizableBuffer<T>& buffer ) : m_nSize(buff
V_memcpy(m_pData,buffer.pData,sizeof(T)*buffer.nSize);
}
template <typename T>
CUtlBuffer<T>::~CUtlBuffer()
{
if ( m_pData != 0)
V_free(m_pData);
}
//-----------------------------------------------------------------------------
// Gets memory size.
//-----------------------------------------------------------------------------
@@ -145,9 +152,10 @@ CUtlBuffer<T>& CUtlBuffer<T>::operator=(const CUtlBuffer<T>& other)
if ( m_pData != 0)
V_free(m_pData);
m_pData = (T*)V_malloc(sizeof(T)*other.m_nSize);
m_nSize = other.m_nSize;
V_memcpy(m_pData, other.m_pData, sizeof(T)*other.m_nSize);
}
return this;
return *this;
}
//-----------------------------------------------------------------------------