@@ -35,7 +35,7 @@ bool HostPathDevice::Initialize() {
|
||||
}
|
||||
}
|
||||
|
||||
auto root_entry = new HostPathEntry(this, "", local_path_);
|
||||
auto root_entry = new HostPathEntry(this, nullptr, "", local_path_);
|
||||
root_entry->attributes_ = kFileAttributeDirectory;
|
||||
root_entry_ = std::unique_ptr<Entry>(root_entry);
|
||||
PopulateEntry(root_entry);
|
||||
@@ -43,12 +43,12 @@ bool HostPathDevice::Initialize() {
|
||||
return true;
|
||||
}
|
||||
|
||||
void HostPathDevice::PopulateEntry(HostPathEntry* entry) {
|
||||
auto child_infos = xe::filesystem::ListFiles(entry->local_path());
|
||||
void HostPathDevice::PopulateEntry(HostPathEntry* parent_entry) {
|
||||
auto child_infos = xe::filesystem::ListFiles(parent_entry->local_path());
|
||||
for (auto& child_info : child_infos) {
|
||||
auto child =
|
||||
new HostPathEntry(this, xe::to_string(child_info.name),
|
||||
xe::join_paths(entry->local_path(), child_info.name));
|
||||
auto child = new HostPathEntry(
|
||||
this, parent_entry, xe::to_string(child_info.name),
|
||||
xe::join_paths(parent_entry->local_path(), child_info.name));
|
||||
child->create_timestamp_ = child_info.create_timestamp;
|
||||
child->access_timestamp_ = child_info.access_timestamp;
|
||||
child->write_timestamp_ = child_info.write_timestamp;
|
||||
@@ -65,7 +65,7 @@ void HostPathDevice::PopulateEntry(HostPathEntry* entry) {
|
||||
xe::round_up(child_info.total_size, bytes_per_sector());
|
||||
}
|
||||
|
||||
entry->children_.push_back(std::unique_ptr<Entry>(child));
|
||||
parent_entry->children_.push_back(std::unique_ptr<Entry>(child));
|
||||
|
||||
if (child_info.type == xe::filesystem::FileInfo::Type::kDirectory) {
|
||||
PopulateEntry(child);
|
||||
|
||||
Reference in New Issue
Block a user