MCPcopy Create free account
hub / github.com/BernardoGiordano/Checkpoint / countFiles

Method countFiles

switch/source/io.cpp:202–218  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

200}
201
202size_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
220u64 io::directorySize(const std::string& path)
221{

Callers

nothing calls this directly

Calls 4

goodMethod · 0.45
sizeMethod · 0.45
folderMethod · 0.45
entryMethod · 0.45

Tested by

no test coverage detected