1
0
Fork 0
mirror of https://github.com/KingDuckZ/dindexer.git synced 2025-08-10 14:09:48 +00:00

Add stub code to detect VCDs, plus unit test.

This commit is contained in:
King_DuckZ 2016-02-19 21:57:43 +01:00
parent 7da13f6677
commit f31463480f
5 changed files with 179 additions and 16 deletions

View file

@ -61,16 +61,25 @@ namespace mchlib {
template <bool Const>
inline
std::size_t count_listing_items (const SetListingView<Const>& /*parList*/) {
assert(false);
return 0;
//return std::count_if(
// parList.cbegin(),
// parList.cend(),
// [] (const FileRecordData&) {
// return true;
// }
//);
std::size_t count_listing_items (const SetListingView<Const>& parList) {
return std::count_if(
parList.cbegin(),
parList.cend(),
[] (const FileRecordData&) {
return true;
}
);
}
template <bool Const>
inline
std::size_t count_listing_items_recursive (const SetListingView<Const>& parList) {
std::size_t retval = 0;
for (auto it = parList.begin(), itEND = parList.end(); it != itEND; ++it, ++retval) {
if (it->is_directory)
retval += count_listing_items_recursive(SetListingView<Const>(it));
}
return retval;
}
} //namespace mchlib