mirror of
https://github.com/mhx/dwarfs.git
synced 2025-09-10 04:50:31 -04:00
feat: add mode_string() and perm_string() to inode_view
This commit is contained in:
parent
064c7c74a6
commit
a8646a7d79
@ -99,6 +99,8 @@ class inode_view
|
|||||||
using mode_type = file_stat::mode_type;
|
using mode_type = file_stat::mode_type;
|
||||||
|
|
||||||
mode_type mode() const;
|
mode_type mode() const;
|
||||||
|
std::string mode_string() const;
|
||||||
|
std::string perm_string() const;
|
||||||
posix_file_type::value type() const {
|
posix_file_type::value type() const {
|
||||||
return posix_file_type::from_mode(mode());
|
return posix_file_type::from_mode(mode());
|
||||||
}
|
}
|
||||||
|
@ -543,6 +543,14 @@ auto inode_view::mode() const -> mode_type {
|
|||||||
return meta_->modes()[mode_index()];
|
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 {
|
auto inode_view::getuid() const -> uid_type {
|
||||||
return meta_->uids()[owner_index()];
|
return meta_->uids()[owner_index()];
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user