General improvements
This commit is contained in:
@@ -4,6 +4,7 @@
|
||||
#include "tier1/utlstring.h"
|
||||
#include "tier1/utlvector.h"
|
||||
#include "tier0/lib.h"
|
||||
#include "tier2/ifilesystem.h"
|
||||
|
||||
enum ESectionType
|
||||
{
|
||||
@@ -82,11 +83,24 @@ IINISection *CINIFile::GetSection( const char *szSectionName )
|
||||
class CINIManager: public IINIManager
|
||||
{
|
||||
public:
|
||||
virtual IINIFile *ReadFile( const char *psz ) override;
|
||||
virtual IINIFile *ReadString( const char *psz ) override;
|
||||
virtual void ReleaseFile( IINIFile *pFile ) override;
|
||||
bool IsWordSymbol( char c );
|
||||
CUtlVector<CUtlString> TokenizeString();
|
||||
};
|
||||
IINIFile *CINIManager::ReadFile( const char *psz )
|
||||
{
|
||||
IFileHandle *pFile;
|
||||
CUtlBuffer<char> data;
|
||||
|
||||
pFile = filesystem->Open(psz, FILEMODE_READ);
|
||||
data = CUtlBuffer<char>(pFile->Size()+1);
|
||||
pFile->Read(data.GetMemory(), pFile->Size());
|
||||
pFile->Close();
|
||||
|
||||
ReadString(data.GetMemory());
|
||||
}
|
||||
|
||||
IINIFile *CINIManager::ReadString( const char *psz )
|
||||
{
|
||||
@@ -276,7 +290,7 @@ IINIFile *CINIManager::ReadString( const char *psz )
|
||||
|
||||
void CINIManager::ReleaseFile( IINIFile *pFile )
|
||||
{
|
||||
|
||||
delete (CINIFile*)pFile;
|
||||
}
|
||||
|
||||
bool CINIManager::IsWordSymbol( char c )
|
||||
|
||||
Reference in New Issue
Block a user