vector<SMS> MakerModem::getSMSBySender(const char * number) { vector<SMS> list; string cleaned(clean_number(number)); for (std::vector<SMS>::iterator it = messages.begin(); it != messages.end(); ++it) { string current = it->getSender(); if (strcmp(cleaned.c_str(), clean_number(current.c_str()).c_str()) == 0) list.push_back(*it); } return list; }
stBigNum multiply(stBigNum tNumX, stBigNum tNumY){ stBigNum tResult; clean_number(&tResult); while(!equal_zero(&tNumX)){ if(odd(tNumX.aiBlock[0])){ tResult = add(tResult, tNumY); } shift_r(&tNumX); shift_l(&tNumY); } return (tResult); }
void read(stBigNum *ptNum){ int i, iPower = 1; char pszString[LON*MAXN]; scanf("%s",pszString); clean_number(ptNum); for(i=strlen(pszString)-1; i>=0; i--){ ptNum->aiBlock[ptNum->iSize-1] += (((int)pszString[i])-48)*iPower; iPower *= 10; if(iPower == CARRY){ iPower = 1; ptNum->iSize++; } } }