Update ooo320-m1
[ooovba.git] / setup_native / source / win32 / customactions / reg4msdoc / registryvalueimpl.hxx
blobab352ec50596666deae82f58a2d6ab771d922aaf
1 // RegistryValueImpl.h: Schnittstelle für die Klasse RegistryValueImpl.
2 //
3 //////////////////////////////////////////////////////////////////////
5 #ifndef _REGISTRYVALUEIMPL_HXX_
6 #define _REGISTRYVALUEIMPL_HXX_
8 #include <memory>
9 #include <string>
11 class RegistryValueImpl
13 public:
15 //#################################
16 // Creation/Destruction
17 //#################################
19 RegistryValueImpl(const std::wstring& Name, int Value);
21 RegistryValueImpl(const std::wstring& Name, const std::wstring& Value);
23 RegistryValueImpl(const std::wstring& Name, const std::string& Value);
25 #if (_MSC_VER >= 1300)
26 RegistryValueImpl::RegistryValueImpl(const RegistryValueImpl& s);
27 #endif
29 virtual ~RegistryValueImpl();
32 //#################################
33 // Query
34 //#################################
37 /** Returns the name of the value
39 std::wstring GetName() const;
41 /** Return the size of data held
43 size_t GetDataSize() const;
45 /** Get a pointer to the data buffer
46 in order to copy the data
48 const void* GetDataBuffer() const;
50 /** Returns the data as unicode string
52 @precond GetType = STRING
54 std::wstring GetDataAsUniString() const;
56 /** Returns the data as ansi string
58 @precond GetType = STRING
60 std::string GetDataAsAnsiString() const;
62 /** Returns the data as number
64 @precond GetType = NUMBER
66 int GetDataAsInt() const;
68 /** Returns the type of the data
70 int GetType() const;
72 //#################################
73 // Command
74 //#################################
77 /** Set a new name
79 void SetName(const std::wstring& NewName);
81 /**
83 void SetValue(const std::wstring& NewValue);
85 /**
87 void SetValue(const std::string& NewValue);
89 /**
91 void SetValue(int NewValue);
93 //#################################
94 // Private data
95 //#################################
97 private:
98 std::wstring m_Name;
99 int m_Type;
100 std::wstring m_StringData;
101 int m_IntData;
105 typedef std::auto_ptr<RegistryValueImpl> RegistryValue;
108 #endif