blob: 9280680a4f9bbf4e24817f0445dd59cd23e91897 (
plain) (
blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
|
//========= Copyright Valve Corporation, All rights reserved. ============//
//
// Purpose:
//
// $NoKeywords: $
//===========================================================================//
#if !defined( UTIL_REGISTRY_H )
#define UTIL_REGISTRY_H
#ifdef _WIN32
#pragma once
#endif
#include "tier0/platform.h"
//-----------------------------------------------------------------------------
// Purpose: Interface to registry
//-----------------------------------------------------------------------------
abstract_class IRegistry
{
public:
// We have to have a virtual destructor since otherwise the derived class destructors
// will not be called.
virtual ~IRegistry() {}
// Init/shutdown
virtual bool Init( const char *platformName ) = 0;
virtual void Shutdown( void ) = 0;
// Read/write integers
virtual int ReadInt( const char *key, int defaultValue = 0 ) = 0;
virtual void WriteInt( const char *key, int value ) = 0;
// Read/write strings
virtual const char *ReadString( const char *key, const char *defaultValue = 0 ) = 0;
virtual void WriteString( const char *key, const char *value ) = 0;
// Read/write helper methods
virtual int ReadInt( const char *pKeyBase, const char *pKey, int defaultValue = 0 ) = 0;
virtual void WriteInt( const char *pKeyBase, const char *key, int value ) = 0;
virtual const char *ReadString( const char *pKeyBase, const char *key, const char *defaultValue ) = 0;
virtual void WriteString( const char *pKeyBase, const char *key, const char *value ) = 0;
};
extern IRegistry *registry;
// Creates it and calls Init
IRegistry *InstanceRegistry( char const *subDirectoryUnderValve );
// Calls Shutdown and deletes it
void ReleaseInstancedRegistry( IRegistry *reg );
#endif // UTIL_REGISTRY_H
|