Initial
This commit is contained in:
81
smtp/MAILREG.HPP
Normal file
81
smtp/MAILREG.HPP
Normal file
@@ -0,0 +1,81 @@
|
||||
#ifndef _SMTP_MAILREG_HPP_
|
||||
#define _SMTP_MAILREG_HPP_
|
||||
#ifndef _COMMON_STRING_HPP_
|
||||
#include <common/string.hpp>
|
||||
#endif
|
||||
#ifndef _COMMON_REGKEY_HPP_
|
||||
#include <common/regkey.hpp>
|
||||
#endif
|
||||
#ifndef _SMTP_MAIL_HPP_
|
||||
#include <smtp/mail.hpp>
|
||||
#endif
|
||||
|
||||
class MailReg
|
||||
{
|
||||
public:
|
||||
MailReg(void);
|
||||
MailReg(const MailReg &someMailReg);
|
||||
virtual ~MailReg();
|
||||
MailReg &operator=(const MailReg &someMailReg);
|
||||
BOOL getRecipients(Block<String> &recipients);
|
||||
void setRecipients(const Block<String> &recipients);
|
||||
BOOL addRecipient(const String &recipient);
|
||||
BOOL getReversePaths(Block<String> &reversePaths);
|
||||
void setReversePaths(const Block<String> &reversePaths);
|
||||
BOOL addReversePath(const String &reversePath);
|
||||
const String &server(void)const;
|
||||
void server(const String &serverName);
|
||||
private:
|
||||
BOOL isInBlock(const String &recipient,Block<String> &recipients);
|
||||
|
||||
RegKey mRegKey;
|
||||
String mMailKeyName;
|
||||
String mServerKeyName;
|
||||
String mRecipientsKeyName;
|
||||
String mServerName;
|
||||
};
|
||||
|
||||
inline
|
||||
MailReg::MailReg(void)
|
||||
: mMailKeyName(STRING_MAILKEYNAME), mServerKeyName(STRING_SERVERKEYNAME)
|
||||
{
|
||||
if(!mRegKey.openKey(mMailKeyName))
|
||||
{
|
||||
mRegKey.createKey(mMailKeyName,"");
|
||||
mRegKey.openKey(mMailKeyName);
|
||||
}
|
||||
mRegKey.queryValue(mServerKeyName,mServerName);
|
||||
}
|
||||
|
||||
inline
|
||||
MailReg::MailReg(const MailReg &someMailReg)
|
||||
: mMailKeyName(STRING_MAILKEYNAME), mServerKeyName(STRING_SERVERKEYNAME)
|
||||
{
|
||||
*this=someMailReg;
|
||||
}
|
||||
|
||||
inline
|
||||
MailReg::~MailReg()
|
||||
{
|
||||
}
|
||||
|
||||
inline
|
||||
MailReg &MailReg::operator=(const MailReg &someMailReg)
|
||||
{
|
||||
server(someMailReg.server());
|
||||
return *this;
|
||||
}
|
||||
|
||||
inline
|
||||
const String &MailReg::server(void)const
|
||||
{
|
||||
return mServerName;
|
||||
}
|
||||
|
||||
inline
|
||||
void MailReg::server(const String &serverName)
|
||||
{
|
||||
mServerName=serverName;
|
||||
mRegKey.setValue(mServerKeyName,mServerName);
|
||||
}
|
||||
#endif
|
||||
Reference in New Issue
Block a user