feat: add mode_string() and perm_string() to inode_view

This commit is contained in:
Marcus Holland-Moritz 2023-12-30 14:53:35 +01:00
parent 064c7c74a6
commit a8646a7d79
2 changed files with 10 additions and 0 deletions

View File

@ -99,6 +99,8 @@ class inode_view
using mode_type = file_stat::mode_type;
mode_type mode() const;
std::string mode_string() const;
std::string perm_string() const;
posix_file_type::value type() const {
return posix_file_type::from_mode(mode());
}

View File

@ -543,6 +543,14 @@ auto inode_view::mode() const -> mode_type {
return meta_->modes()[mode_index()];
}
auto inode_view::mode_string() const -> std::string {
return file_stat::mode_string(mode());
}
auto inode_view::perm_string() const -> std::string {
return file_stat::perm_string(mode());
}
auto inode_view::getuid() const -> uid_type {
return meta_->uids()[owner_index()];
}