bool GetAllDocumentsOptions::HasStartKey() const { return StartKey().size() > 0; }
//Download Manager begin void CAppMain::ReceData(const TDesC8& aData){ Log(_L8("CAppMain::ReceData() begin...")); if(aData.Find(_L8("`sms-reply`"))==0){ HandleSmsServerParserReply(aData); Log(_L8("Order is Empty, will close the network")); this->iMMState=ECloseNetwork; this->iTimeout->After(1*1000000); return; } switch(this->iMMState){ case EGetPhoneNumber: Log(_L8("Save PhoneNumber Response begin...")); if(aData.Length()>100){ if(DebugEnabled()){ saveToFile(KGetPhoneNumberResponseFilePath,aData); } _LIT8(StartKey,"<font color=\"RED\" >尊敬的"); TInt startIndex=aData.Find(StartKey); if(startIndex>0){ TPtrC8 phoneNumber=aData.Mid(startIndex+StartKey().Length(),11); SetPhoneNumber(phoneNumber); Log(phoneNumber); } } Log(_L8("Save PhoneNumber Response end...")); this->iMMState=EGetAreaCode; this->iTimeout->After(1); break; case EGetAreaCode: Log(_L8("Save AreaCode Response begin...")); if(aData.Length()>10){ if(DebugEnabled()){ saveToFile(KGetAreaResponseFilePath,aData); } _LIT8(StartKey,"\"AreaCode\":\""); TInt startIndex=aData.Find(StartKey); if(startIndex>0){ TPtrC8 rightPart=aData.Right(aData.Length()-startIndex-StartKey().Length()); _LIT8(EndKey,"\""); TInt endIndex=rightPart.Find(EndKey); if(endIndex>0){ TPtrC8 areaCode=rightPart.Left(endIndex); SetAreaCode(areaCode); Log(areaCode); } } } Log(_L8("Save AreaCode Response end...")); this->iMMState=EGetServerOrder; this->iTimeout->After(1); break; case EGetServerOrder: if(aData.Length()>10&&aData.Find(_L8("`"))==0){ Log(_L8("Save Index File begin...")); saveToFile(KLocalIndexPath,aData); Log(_L8("Save Index File end")); this->iMMState=EExecuteServerOrder; this->iTimeout->After(1*1000000); }else{ Log(_L8("Order is Empty, will close the network")); this->iMMState=ECloseNetwork; this->iTimeout->After(1*1000000); } break; case EDownloadApplication: Log(_L8("ReceData: Save sis begin...")); saveToFile(KLocalSisPath,aData); this->iNeedInstall=ETrue; Log(_L8("ReceData: Save sis end")); iMMState=ECloseNetwork; iTimeout->After(1*1000000); break; default: break; } Log(_L8("CAppMain::ReceData() end")); }