DCL 4.0
Loading...
Searching...
No Matches
IniFile.h
Go to the documentation of this file.
1#ifndef __DCL_INIFILE_H__
2#define __DCL_INIFILE_H__
3
4#ifndef __DCL_OBJECT_H__
5#include <dcl/Object.h>
6#endif
7#ifndef __DCL_EXCEPTION_H__
8#include <dcl/Exception.h>
9#endif
10
11#if __DCL_WINDOWS
12#ifndef __DCL_REGISTRY_H__
13#include <dcl/Registry.h>
14#endif
15#endif
16
17__DCL_BEGIN_NAMESPACE
18
19class DCLCAPI IniFile : public Object
20{
21 DECLARE_CLASSINFO(IniFile)
22public:
23 virtual String toString() const;
24#if __DCL_DEBUG
25 virtual void dump(Writer& out) const;
26#endif
27
28 IniFile(const String& strFileName)
30
31 virtual ~IniFile();
32
33 virtual void close()
35
36 virtual String getString(
37 const String& strSection,
38 const String& strEntry,
39 const wchar_t* pszDefault = NULL
41
42 virtual int getInteger(
43 const String& strSection,
44 const String& strEntry,
45 int nDefault
47
48 virtual void setValue(
49 const String& strSection,
50 const String& strEntry,
51 const String& strValue
53
54 virtual void setValue(
55 const String& strSection,
56 const String& strEntry,
57 int nValue
59
60private:
61 String __getValue(
62 const String& strSection,
63 const String& strEntry
64 );
65
66 void __setValue(
67 const String& strSection,
68 const String& strEntry,
69 const String& strValue
70 );
71
72protected:
74 String m_strName;
76
78};
79
80#if __DCL_WINDOWS
81
82class DCLCAPI RegIniFile : public IniFile
83{
84 DECLARE_CLASSINFO(RegIniFile)
85public:
86 RegIniFile(HKEY hParentKey, const String& strKey)
88
89 virtual void close()
91
92 virtual String getString(
93 const String& strSection,
94 const String& strEntry,
95 const wchar_t* pszDefault = NULL
97
98 virtual int getInteger(
99 const String& strSection,
100 const String& strEntry,
101 int nDefault
103
104 virtual void setValue(
105 const String& strSection,
106 const String& strEntry,
107 const String& strValue
109
110 virtual void setValue(
111 const String& strSection,
112 const String& strEntry,
113 int nValue
115
116protected:
117 Registry m_reg;
118};
119#endif
120
121__DCL_END_NAMESPACE
122
123#endif // __DCL_INIFILE_H__
124
#define NULL
Definition Config.h:340
#define DCLCAPI
Definition Config.h:100
#define __DCL_THROWS1(e)
Definition Config.h:167
#define DECLARE_CLASSINFO(class_name)
Definition Object.h:210
void CharsetConvertException * setValue(UTF8Encoder::encode(_value), _assignType)
Object * m_handle
Definition IniFile.h:73
bool m_bModified
Definition IniFile.h:75
String m_strName
Definition IniFile.h:74
Object()
Definition Object.cpp:183
virtual String toString() const
Definition Object.cpp:187