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


C++ FILE_INFO::reset方法代码示例

本文整理汇总了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();
        }
    }
}
开发者ID:nicolas17,项目名称:boincgit-test,代码行数:13,代码来源:client_types.cpp

示例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
                );
            }
        }
    }
}
开发者ID:UweBeckert,项目名称:boinc,代码行数:40,代码来源:cs_files.cpp


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