xref: /AOO41X/main/setup_native/source/win32/customactions/reg4msdoc/registryvalueimpl.hxx (revision cdf0e10c4e3984b49a9502b011690b615761d4a3)
1*cdf0e10cSrcweir // RegistryValueImpl.h: Schnittstelle f�r die Klasse RegistryValueImpl.
2*cdf0e10cSrcweir //
3*cdf0e10cSrcweir //////////////////////////////////////////////////////////////////////
4*cdf0e10cSrcweir 
5*cdf0e10cSrcweir #ifndef _REGISTRYVALUEIMPL_HXX_
6*cdf0e10cSrcweir #define _REGISTRYVALUEIMPL_HXX_
7*cdf0e10cSrcweir 
8*cdf0e10cSrcweir #include <memory>
9*cdf0e10cSrcweir #include <string>
10*cdf0e10cSrcweir 
11*cdf0e10cSrcweir class RegistryValueImpl
12*cdf0e10cSrcweir {
13*cdf0e10cSrcweir public:
14*cdf0e10cSrcweir 
15*cdf0e10cSrcweir 	//#################################
16*cdf0e10cSrcweir 	// Creation/Destruction
17*cdf0e10cSrcweir 	//#################################
18*cdf0e10cSrcweir 
19*cdf0e10cSrcweir 	RegistryValueImpl(const std::wstring& Name, int Value);
20*cdf0e10cSrcweir 
21*cdf0e10cSrcweir 	RegistryValueImpl(const std::wstring& Name, const std::wstring& Value);
22*cdf0e10cSrcweir 
23*cdf0e10cSrcweir 	RegistryValueImpl(const std::wstring& Name, const std::string& Value);
24*cdf0e10cSrcweir 
25*cdf0e10cSrcweir 	#if (_MSC_VER >= 1300)
26*cdf0e10cSrcweir 	RegistryValueImpl::RegistryValueImpl(const RegistryValueImpl& s);
27*cdf0e10cSrcweir 	#endif
28*cdf0e10cSrcweir 
29*cdf0e10cSrcweir 	virtual ~RegistryValueImpl();
30*cdf0e10cSrcweir 
31*cdf0e10cSrcweir 
32*cdf0e10cSrcweir 	//#################################
33*cdf0e10cSrcweir 	// Query
34*cdf0e10cSrcweir 	//#################################
35*cdf0e10cSrcweir 
36*cdf0e10cSrcweir 
37*cdf0e10cSrcweir 	/** Returns the name of the value
38*cdf0e10cSrcweir 	*/
39*cdf0e10cSrcweir 	std::wstring GetName() const;
40*cdf0e10cSrcweir 
41*cdf0e10cSrcweir 	/** Return the size of data held
42*cdf0e10cSrcweir 	*/
43*cdf0e10cSrcweir 	size_t GetDataSize() const;
44*cdf0e10cSrcweir 
45*cdf0e10cSrcweir 	/** Get a pointer to the data buffer
46*cdf0e10cSrcweir 		in order to copy the data
47*cdf0e10cSrcweir 	*/
48*cdf0e10cSrcweir 	const void* GetDataBuffer() const;
49*cdf0e10cSrcweir 
50*cdf0e10cSrcweir 	/** Returns the data as unicode string
51*cdf0e10cSrcweir 
52*cdf0e10cSrcweir 		@precond GetType = STRING
53*cdf0e10cSrcweir 	*/
54*cdf0e10cSrcweir 	std::wstring GetDataAsUniString() const;
55*cdf0e10cSrcweir 
56*cdf0e10cSrcweir 	/** Returns the data as ansi string
57*cdf0e10cSrcweir 
58*cdf0e10cSrcweir 		@precond GetType = STRING
59*cdf0e10cSrcweir 	*/
60*cdf0e10cSrcweir 	std::string GetDataAsAnsiString() const;
61*cdf0e10cSrcweir 
62*cdf0e10cSrcweir 	/** Returns the data as number
63*cdf0e10cSrcweir 
64*cdf0e10cSrcweir 		@precond GetType = NUMBER
65*cdf0e10cSrcweir 	*/
66*cdf0e10cSrcweir 	int GetDataAsInt() const;
67*cdf0e10cSrcweir 
68*cdf0e10cSrcweir 	/** Returns the type of the data
69*cdf0e10cSrcweir 	*/
70*cdf0e10cSrcweir 	int GetType() const;
71*cdf0e10cSrcweir 
72*cdf0e10cSrcweir 	//#################################
73*cdf0e10cSrcweir 	// Command
74*cdf0e10cSrcweir 	//#################################
75*cdf0e10cSrcweir 
76*cdf0e10cSrcweir 
77*cdf0e10cSrcweir 	/** Set a new name
78*cdf0e10cSrcweir 	*/
79*cdf0e10cSrcweir 	void SetName(const std::wstring& NewName);
80*cdf0e10cSrcweir 
81*cdf0e10cSrcweir 	/**
82*cdf0e10cSrcweir 	*/
83*cdf0e10cSrcweir 	void SetValue(const std::wstring& NewValue);
84*cdf0e10cSrcweir 
85*cdf0e10cSrcweir 	/**
86*cdf0e10cSrcweir 	*/
87*cdf0e10cSrcweir 	void SetValue(const std::string& NewValue);
88*cdf0e10cSrcweir 
89*cdf0e10cSrcweir 	/**
90*cdf0e10cSrcweir 	*/
91*cdf0e10cSrcweir 	void SetValue(int NewValue);
92*cdf0e10cSrcweir 
93*cdf0e10cSrcweir 	//#################################
94*cdf0e10cSrcweir 	// Private data
95*cdf0e10cSrcweir 	//#################################
96*cdf0e10cSrcweir 
97*cdf0e10cSrcweir private:
98*cdf0e10cSrcweir 	std::wstring	m_Name;
99*cdf0e10cSrcweir 	int				m_Type;
100*cdf0e10cSrcweir 	std::wstring	m_StringData;
101*cdf0e10cSrcweir 	int				m_IntData;
102*cdf0e10cSrcweir };
103*cdf0e10cSrcweir 
104*cdf0e10cSrcweir 
105*cdf0e10cSrcweir typedef std::auto_ptr<RegistryValueImpl> RegistryValue;
106*cdf0e10cSrcweir 
107*cdf0e10cSrcweir 
108*cdf0e10cSrcweir #endif
109