Skip to content

Instantly share code, notes, and snippets.

@tejasvi
Last active April 22, 2019 07:02
Show Gist options
  • Save tejasvi/a9fc9bc7393180dd66bf45945badb04c to your computer and use it in GitHub Desktop.
Save tejasvi/a9fc9bc7393180dd66bf45945badb04c to your computer and use it in GitHub Desktop.
switch (d.get_type()) {
case DirectoryIterator::DIRECTORY: {
const char * pt = strrchr(d.leafname(), '.');
if (pt)
if (binary_search(dasfile.begin(), dasfile.end(), pt)) {
index_file(file, url, d, mime_map);
break;
}
size_t new_limit = depth_limit;
if (new_limit) {
if (--new_limit == 0) continue;
}
url += '/';
file += '/';
index_directory(file, url, new_limit, mime_map);
break;
}
case DirectoryIterator::REGULAR_FILE:
index_file(file, url, d, mime_map);
break;
default:
skip("U" + url, file.substr(root.size()), "Not a regular file",
d.get_size(), d.get_mtime(),
SKIP_VERBOSE_ONLY | SKIP_SHOW_FILENAME);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment