当前位置: 首页>>代码示例>>C++>>正文


C++ UserInfo::age方法代码示例

本文整理汇总了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);'>&nbsp;" + *it + "&nbsp;</span>&nbsp;&nbsp;";
        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);'>&nbsp;"  + *it + "&nbsp;</span>&nbsp;&nbsp;";
        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() + " &nbsp;&nbsp;<br>Website: <a style='color:#4782EC;' href='#'>" + info.website() + "</a><br> Telephon: " + info.telephon() + "</p>";
    return html;
}
开发者ID:codepr,项目名称:linqedin,代码行数:64,代码来源:dispatcher.cpp


注:本文中的UserInfo::age方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。