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

Function collectTreeImpl

3ds/source/io.cpp:85–105  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

83}
84
85static Result collectTreeImpl(FS_Archive arch, const std::u16string& root, const std::u16string& sub, std::vector<io::TreeEntry>& out)
86{
87 Directory items(arch, root + sub);
88 if (!items.good()) {
89 return items.error();
90 }
91 for (size_t i = 0, sz = items.size(); i < sz; i++) {
92 std::u16string rel = sub + items.entry(i);
93 if (items.folder(i)) {
94 out.push_back({rel, true});
95 Result res = collectTreeImpl(arch, root, rel + StringUtils::UTF8toUTF16("/"), out);
96 if (R_FAILED(res)) {
97 return res;
98 }
99 }
100 else {
101 out.push_back({rel, false});
102 }
103 }
104 return 0;
105}
106
107Result io::collectTree(FS_Archive arch, const std::u16string& path, std::vector<TreeEntry>& out)
108{

Callers 1

collectTreeMethod · 0.85

Calls 6

goodMethod · 0.45
errorMethod · 0.45
sizeMethod · 0.45
entryMethod · 0.45
folderMethod · 0.45
push_backMethod · 0.45

Tested by

no test coverage detected