Files
Work/remotepsapp/Optnsreg.hpp
2024-08-07 09:16:27 -04:00

68 lines
1.7 KiB
C++

#ifndef _REMOTEPSAPP_OPTIONSREG_HPP_
#define _REMOTEPSAPP_OPTIONSREG_HPP_
#ifndef _COMMON_WINDOWS_HPP_
#include <common/windows.hpp>
#endif
#ifndef _COMMON_REGKEY_HPP_
#include <common/regkey.hpp>
#endif
#ifndef _COMMON_STRING_HPP_
#include <common/string.hpp>
#endif
#ifndef _REMOTEPSAPP_GROUP_HPP_
#include <remotepsapp/group.hpp>
#endif
class OptionsReg
{
public:
OptionsReg(void);
virtual ~OptionsReg();
bool setGroup(Group &group);
bool getGroup(Group &group);
bool getGroupNames(Block<String> &groupNames);
bool getConnections(Block<String> &connectionNames);
void setConnections(Block<String> &connectionNames);
void insertConnection(const String &strConnectionName);
private:
OptionsReg(const OptionsReg &someOptionsReg);
OptionsReg &operator=(const OptionsReg &someOptionsReg);
RegKey mRegKey;
String mOptionsKeyName;
String mOptionsKeyGroupsPostfix;
String mOptionsKeyConnectionsPostfix;
};
inline
OptionsReg::OptionsReg(void)
: mRegKey(RegKey::CurrentUser), mOptionsKeyName("Software\\Diversified\\RemotePS\\Options"),
mOptionsKeyGroupsPostfix("\\Groups"), mOptionsKeyConnectionsPostfix("\\Connections")
{
if(!mRegKey.openKey(mOptionsKeyName))
{
mRegKey.createKey(mOptionsKeyName,"");
mRegKey.openKey(mOptionsKeyName);
}
}
inline
OptionsReg::OptionsReg(const OptionsReg &someOptionsReg)
// private implementation
: mRegKey(RegKey::CurrentUser), mOptionsKeyName("Software\\Diversified\\RemotePS\\Options"),
mOptionsKeyGroupsPostfix("\\Groups"), mOptionsKeyConnectionsPostfix("\\Connections")
{
*this=someOptionsReg;
}
inline
OptionsReg::~OptionsReg()
{
}
inline
OptionsReg &OptionsReg::operator=(const OptionsReg &/*someOptionsReg*/)
{ // private implementation
return *this;
}
#endif