| 200 | } |
| 201 | |
| 202 | size_t io::countFiles(const std::string& path) |
| 203 | { |
| 204 | size_t count = 0; |
| 205 | Directory items(path); |
| 206 | if (!items.good()) { |
| 207 | return 0; |
| 208 | } |
| 209 | for (size_t i = 0, sz = items.size(); i < sz; i++) { |
| 210 | if (items.folder(i)) { |
| 211 | count += io::countFiles(path + items.entry(i) + "/"); |
| 212 | } |
| 213 | else { |
| 214 | count++; |
| 215 | } |
| 216 | } |
| 217 | return count; |
| 218 | } |
| 219 | |
| 220 | u64 io::directorySize(const std::string& path) |
| 221 | { |