1/*
2 * Copyright 2002-2007, Haiku, Inc. All Rights Reserved.
3 * Distributed under the terms of the MIT License.
4 */
5#ifndef _STATABLE_H
6#define _STATABLE_H
7
8
9#include <SupportDefs.h>
10
11#include <sys/types.h>
12#include <sys/stat.h>
13
14struct node_ref;
15class BVolume;
16
17
18class BStatable {
19	public:
20		virtual ~BStatable();
21
22		virtual status_t GetStat(struct stat *st) const = 0;
23
24		bool IsFile() const;
25		bool IsDirectory() const;
26		bool IsSymLink() const;
27
28		status_t GetNodeRef(node_ref *ref) const;
29
30		status_t GetOwner(uid_t *owner) const;
31		status_t SetOwner(uid_t owner);
32
33		status_t GetGroup(gid_t *group) const;
34		status_t SetGroup(gid_t group);
35
36		status_t GetPermissions(mode_t *perms) const;
37		status_t SetPermissions(mode_t perms);
38
39		status_t GetSize(off_t *size) const;
40
41		status_t GetModificationTime(time_t *mtime) const;
42		status_t SetModificationTime(time_t mtime);
43
44		status_t GetCreationTime(time_t *ctime) const;
45		status_t SetCreationTime(time_t ctime);
46
47		status_t GetAccessTime(time_t *atime) const;
48		status_t SetAccessTime(time_t atime);
49
50		status_t GetVolume(BVolume *vol) const;
51
52	private:
53		friend class BEntry;
54		friend class BNode;
55
56		virtual	void _OhSoStatable1();
57		virtual	void _OhSoStatable2();
58		virtual	void _OhSoStatable3();
59		uint32 _reserved[4];
60
61		virtual	status_t set_stat(struct stat &st, uint32 what) = 0;
62};
63
64#endif // _STATABLE_H
65