From 8ea2f57ddd869f40433f3479c73ed9e1b6eed510 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Axel=20D=C3=B6rfler?= Date: Mon, 18 Nov 2002 01:10:31 +0000 Subject: [PATCH] Added some more type identifying methods and constants (i.e. Inode::IsAttribute()). git-svn-id: file:///srv/svn/repos/haiku/trunk/current@1984 a95241bf-73f2-0310-859d-f6bbb57e9c96 --- src/add-ons/kernel/file_systems/bfs/Inode.h | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/src/add-ons/kernel/file_systems/bfs/Inode.h b/src/add-ons/kernel/file_systems/bfs/Inode.h index 692bbf3c08..2945063765 100644 --- a/src/add-ons/kernel/file_systems/bfs/Inode.h +++ b/src/add-ons/kernel/file_systems/bfs/Inode.h @@ -39,7 +39,9 @@ class AttributeIterator; enum inode_type { S_DIRECTORY = S_IFDIR, S_FILE = S_IFREG, - S_SYMLINK = S_IFLNK + S_SYMLINK = S_IFLNK, + + S_REGULAR = (S_DIRECTORY | S_FILE | S_SYMLINK), }; @@ -140,6 +142,9 @@ class Inode : public CachedBlock { bool IsIndex() const { return (Mode() & (S_INDEX_DIR | 0777)) == S_INDEX_DIR; } // that's a stupid check, but AFAIK the only possible method... + bool IsAttribute() const { return Mode() & S_ATTR; } + bool IsRegularNode() const { return (Mode() & (S_ATTR_DIR | S_INDEX_DIR | S_ATTR)) == 0; } + // a regular node in the standard namespace (i.e. not an index or attribute) bool IsSymLink() const { return S_ISLNK(Mode()); } bool HasUserAccessableStream() const { return S_ISREG(Mode()); } // currently only files can be accessed with bfs_read()/bfs_write()