void CVideoInfoTag::SetProductionCode(std::string productionCode) { m_strProductionCode = Trim(std::move(productionCode)); }
void CVideoInfoTag::SetSortTitle(std::string sortTitle) { m_strSortTitle = Trim(std::move(sortTitle)); }
void CVideoInfoTag::SetFileNameAndPath(std::string fileNameAndPath) { m_strFileNameAndPath = Trim(std::move(fileNameAndPath)); }
void CVideoInfoTag::SetEpisodeGuide(std::string episodeGuide) { m_strEpisodeGuide = Trim(std::move(episodeGuide)); }
void CVideoInfoTag::SetFile(std::string file) { m_strFile = Trim(std::move(file)); }
void CVideoInfoTag::SetIMDBNumber(std::string imdbNumber) { m_strIMDBNumber = Trim(std::move(imdbNumber)); }
void CVideoInfoTag::SetGenre(std::vector<std::string> genre) { m_genre = Trim(std::move(genre)); }
void CVideoInfoTag::SetSetOverview(std::string setOverview) { m_strSetOverview = Trim(std::move(setOverview)); }
void CVideoInfoTag::SetDirector(std::vector<std::string> director) { m_director = Trim(std::move(director)); }
void CVideoInfoTag::SetWritingCredits(std::vector<std::string> writingCredits) { m_writingCredits = Trim(std::move(writingCredits)); }
void CVideoInfoTag::SetBasePath(std::string basePath) { m_basePath = Trim(std::move(basePath)); }
bool CCALCViewWinDoc::OpenFile(CString path) { std::ifstream f; f.open(LPCTSTR(path), std::ios::in); char buffer[1024]; while (1) { f.getline(buffer, 1024); // Make sure the line was read if (f.eof() || f.bad() || f.fail()) break; std::string s(buffer); std::string::size_type location = s.find_first_of("="); // If there is an equals sign if (location != std::string::npos) { std::string reg_name = Trim(s.substr(0,location)); std::string reg_config = Trim(s.substr(location + 2)); // We have to change the type of the block if we get the TYPE param if (reg_name == "TYPE") { if (reg_config == "CALC") OnControlsCalc(); else if (reg_config == "CALCA") OnControlsCalca(); else if (reg_config == "MATH") OnControlsMath(); else if (reg_config == "LOGIC") OnControlsLogic(); } // Set the configuration try { int i = _machine.Name_To_Index_Memory(reg_name); Mem_Status *reg = _machine.Index_To_Memory(i); reg->Set_Configuration(reg_config); } catch (...) { } } }; f.close(); // Put everything in a good state _steps_table_model.Compile_Steps(); _steps_table_model.Begin_Running_Steps (false); _stack_table_model.Clear (); _registers_table_model.Refresh_Registers(); _emulator.Set_Stop(); // Redraw UpdateAllViews(NULL, UPDATE_ALL_TABLE_CONTENTS); // Update path SetPathName(path, true); SetModifiedFlag(false); return true; }
int CWorldOther::SdkServerVerify(T_VECTOR_OBJECT* p, CPluto& u) { #if 0 //注释掉老代码 if (p->size() != 4) { return -1; } string& url = VOBJECT_GET_SSTR((*p)[0]); int32_t nFd = VOBJECT_GET_I32((*p)[1]); string& strAccount = VOBJECT_GET_SSTR((*p)[2]); string& strPlatId = VOBJECT_GET_SSTR((*p)[3]); CMailBox* pmb = u.GetMailbox(); if (NULL == pmb) { return -1; } CPluto* duplicate = new CPluto(u.GetBuff(), u.GetMaxLen()); duplicate->SetMailbox(pmb); int ret = threadpool_add_job(g_threadpool, ThreadJob_SdkServerVerify, (void*)(duplicate)); if (ret != 0) { //直接返回服务器繁忙,请稍后再试 //printf("服务器繁忙,请稍后再试!\n"); //std::cout << "服务器繁忙,请稍后再试!" << endl; LogWarning("CWorldOther::SdkServerVerify", "threadpool list is full."); CPluto* u2 = new CPluto; u2->Encode(MSGID_LOGINAPP_LOGIN_VERIFY_CALLBACK); (*u2)<< int32_t(-2) << nFd << strAccount << strPlatId << EndPluto; g_pluto_sendlist.PushPluto(u2); //不适合多线程发送 //pmb->RpcCall(GetRpcUtil(), MSGID_LOGINAPP_LOGIN_VERIFY_CALLBACK, -2, nFd, strAccount, strPlatId); } return 0; #endif if (p->size() != 4) { return -1; } string& url = VOBJECT_GET_SSTR((*p)[0]); int32_t nFd = VOBJECT_GET_I32((*p)[1]); string& strAccount = VOBJECT_GET_SSTR((*p)[2]); string& strPlatId = VOBJECT_GET_SSTR((*p)[3]); CMailBox* pmb = u.GetMailbox(); pluto_msgid_t msg_id = u.GetMsgId();; string resp = ""; int ret = GetUrl_new(url.c_str(), resp); if (ret != CURLE_OK) { LogWarning("CWorldOther::SdkServerVerify", "%s ret = %d", strAccount.c_str(), ret); //todo:faild. SyncRpcCall(g_pluto_sendlist, SERVER_LOGINAPP, MSGID_LOGINAPP_LOGIN_VERIFY_CALLBACK, ret, nFd, strAccount, strPlatId); return 0; } Trim(resp); cJSON* json = cJSON_Parse(resp.c_str()); cJSON* childJs = cJSON_GetObjectItem(json, "code"); int rst = cJSON_GetObjectItem(json, "code")->valueint; if (rst == 1) { //succeed. if (strAccount.c_str() != cJSON_GetObjectItem(json, "msg")->valuestring) { ret = 0; } else { LogWarning("CWorldOther::SdkServerVerify", "strAccount[%s] msg[%s]", strAccount.c_str(), cJSON_GetObjectItem(json, "msg")->valuestring); ret = 1; //pmb->RpcCall(GetRpcUtil(), MSGID_LOGINAPP_LOGIN_VERIFY_CALLBACK, int32_t(1), nFd, strAccount, strPlatId); } } else { //failed. LogWarning("CWorldOther::SdkServerVerify", "strAccount[%s] rst[%d]", strAccount.c_str(), rst); ret = -1; //pmb->RpcCall(GetRpcUtil(), MSGID_LOGINAPP_LOGIN_VERIFY_CALLBACK, -1, nFd, strAccount, strPlatId); } SyncRpcCall(g_pluto_sendlist, SERVER_LOGINAPP, MSGID_LOGINAPP_LOGIN_VERIFY_CALLBACK, ret, nFd, strAccount, strPlatId); return 0; }
std::string TrimCopy (const std::string & str) { std::string local(str); Trim(local); return local; }
void CVideoInfoTag::SetCountry(std::vector<std::string> country) { m_country = Trim(std::move(country)); }
void CVideoInfoTag::SetSet(std::string set) { m_strSet = Trim(std::move(set)); }
void CVideoInfoTag::SetTagLine(std::string tagLine) { m_strTagLine = Trim(std::move(tagLine)); }
void CVideoInfoTag::SetTags(std::vector<std::string> tags) { m_tags = Trim(std::move(tags)); }
void CVideoInfoTag::SetPlotOutline(std::string plotOutline) { m_strPlotOutline = Trim(std::move(plotOutline)); }
void CVideoInfoTag::SetPath(std::string path) { m_strPath = Trim(std::move(path)); }
void CVideoInfoTag::SetTrailer(std::string trailer) { m_strTrailer = Trim(std::move(trailer)); }
void CVideoInfoTag::SetMPAARating(std::string mpaaRating) { m_strMPAARating = Trim(std::move(mpaaRating)); }
void CVideoInfoTag::SetPlot(std::string plot) { m_strPlot = Trim(std::move(plot)); }
void CVideoInfoTag::SetOriginalTitle(std::string originalTitle) { m_strOriginalTitle = Trim(std::move(originalTitle)); }
void CVideoInfoTag::SetTitle(std::string title) { m_strTitle = Trim(std::move(title)); }
void CVideoInfoTag::SetStatus(std::string status) { m_strStatus = Trim(std::move(status)); }
void CVideoInfoTag::SetArtist(std::vector<std::string> artist) { m_artist = Trim(std::move(artist)); }
void CVideoInfoTag::SetStudio(std::vector<std::string> studio) { m_studio = Trim(std::move(studio)); }
// Check the name is valid for account name bool IsUserName(char *name) { UINT i, len; char tmp[MAX_SIZE]; // Validate arguments if (name == NULL) { return false; } StrCpy(tmp, sizeof(tmp), name); name = tmp; Trim(name); len = StrLen(name); if (len == 0) { return false; } if (StrCmpi(name, "*") == 0) { return true; } for (i = 0; i < len; i++) { if (IsSafeChar(name[i]) == false && name[i] != '@') { return false; } } if (StrCmpi(name, LINK_USER_NAME) == 0) { return false; } if (StartWith(name, L3_USERNAME)) { return false; } if (StrCmpi(name, LINK_USER_NAME_PRINT) == 0) { return false; } if (StrCmpi(name, SNAT_USER_NAME) == 0) { return false; } if (StrCmpi(name, SNAT_USER_NAME_PRINT) == 0) { return false; } if (StrCmpi(name, BRIDGE_USER_NAME) == 0) { return false; } if (StrCmpi(name, BRIDGE_USER_NAME_PRINT) == 0) { return false; } if (StrCmpi(name, ADMINISTRATOR_USERNAME) == 0) { return false; } return true; }
void CVideoInfoTag::SetShowTitle(std::string showTitle) { m_strShowTitle = Trim(std::move(showTitle)); }