本文整理汇总了C++中FILE_INFO::reset方法的典型用法代码示例。如果您正苦于以下问题:C++ FILE_INFO::reset方法的具体用法?C++ FILE_INFO::reset怎么用?C++ FILE_INFO::reset使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类FILE_INFO
的用法示例。
在下文中一共展示了FILE_INFO::reset方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: clear_errors
// if any input files had download error from previous WU,
// reset them to try download again
//
void WORKUNIT::clear_errors() {
int x;
unsigned int i;
for (i=0; i<input_files.size();i++) {
FILE_INFO* fip = input_files[i].file_info;
if (fip->had_failure(x)) {
fip->reset();
}
}
}
示例2: check_file_existence
// for each FILE_INFO (i.e. each project file the client knows about)
// check that the file exists and is of the right size.
// Called at startup.
//
void CLIENT_STATE::check_file_existence() {
unsigned int i;
char path[MAXPATHLEN];
for (i=0; i<file_infos.size(); i++) {
FILE_INFO* fip = file_infos[i];
if (fip->status < 0 && fip->downloadable()) {
// file had an error; reset it so that we download again
get_pathname(fip, path, sizeof(path));
msg_printf(fip->project, MSG_INFO,
"Resetting file %s: %s", path, boincerror(fip->status)
);
fip->reset();
continue;
}
if (cc_config.dont_check_file_sizes) continue;
if (fip->status == FILE_PRESENT) {
get_pathname(fip, path, sizeof(path));
double size;
int retval = file_size(path, size);
if (retval) {
delete_project_owned_file(path, true);
fip->status = FILE_NOT_PRESENT;
msg_printf(fip->project, MSG_INFO, "File %s not found", path);
} else if (fip->nbytes && (size != fip->nbytes)) {
if (gstate.global_prefs.dont_verify_images && is_image_file(path)) continue;
delete_project_owned_file(path, true);
fip->status = FILE_NOT_PRESENT;
msg_printf(fip->project, MSG_INFO,
"File %s has wrong size: expected %.0f, got %.0f",
path, fip->nbytes, size
);
}
}
}
}