📄 checker.cc
字号:
// Larbin// Sebastien Ailleret// 15-11-99 -> 13-04-00/* This modules is a filter * given some normalized URLs, it makes sure their extensions are OK * and send them if it didn't see them before */#include <iostream.h>#include "types.h"#include "global.h"#include "xutils/url.h"#include "xutils/text.h"#include "xutils/Vector.h"#include "xfetcher/hashTable.h"#include "xfetcher/file.h"#include "xutils/debug.h"/** check if an url is allready known * if not send it * @param u the url to check */void check (url *u) { if (global::seen->testSet(u)) { hashUrls(); // stat // where should this link go ? if (global::isSpecific && endWithIgnoreCase(global::privilegedExt, u->getFile())) { interestingExtension(); u->print(); global::URLsInput->put(u); } else { global::URLsInternal->put(u); } } else { // This url has already been seen delete u; }}/** Check the extension of an url * @return true if it might be interesting, false otherwise */bool filter1 (char *host, char *file) { int i=0; if (global::domains != NULL) { bool ok = false; while ((*global::domains)[i] != NULL) { ok = ok || endWith((*global::domains)[i], host); i++; } if (!ok) { return false; } } i=0; while (global::forbExt[i] != NULL) { if (endWithIgnoreCase(global::forbExt[i], file)) { return false; } i++; } return true;}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -