Skip to content

Commit

Permalink
chore(entry): remove unused type_string() method
Browse files Browse the repository at this point in the history
  • Loading branch information
mhx committed Dec 31, 2023
1 parent 1e0eeac commit c104ded
Show file tree
Hide file tree
Showing 3 changed files with 0 additions and 26 deletions.
1 change: 0 additions & 1 deletion include/dwarfs/entry.h
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,6 @@ class entry : public entry_interface {
bool less_revpath(entry const& rhs) const;
size_t size() const override { return stat_.size; }
virtual type_t type() const = 0;
std::string type_string() const override;
bool is_directory() const override;
virtual void walk(std::function<void(entry*)> const& f);
virtual void walk(std::function<void(const entry*)> const& f) const;
Expand Down
1 change: 0 additions & 1 deletion include/dwarfs/entry_interface.h
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,6 @@ class entry_interface : public object {
virtual std::string dpath() const = 0;
virtual std::string unix_dpath() const = 0;
virtual std::string const& name() const = 0;
virtual std::string type_string() const = 0;
virtual size_t size() const = 0;
virtual bool is_directory() const = 0;

Expand Down
24 changes: 0 additions & 24 deletions src/dwarfs/entry.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -140,30 +140,6 @@ bool entry::less_revpath(entry const& rhs) const {
return static_cast<bool>(rhs_p);
}

std::string entry::type_string() const {
switch (stat_.type()) {
case posix_file_type::regular:
return "file";
case posix_file_type::directory:
return "directory";
case posix_file_type::symlink:
return "link";
case posix_file_type::character:
return "chardev";
case posix_file_type::block:
return "blockdev";
case posix_file_type::fifo:
return "fifo";
case posix_file_type::socket:
return "socket";
default:
break;
}

DWARFS_THROW(runtime_error, fmt::format("unknown file type: {:#06x}",
fmt::underlying(stat_.type())));
}

bool entry::is_directory() const { return stat_.is_directory(); }

void entry::walk(std::function<void(entry*)> const& f) { f(this); }
Expand Down

0 comments on commit c104ded

Please sign in to comment.