12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849 |
- #include "stdafx.h"
- #include "IdentifyEngine.h"
- #include <WinInet.h>
- #include "ServerConfig.h"
- #include "basic_struct.h"
- CIdentifyEngine::CIdentifyEngine()
- {
- }
- CIdentifyEngine::~CIdentifyEngine()
- {
- }
- int CIdentifyEngine::SetCookie(std::string path, std::string name, std::string value)
- {
- return InternetSetCookie(CA2T(path.c_str()), CA2T(name.c_str()), CA2T(value.c_str()));
- }
- int CIdentifyEngine::SetLocalServerCookie(std::string name, std::string value)
- {
- switch (CServerConfig::server_address_type){
- case SAT_LOCAL_IN:InternetSetCookie(CServerConfig::server_url_local_in, CA2T(name.c_str()), CA2T(value.c_str())); break;
- case SAT_LOCAL_OUT:InternetSetCookie(CServerConfig::server_url_local_out, CA2T(name.c_str()), CA2T(value.c_str())); break;
- }
- return TRUE;
- }
- int CIdentifyEngine::SetServerUrl(std::string server_url)
- {
- CServerConfig::server_url = CString(server_url.c_str());
- return EPIR_SUCCESS;
- }
- boost::shared_ptr<CIdentifyEngine> CIdentifyEngine::GetInstance()
- {
- static boost::shared_ptr<CIdentifyEngine> instance_(new CIdentifyEngine);
- return instance_;
- }
- int CIdentifyEngine::SetScanConfig(std::string app_data_dir, std::string scan_data_dir)
- {
- CServerConfig::app_data_dir = CString(app_data_dir.c_str());
- CServerConfig::app_data_dir_string = scan_data_dir;
- CServerConfig::scan_data_dir = CString(scan_data_dir.c_str());
- return TRUE;
- }
|