本文整理汇总了C++中UserInfo::age方法的典型用法代码示例。如果您正苦于以下问题:C++ UserInfo::age方法的具体用法?C++ UserInfo::age怎么用?C++ UserInfo::age使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类UserInfo
的用法示例。
在下文中一共展示了UserInfo::age方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的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;
}