www.pudn.com > antispam-addin.rar > configure.cxx


#include "unihead.hxx" 
 
#include "configure.hxx" 
 
Configure::Configure() 
{ 
	version = NULL; 
	displaylevel = 1; 
	loglevel = 1; 
	log = NULL; 
	templatemail = NULL; 
	authenticdir = NULL; 
	spooltime = NULL; 
	spooldir = NULL; 
	pwd = NULL; 
	user = NULL; 
	smtpport = 0; 
	smtphost = 0; 
	hostmail = NULL; 
} 
 
Configure::Configure(char *pszConfigureFile) 
{ 
	version = NULL; 
	displaylevel = 1; 
	loglevel = 1; 
	log = NULL; 
	templatemail = NULL; 
	authenticdir = NULL; 
	spooltime = NULL; 
	spooldir = NULL; 
	pwd = NULL; 
	user = NULL; 
	smtpport = 0; 
	smtphost = 0; 
	hostmail = NULL; 
} 
 
Configure::~Configure() 
{ 
	if(authenticdir) 
		free(authenticdir); 
 
	if(log) 
		free(log); 
 
	if(pwd) 
		free(pwd); 
 
	if(smtphost) 
		free(smtphost); 
 
	if(spooldir) 
		free(spooldir); 
 
	if(spooltime) 
		free(spooltime); 
 
	if(templatemail) 
		free(templatemail); 
 
	if(user) 
		free(user); 
 
	if(version) 
		free(version); 
 
	if(hostmail) 
		free(hostmail); 
} 
 
void Configure::setAuthenticDir(char *value) 
{ 
	authenticdir = strdup(value); 
} 
 
void Configure::setDisplayLevel(int value) 
{ 
	displaylevel = value; 
} 
 
void Configure::setLogFile(char *value) 
{ 
	log = strdup(value); 
} 
 
void Configure::setLogLevel(int value) 
{ 
	loglevel = value; 
} 
 
void Configure::setPwd(char *value) 
{ 
	pwd = strdup(value); 
} 
 
void Configure::setSmtpPort(int value) 
{ 
	smtpport = value; 
} 
 
void Configure::setSmtpHost(char *value) 
{ 
	smtphost = strdup(value); 
} 
 
void Configure::setHostMail(char *value) 
{ 
	hostmail = strdup(value); 
} 
 
void Configure::setSpoolTime(char *value) 
{ 
	spooltime = strdup(value); 
} 
 
void Configure::setTemplateMail(char *value) 
{ 
	templatemail = strdup(value); 
} 
 
void Configure::setUser(char *value) 
{ 
	user = strdup(value); 
} 
 
void Configure::setVersion(char *value) 
{ 
	version = strdup(value); 
} 
 
void Configure::setSpoolDir(char *value) 
{ 
	spooldir = strdup(value); 
} 
 
char* Configure::getAuthenticDir() 
{ 
	return authenticdir; 
} 
 
int Configure::getDisplayLevel() 
{ 
	return displaylevel; 
} 
 
char* Configure::getLogFile() 
{ 
	return log; 
} 
 
int Configure::getLogLevel() 
{ 
	return loglevel; 
} 
 
char* Configure::getPwd() 
{ 
	return pwd; 
} 
 
int Configure::getSmtpPort() 
{ 
	return smtpport; 
} 
 
char* Configure::getSmtpHost() 
{ 
	return smtphost; 
} 
 
char* Configure::getHostMail() 
{ 
	return hostmail; 
} 
 
char* Configure::getSpoolTime() 
{ 
	return spooltime; 
} 
 
char* Configure::getTemplateMail() 
{ 
	return templatemail; 
} 
 
char* Configure::getUser() 
{ 
	return user; 
} 
 
char* Configure::getVersion() 
{ 
	return version; 
} 
 
char* Configure::getSpoolDir() 
{ 
	return spooldir; 
}