mirror of
https://github.com/mhx/dwarfs.git
synced 2025-09-08 03:49:44 -04:00
refactor(metadata_types): remove unused code
This commit is contained in:
parent
9e201cfe65
commit
d13ea51ae5
@ -156,13 +156,7 @@ class dir_entry_view_impl {
|
||||
from_dir_entry_index(uint32_t self_index, global_metadata const& g,
|
||||
entry_name_type name_type = entry_name_type::other);
|
||||
|
||||
// TODO: this works, but it's strange; a limited version of
|
||||
// dir_entry_view_impl
|
||||
// should work without a parent for these use cases
|
||||
static std::string
|
||||
name(uint32_t index, global_metadata const& g); // TODO: remove?
|
||||
static std::shared_ptr<inode_view_impl>
|
||||
inode_shared(uint32_t index, global_metadata const& g); // TODO: remove?
|
||||
static std::string name(uint32_t index, global_metadata const& g);
|
||||
|
||||
std::string name() const;
|
||||
std::shared_ptr<inode_view_impl> inode_shared() const;
|
||||
|
@ -989,20 +989,6 @@ dir_entry_view_impl::name(uint32_t index, global_metadata const& g) {
|
||||
return std::string(g.meta().names()[iv.name_index_v2_2()]);
|
||||
}
|
||||
|
||||
std::shared_ptr<inode_view_impl>
|
||||
dir_entry_view_impl::inode_shared(uint32_t index, global_metadata const& g) {
|
||||
if (auto de = g.meta().dir_entries()) {
|
||||
DWARFS_CHECK(index < de->size(), "index out of range");
|
||||
auto dev = (*de)[index];
|
||||
return std::make_shared<inode_view_impl>(g.meta().inodes()[dev.inode_num()],
|
||||
dev.inode_num(), g.meta());
|
||||
}
|
||||
|
||||
DWARFS_CHECK(index < g.meta().inodes().size(), "index out of range");
|
||||
auto iv = g.meta().inodes()[index];
|
||||
return std::make_shared<inode_view_impl>(iv, iv.inode_v2_2(), g.meta());
|
||||
}
|
||||
|
||||
std::string dir_entry_view_impl::path() const {
|
||||
return u8string_to_string(fs_path().u8string());
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user