BOOL CGroupingDlg::ProcessMethod(CXMLElement*& pXML) { for ( POSITION pos = pXML->GetElementIterator() ; pos ; ) { CXMLElement* pSync = pXML->GetNextElement( pos ); CString strValue = pSync->GetAttributeValue( _T("method") ); if ( ! strValue.CompareNoCase( METHOD_INSERT ) ) { ProcessInsert( pSync->GetFirstElement() ); } else if ( ! strValue.CompareNoCase( METHOD_DELETE ) ) { ProcessDelete( pSync->GetFirstElement() ); } else if ( ! strValue.CompareNoCase( METHOD_UPDATE ) ) { ProcessUpdate( pSync->GetFirstElement() ); } } pXML->Delete(); pXML = NULL; return TRUE; }
int main(int argc, char *argv[]) { int ErrorCode = NO_ERROR; int FileCount; AGPS_CONFIG_T *AGPSConfig; char config_file_path[CFG_FILE_LEN+1]; if (argc > 1) { if (argc == 3) { if (strcmp(argv[1], "-f") == 0) { strcpy(config_file_path, argv[2]); } else { printf("---------------------------------\n"); printf("-%s [-f ConfigFilePath]\n", argv[0]); printf("---------------------------------\n"); } } else { printf("---------------------------------\n"); printf("-%s [-f ConfigFilePath]\n", argv[0]); printf("---------------------------------\n"); } } else sprintf(config_file_path, "../config/CouponMgr.Config"); if(ReadConfig(config_file_path, &Config) < 0) { printf("Configuration File Read Error\n"); exit(1); } SvcLog = openLog("CouponMgr", Config.SERVICE_LOG_PATH, LOG_MODE); #ifdef __DEBUG_LOG DebLog = openLog("CouponMgr", Config.DEBUG_LOG_PATH, LOG_MODE); #endif AGPSConfig = LoadAGPSConfig(&FileCount, &ErrorCode, Config); if(ErrorCode != NO_ERROR) { printLog(HEAD, "Init Data Index Error..\n"); exit(-1); } ProcessUpdate(AGPSConfig, FileCount); free(AGPSConfig); return NO_ERROR; }
void CDlgExpEditorDM::OnOK() { // TODO: 在此添加专用代码和/或调用基类 m_editExp.GetWindowText(m_strExp); m_strExp.Replace("\r\n", ""); Json::Reader Jreader; Json::Value Jv; Json::FastWriter Jwriter; Json::Value JvRet; m_Jv["NewExp"] = m_strExp.GetBuffer(); std::string str = Jwriter.write(m_Jv); ProcessUpdate(str.c_str()); //MessageBox(str.c_str()); return; CBCGPDialog::OnOK(); }