本文整理汇总了C++中std::tr1::shared_ptr::link方法的典型用法代码示例。如果您正苦于以下问题:C++ shared_ptr::link方法的具体用法?C++ shared_ptr::link怎么用?C++ shared_ptr::link使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类std::tr1::shared_ptr
的用法示例。
在下文中一共展示了shared_ptr::link方法的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: set_item_title
void rss_parser::set_item_title(std::tr1::shared_ptr<rss_feed> feed, std::tr1::shared_ptr<rss_item> x, rsspp::item& item) {
if (is_html_type(item.title_type)) {
x->set_title(render_xhtml_title(item.title, feed->link()));
} else {
std::string title = item.title;
replace_newline_characters(title);
x->set_title(title);
}
}
示例2: fill_feed_items
void rss_parser::fill_feed_items(std::tr1::shared_ptr<rss_feed> feed) {
/*
* we iterate over all items of a feed, create an rss_item object for
* each item, and fill it with the appropriate values from the data structure.
*/
for (std::vector<rsspp::item>::iterator item=f.items.begin();item!=f.items.end();item++) {
std::tr1::shared_ptr<rss_item> x(new rss_item(ch));
set_item_title(feed, x, *item);
if (item->link != "") {
x->set_link(utils::absolute_url(feed->link(), item->link));
}
set_item_author(x, *item);
x->set_feedurl(feed->rssurl());
if (f.rss_version == rsspp::ATOM_1_0 && item->labels.size() > 0) {
std::vector<std::string>::const_iterator start, finish;
start = item->labels.begin();
finish = item->labels.end();
if (std::find(start, finish, "fresh") != finish) {
x->set_unread_nowrite(true);
x->set_override_unread(true);
}
if (std::find(start, finish, "kept-unread") != finish) {
x->set_unread_nowrite(true);
x->set_override_unread(true);
}
if (std::find(start, finish, "read") != finish) {
x->set_unread_nowrite(false);
x->set_override_unread(true);
}
}
set_item_content(x, *item);
if (item->pubDate != "")
x->set_pubDate(parse_date(item->pubDate));
else
x->set_pubDate(::time(NULL));
x->set_guid(get_guid(*item));
x->set_base(item->base);
set_item_enclosure(x, *item);
LOG(LOG_DEBUG, "rss_parser::parse: item title = `%s' link = `%s' pubDate = `%s' (%d) description = `%s'", x->title().c_str(),
x->link().c_str(), x->pubDate().c_str(), x->pubDate_timestamp(), x->description().c_str());
add_item_to_feed(feed, x);
}
}
示例3: set_item_content
void rss_parser::set_item_content(std::tr1::shared_ptr<rss_item> x, rsspp::item& item) {
handle_content_encoded(x, item);
handle_itunes_summary(x, item);
if (x->description() == "") {
x->set_description(item.description);
} else {
if (cfgcont->get_configvalue_as_bool("always-display-description") && item.description != "")
x->set_description(x->description() + "<hr>" + item.description);
}
/* if it's still empty and we shall download the full page, then we do so. */
if (x->description() == "" && cfgcont->get_configvalue_as_bool("download-full-page") && x->link() != "") {
x->set_description(utils::retrieve_url(x->link(), cfgcont));
}
LOG(LOG_DEBUG, "rss_parser::set_item_content: content = %s", x->description().c_str());
}
示例4: fill_feed_fields
void rss_parser::fill_feed_fields(std::tr1::shared_ptr<rss_feed> feed) {
/*
* we fill all the feed members with the appropriate values from the rsspp data structure
*/
if (is_html_type(f.title_type)) {
feed->set_title(render_xhtml_title(f.title, feed->link()));
} else {
feed->set_title(f.title);
}
feed->set_description(f.description);
feed->set_link(utils::absolute_url(my_uri, f.link));
if (f.pubDate != "")
feed->set_pubDate(parse_date(f.pubDate));
else
feed->set_pubDate(::time(NULL));
set_rtl(feed, f.language.c_str());
LOG(LOG_DEBUG, "rss_parser::parse: feed title = `%s' link = `%s'", feed->title().c_str(), feed->link().c_str());
}
示例5: operator
bool operator()(std::tr1::shared_ptr<rss_item> a, std::tr1::shared_ptr<rss_item> b) {
return reverse ? (strcmp(a->link().c_str(), b->link().c_str()) > 0) : (strcmp(a->link().c_str(), b->link().c_str()) < 0);
}
示例6: add_item_to_feed
void rss_parser::add_item_to_feed(std::tr1::shared_ptr<rss_feed> feed, std::tr1::shared_ptr<rss_item> item) {
// only add item to feed if it isn't on the ignore list or if there is no ignore list
if (!ign || !ign->matches(item.get())) {
feed->add_item(item);
LOG(LOG_INFO, "rss_parser::parse: added article title = `%s' link = `%s' ign = %p", item->title().c_str(), item->link().c_str(), ign);
} else {
LOG(LOG_INFO, "rss_parser::parse: ignored article title = `%s' link = `%s'", item->title().c_str(), item->link().c_str());
}
}