FontStyle* FontStyleManager::requestFontStyle(string style){ list <FontStyle*>::iterator it; for (it = mFontStyle.begin();it != mFontStyle.end();it++){ if ((*it)->getName() == style){ return (*it); } } /*File f(style+".xml", "media\\fonts"); if (f.error() != FILE_OK){ throw ("Font Style Not Found : "+style); } XML* xml = new XML(f.getStrContent());*/ XML* xml = new XML(style+".xml", "media\\fonts"); XMLIterator xIt(xml); xIt.setElemName("fontstyle"); xIt.gotoZero(); xIt.gotoNext(); FontStyle* fs = new FontStyle(style, xIt.getElem().getString("font"), xIt.getElem().getFloat("size")); Ogre::ColourValue prim = colourValueFromString(xIt.getElem().getString("colour")); Ogre::ColourValue sec = colourValueFromString(xIt.getElem().getString("shadow")); fs->setColour(prim, sec); delete xml; mFontStyle.push_back(fs); return fs; }
void Parser::StartThread() { vector<string> uniq; string text = ServerCall::Call("http://otvet.mail.ru/question/"+to_string(Util::GetRndNumber())); boost::regex e("[a-zA-Z0-9_\\-\\.]+@([mail||bk])+.ru"); boost::smatch xResults; boost::sregex_iterator xIt(text.begin(), text.end(), e); boost::sregex_iterator xInvalidIt; while(xIt != xInvalidIt) { string mail=xIt->str(); uniq.push_back(mail); *xIt++; } Util::SortAndDelRep(uniq); std::lock_guard<std::mutex> locker(mut); for(auto it=uniq.begin(); it!=uniq.end(); ++it) { cout<<*it<<endl; book_file << *it<< endl; mailsCount++; } }