42 lines
904 B
C++
42 lines
904 B
C++
|
|
#include "tier2/fileformats/ini.h"
|
|
#include "tier1/utlstring.h"
|
|
#include "tier1/utlvector.h"
|
|
|
|
abstract_class CINISection: public IINISection
|
|
{
|
|
public:
|
|
virtual bool GetBoolValue( const char *szKeyName ) override;
|
|
virtual int GetIntValue( const char *szKeyName ) override;
|
|
virtual const char *GetStringValue( const char *szKeyName ) override;
|
|
virtual CUtlString GetUTLStringValue( const char *szKeyName ) override;
|
|
|
|
CUtlVector<CUtlString> m_values;
|
|
};
|
|
|
|
class CINIFile: public IINIFile
|
|
{
|
|
virtual void GetSection( const char *szSectionName ) override;
|
|
|
|
CUtlVector<CINISection*> m_sections;
|
|
};
|
|
|
|
class CINIManager: public IINIManager
|
|
{
|
|
public:
|
|
virtual IINIFile *ReadString( const char *psz ) override;
|
|
};
|
|
|
|
IINIFile *CINIManager::ReadString( const char *psz )
|
|
{
|
|
CINIFile *pFile = new CINIFile;
|
|
return (IINIFile*)pFile;
|
|
}
|
|
|
|
IINIManager *INIManager()
|
|
{
|
|
static CINIManager manager;
|
|
return &manager;
|
|
}
|
|
|