General improvements

This commit is contained in:
2025-10-28 16:09:14 +02:00
parent 287102dcea
commit b2e1c14618
17 changed files with 242 additions and 19 deletions

View File

@@ -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 )