MCPcopy Create free account
hub / github.com/apache/arrow / FindEntry

Method FindEntry

cpp/src/arrow/filesystem/mockfs.cc:292–314  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

290
291 template <typename It>
292 Entry* FindEntry(It it, It end, size_t* nconsumed) {
293 size_t consumed = 0;
294 Entry* entry = &root;
295
296 for (; it != end; ++it) {
297 const std::string& part = *it;
298 DCHECK(entry->is_dir());
299 Entry* child = entry->as_dir().Find(part);
300 if (child == nullptr) {
301 // Partial find only
302 break;
303 }
304 ++consumed;
305 entry = child;
306 if (entry->is_file()) {
307 // Cannot go any further
308 break;
309 }
310 // Recurse
311 }
312 *nconsumed = consumed;
313 return entry;
314 }
315
316 // Find an entry, allowing partial matching
317 Entry* FindEntry(const std::vector<std::string>& parts, size_t* nconsumed) {

Callers 3

CreateDirMethod · 0.80
DeleteDirContentsMethod · 0.80
GetFileInfoMethod · 0.80

Calls 6

is_dirMethod · 0.80
is_fileMethod · 0.80
FindMethod · 0.45
beginMethod · 0.45
endMethod · 0.45
sizeMethod · 0.45

Tested by

no test coverage detected