本文整理汇总了C++中NOTICES::size方法的典型用法代码示例。如果您正苦于以下问题:C++ NOTICES::size方法的具体用法?C++ NOTICES::size怎么用?C++ NOTICES::size使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类NOTICES
的用法示例。
在下文中一共展示了NOTICES::size方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: init_rss
// called at the end of client initialization
//
void NOTICES::init_rss() {
rss_feeds.init();
if (log_flags.notice_debug) {
msg_printf(0, MSG_INFO, "read %d total notices", (int)notices.size());
}
// sort by decreasing arrival time, then assign seqnos
//
sort(notices.begin(), notices.end(), cmp);
size_t n = notices.size();
for (unsigned int i=0; i<n; i++) {
notices[i].seqno = (int)(n - i);
}
}
示例2: write_archive
// write archive file for the given RSS feed
// (or, if NULL, non-RSS notices)
//
void NOTICES::write_archive(RSS_FEED* rfp) {
char path[MAXPATHLEN];
if (rfp) {
rfp->archive_file_name(path);
} else {
safe_strcpy(path, NOTICES_DIR"/archive.xml");
}
FILE* f = fopen(path, "w");
if (!f) return;
MIOFILE fout;
fout.init_file(f);
fout.printf("<notices>\n");
if (!f) return;
for (unsigned int i=0; i<notices.size(); i++) {
NOTICE& n = notices[i];
if (rfp) {
if (strcmp(rfp->url, n.feed_url)) continue;
} else {
if (strlen(n.feed_url)) continue;
}
n.write(fout, false);
}
fout.printf("</notices>\n");
fclose(f);
}
示例3: init
// called at the start of client initialization
//
void NOTICES::init() {
#if 0
read_archive_file(NOTICES_DIR"/archive.xml", NULL);
if (log_flags.notice_debug) {
msg_printf(0, MSG_INFO, "read %d BOINC notices", (int)notices.size());
}
write_archive(NULL);
#endif
}
示例4: write
// write notices newer than seqno as XML (for GUI RPC).
// Write them in order of increasing seqno
//
void NOTICES::write(int seqno, GUI_RPC_CONN& grc, bool public_only) {
size_t i;
MIOFILE mf;
if (!net_status.need_physical_connection) {
remove_notices(NULL, REMOVE_NETWORK_MSG);
}
if (log_flags.notice_debug) {
msg_printf(0, MSG_INFO, "NOTICES::write: seqno %d, refresh %s, %d notices",
seqno, grc.get_notice_refresh()?"true":"false", (int)notices.size()
);
}
grc.mfout.printf("<notices>\n");
if (grc.get_notice_refresh()) {
grc.clear_notice_refresh();
NOTICE n;
n.seqno = -1;
seqno = -1;
i = notices.size();
n.write(grc.mfout, true);
if (log_flags.notice_debug) {
msg_printf(0, MSG_INFO, "NOTICES::write: sending -1 seqno notice");
}
} else {
for (i=0; i<notices.size(); i++) {
NOTICE& n = notices[i];
if (n.seqno <= seqno) break;
}
}
for (; i>0; i--) {
NOTICE& n = notices[i-1];
if (public_only && n.is_private) continue;
if (log_flags.notice_debug) {
msg_printf(0, MSG_INFO, "NOTICES::write: sending notice %d", n.seqno);
}
n.write(grc.mfout, true);
}
grc.mfout.printf("</notices>\n");
}