-
Notifications
You must be signed in to change notification settings - Fork 0
/
Cfg.h
43 lines (27 loc) · 1.07 KB
/
Cfg.h
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
// Cfg.h: interface for the CCfg class.
//
//////////////////////////////////////////////////////////////////////
#if !defined(AFX_CFG_H__DCDB4CF1_ACB1_4DE2_9E36_7C0EF788B39F__INCLUDED_)
#define AFX_CFG_H__DCDB4CF1_ACB1_4DE2_9E36_7C0EF788B39F__INCLUDED_
#if _MSC_VER > 1000
#pragma once
#endif // _MSC_VER > 1000
#include <string>
class CCfg
{
public:
CCfg(char* ini = NULL);
virtual ~CCfg();
protected:
int RegReadInt(HKEY hkey,const char* subkey, int defaultval);
std::string RegReadString(HKEY hkey,const char* subkey,const char* defaultval);
BOOL RegWriteInt(HKEY hkey,const char* subkey, int tval);
BOOL RegWriteString(HKEY hkey,const char* subkey,const char* val, int len);
int IniReadInt(const char* section,const char* subkey, int defaultval);
std::string IniReadString(const char *section,const char *subkey,const char *defaultval);
private:
static const int regbufsize;// = 256;
char m_regbuf[256];
std::string m_IniFile;
};
#endif // !defined(AFX_CFG_H__DCDB4CF1_ACB1_4DE2_9E36_7C0EF788B39F__INCLUDED_)