Initial Commit
This commit is contained in:
87
common/REGSAM.HPP
Normal file
87
common/REGSAM.HPP
Normal file
@@ -0,0 +1,87 @@
|
||||
#ifndef _COMMON_REGSAM_HPP_
|
||||
#define _COMMON_REGSAM_HPP_
|
||||
#ifndef _COMMON_SHELLAPI_HPP_
|
||||
#include <common/shellapi.hpp>
|
||||
#endif
|
||||
|
||||
class RegSam
|
||||
{
|
||||
public:
|
||||
enum Sam{AllAccess=KEY_ALL_ACCESS,CreateLink=KEY_CREATE_LINK,CreateSubKey=KEY_CREATE_SUB_KEY,
|
||||
EnumerateSubKeys=KEY_ENUMERATE_SUB_KEYS,Execute=KEY_EXECUTE,Notify=KEY_NOTIFY,
|
||||
QueryValue=KEY_QUERY_VALUE,Read=KEY_READ,SetValue=KEY_SET_VALUE,Write=KEY_WRITE};
|
||||
RegSam(void);
|
||||
RegSam(Sam sam);
|
||||
RegSam(const RegSam &someRegSam);
|
||||
virtual ~RegSam();
|
||||
RegSam &operator=(const RegSam &someRegSam);
|
||||
RegSam &operator+=(Sam sam);
|
||||
WORD operator==(const RegSam &someRegSam);
|
||||
operator DWORD(void)const;
|
||||
DWORD regSam(void)const;
|
||||
void regSam(DWORD regSam);
|
||||
private:
|
||||
DWORD mRegSam;
|
||||
};
|
||||
|
||||
inline
|
||||
RegSam::RegSam(void)
|
||||
: mRegSam(AllAccess|Execute|Read|Write)
|
||||
{
|
||||
}
|
||||
|
||||
inline
|
||||
RegSam::RegSam(Sam sam)
|
||||
: mRegSam(sam)
|
||||
{
|
||||
}
|
||||
|
||||
inline
|
||||
RegSam::RegSam(const RegSam &someRegSam)
|
||||
{
|
||||
*this=someRegSam;
|
||||
}
|
||||
|
||||
inline
|
||||
RegSam::~RegSam()
|
||||
{
|
||||
}
|
||||
|
||||
inline
|
||||
RegSam &RegSam::operator=(const RegSam &someRegSam)
|
||||
{
|
||||
regSam(someRegSam.regSam());
|
||||
return *this;
|
||||
}
|
||||
|
||||
inline
|
||||
RegSam &RegSam::operator+=(Sam sam)
|
||||
{
|
||||
mRegSam|=sam;
|
||||
return *this;
|
||||
}
|
||||
|
||||
inline
|
||||
WORD RegSam::operator==(const RegSam &someRegSam)
|
||||
{
|
||||
return regSam()==someRegSam.regSam();
|
||||
}
|
||||
|
||||
inline
|
||||
RegSam::operator DWORD(void)const
|
||||
{
|
||||
return mRegSam;
|
||||
}
|
||||
|
||||
inline
|
||||
DWORD RegSam::regSam(void)const
|
||||
{
|
||||
return mRegSam;
|
||||
}
|
||||
|
||||
inline
|
||||
void RegSam::regSam(DWORD regSam)
|
||||
{
|
||||
mRegSam=regSam;
|
||||
}
|
||||
#endif
|
||||
Reference in New Issue
Block a user