本文整理汇总了C++中UserInfo::address方法的典型用法代码示例。如果您正苦于以下问题:C++ UserInfo::address方法的具体用法?C++ UserInfo::address怎么用?C++ UserInfo::address使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类UserInfo
的用法示例。
在下文中一共展示了UserInfo::address方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: dispatch
string DispatcherHtml::dispatch(const UserInfo& info) const {
std::ostringstream o;
o << info.age();
string html = "";
html = "<html><body>";
html += "<h2>" + info.name() + " " + info.surname() + "</h2>";
if(info.age() > -1)
html += "<p style='font-weight: 400; font-size:14px;'> " + o.str() + " years old<br>";
html += info.address() + "</p>";
vector<string>::const_iterator it;
vector<string> _interests = info.interests();
if(!_interests.empty()) {
html += "<h4><img src='img/rugby100.png'> Interests</h4><p style='font-weight: 400; font-size:14px;line-height:26px'>";
it = _interests.begin();
for(; it < _interests.end(); ++it)
html += "<span style='background-color:rgba(102,102,156,.5);'> " + *it + " </span> ";
html += "</p>";
}
vector<string> _skills = info.skills();
if(!_skills.empty()) {
html += "<h4><img src='img/atom2.png'> Skills</h4><p style='font-weight: 400; font-size:14px; line-height:26px;'>";
it = _skills.begin();
for(; it < _skills.end(); ++it)
html += "<span style='background-color:rgba(102,102,102,.5);'> " + *it + " </span> ";
html += "</p>";
}
vector<string> _languages = info.languages();
if(!_languages.empty()) {
html += "<h4><img src='img/flag27.png'> Languages</h4><p style='font-weight: 400; font-size:14px;'>";
it = _languages.begin();
for(; it < _languages.end(); ++it)
html += *it + " ";
html += "</p>";
}
list<Experience*> _exp = info.experiences();
if(!_exp.empty()) {
html += "<h4><img src='img/graduate34.png'> Educations</h4><ul style='font-weight: 400; font-size:14px;'>";
list<Experience*>::const_iterator itr = _exp.begin();
string jobs = "";
bool job = false;
for(; itr != _exp.end(); ++itr) {
if((*itr)->type() == 0)
if(itr == _exp.end())
html += "<li>" + (*itr)->role() + " at " + (*itr)->location() + " from " + (*itr)->from().toString("dd.MM.yyyy").toStdString() + " to " + (*itr)->to().toString("dd.MM.yyyy").toStdString() + "</li>";
else
html += "<li>" + (*itr)->role() + " at " + (*itr)->location() + " from " + (*itr)->from().toString("dd.MM.yyyy").toStdString() + " to " + (*itr)->to().toString("dd.MM.yyyy").toStdString() + "</li>";
else if((*itr)->type() == 1) {
job = true;
if(itr == _exp.end())
jobs += "<li>" + (*itr)->role() + " at " + (*itr)->location() + " from " + (*itr)->from().toString("dd.MM.yyyy").toStdString() + " to " + (*itr)->to().toString("dd.MM.yyyy").toStdString() + "</li>";
else
jobs += "<li>" + (*itr)->role() + " at " + (*itr)->location() + " from " + (*itr)->from().toString("dd.MM.yyyy").toStdString() + " to " + (*itr)->to().toString("dd.MM.yyyy").toStdString() + "</li>";
}
}
if(job) {
html += "</ul><h4><img src='img/work3.png'> Job Experiences</h4><ul style='font-weight: 400; font-size:14px;'>";
html += jobs;
}
}
html += "</ul>";
if(!info.email().empty() || !info.telephon().empty() || !info.address().empty())
html += "<h4><img src='img/business133.png'> Contacts</h4><p style='font-weight: 400; font-size:14px'>E-mail: " + info.email() + " <br>Website: <a style='color:#4782EC;' href='#'>" + info.website() + "</a><br> Telephon: " + info.telephon() + "</p>";
return html;
}
示例2: if
vector<QJsonObject> LinqDB::writeJson() const {
vector<QJsonObject> vjs;
UserInfo* uif; Bio* bio;
list<SmartPtr<User> >::const_iterator it = _db.begin();
for(; it != _db.end(); ++it) {
QJsonObject jUser, jInf, jFormations, jWork, jPayment, jInMail, jOutMail;
QJsonArray jArr, jLang, jSkill, jInterest, jForArr, jForWrk, jPay, jKWords, jVis, jInMailArr, jOutMailArr;
list<Experience*> experience;
list<SmartPtr<Message> > inMail;
list<SmartPtr<Message> > outMail;
vector<SmartPtr<Payment> > payments;
Info* info = (*it)->account()->info();
if((uif = dynamic_cast<UserInfo*> (info))) { /*downcast a userinfo*/
jInf["name"] = QString::fromStdString(uif->name());
jInf["surname"] = QString::fromStdString(uif->surname());
jInf["telephon"] = QString::fromStdString(uif->telephon());
jInf["birthdate"] = (uif->birthdate().toString("dd.MM.yyyy"));
jInf["email"] = QString::fromStdString(uif->email());
jInf["address"] = QString::fromStdString(uif->address());
jInf["website"] = QString::fromStdString(uif->website());
experience = uif->experiences();
if((bio = dynamic_cast<Bio*> (info)))
jInf["biography"] = QString::fromStdString(bio->bio());
}
for(list<Experience*>::const_iterator j = experience.begin(); j != experience.end(); ++j) {
if((*j)->type() == 0) {
jFormations["location"] = QString::fromStdString((*j)->location());
jFormations["from"] = ((*j)->from().toString("dd.MM.yyyy"));
jFormations["to"] = ((*j)->to().toString("dd.MM.yyyy"));
jFormations["role"] = QString::fromStdString((*j)->role());
jForArr.append(jFormations);
}
else if((*j)->type() == 1) {
jWork["location"] = QString::fromStdString((*j)->location());
jWork["from"] = ((*j)->from().toString("dd.MM.yyyy"));
jWork["to"] = ((*j)->to().toString("dd.MM.yyyy"));
jWork["role"] = QString::fromStdString((*j)->role());
jForWrk.append(jWork);
}
}
vector<string>::const_iterator itr;
vector<string> languages = uif->languages();
itr = languages.begin();
for(; itr < languages.end(); ++itr)
jLang.append(QString::fromStdString(*itr));
vector<string> skills = uif->skills();
itr = skills.begin();
for(; itr < skills.end(); ++itr)
jSkill.append(QString::fromStdString(*itr));
vector<string> interests = uif->interests();
itr = interests.begin();
for(; itr < interests.end(); ++itr)
jInterest.append(QString::fromStdString(*itr));
jUser["avatar"] = QString::fromStdString((*it)->account()->avatar().path());
jUser["username"] = QString::fromStdString((*it)->account()->username().login());
jUser["password"] = QString::fromStdString((*it)->account()->username().password());
jUser["visitcount"] = (*it)->visitCount();
jUser["privilege"] = (*it)->account()->prLevel();
vector<Username> ulist = (*it)->net()->username();
vector<Username>::const_iterator itu = ulist.begin();
for(; itu < ulist.end(); ++itu)
jArr.append(QString::fromStdString((*itu).login()));
payments = (*it)->account()->history();
vector<SmartPtr<Payment> >::const_iterator iter = payments.begin();
for(; iter < payments.end(); ++iter) {
if((*iter)->billMethod() != NULL) {
jPayment["code"] = QString::fromStdString((*iter)->billMethod()->code());
jPayment["nominee"] = QString::fromStdString((*iter)->billMethod()->nominee());
}
jPayment["approved"] = (*iter)->approvation();
jPayment["appdate"] = (*iter)->appDate().toString("dd.MM.yyyy");
jPayment["level"] = (*iter)->subscription()->level();
jPay.append(jPayment);
}
if(const ExecutiveUser* ex = dynamic_cast<const ExecutiveUser*> (&(*(*it)))) {
map<string, int> kw = ex->keywords();
for(map<string, int>::iterator itm = kw.begin(); itm != kw.end(); ++itm) {
for(int i = 0; i < itm->second; ++i)
jKWords.append(QString::fromStdString(itm->first));
}
jUser["keywords"] = jKWords;
list<SmartPtr<User> > v = ex->visitors();
for(list<SmartPtr<User> >::iterator itr = v.begin(); itr != v.end(); ++itr)
jVis.append(QString::fromStdString((*itr)->account()->username().login()));
jUser["visitors"] = jVis;
}
inMail = (*it)->inMail();
outMail = (*it)->outMail();
list<SmartPtr<Message> >::const_iterator m_it = inMail.begin();
for(; m_it != inMail.end(); ++m_it) {
jInMail["receiver"] = QString::fromStdString((*it)->account()->username().login());
jInMail["sender"] = QString::fromStdString((*m_it)->sender().login());
jInMail["object"] = QString::fromStdString((*m_it)->object());
jInMail["body"] = QString::fromStdString((*m_it)->body());
jInMail["read"] = (*m_it)->isRead();
jInMail["sent"] = (*m_it)->sent().toString("dd.MM.yyyy");
// jInMail["recv"] = (*m_it)->recv().toString("dd.MM.yyyy");
jInMailArr.append(jInMail);
}
m_it = outMail.begin();
//.........这里部分代码省略.........