started working on ini parser
This commit is contained in:
@@ -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;
|
||||
}
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
|
||||
Reference in New Issue
Block a user