From c104dedc32aa6a342b919b26b5cbdd3bce45d94a Mon Sep 17 00:00:00 2001 From: Marcus Holland-Moritz Date: Sun, 31 Dec 2023 17:36:42 +0100 Subject: [PATCH] chore(entry): remove unused type_string() method --- include/dwarfs/entry.h | 1 - include/dwarfs/entry_interface.h | 1 - src/dwarfs/entry.cpp | 24 ------------------------ 3 files changed, 26 deletions(-) diff --git a/include/dwarfs/entry.h b/include/dwarfs/entry.h index dc8643473..103ca26fa 100644 --- a/include/dwarfs/entry.h +++ b/include/dwarfs/entry.h @@ -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 const& f); virtual void walk(std::function const& f) const; diff --git a/include/dwarfs/entry_interface.h b/include/dwarfs/entry_interface.h index bd53b890e..a90a0fdef 100644 --- a/include/dwarfs/entry_interface.h +++ b/include/dwarfs/entry_interface.h @@ -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; diff --git a/src/dwarfs/entry.cpp b/src/dwarfs/entry.cpp index 53da0fc51..1d50079d6 100644 --- a/src/dwarfs/entry.cpp +++ b/src/dwarfs/entry.cpp @@ -140,30 +140,6 @@ bool entry::less_revpath(entry const& rhs) const { return static_cast(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 const& f) { f(this); }