Restore the "GPL licensing not permitted" in GLUT license headers.
[haiku.git] / headers / build / os / storage / Statable.h
blob4dcb4bd5d153ba08d4b8134078d69da1355bc227
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
9 #include <SupportDefs.h>
11 #include <sys/types.h>
12 #include <sys/stat.h>
14 struct node_ref;
15 class BVolume;
18 class BStatable {
19 public:
20 virtual ~BStatable();
22 virtual status_t GetStat(struct stat *st) const = 0;
24 bool IsFile() const;
25 bool IsDirectory() const;
26 bool IsSymLink() const;
28 status_t GetNodeRef(node_ref *ref) const;
30 status_t GetOwner(uid_t *owner) const;
31 status_t SetOwner(uid_t owner);
33 status_t GetGroup(gid_t *group) const;
34 status_t SetGroup(gid_t group);
36 status_t GetPermissions(mode_t *perms) const;
37 status_t SetPermissions(mode_t perms);
39 status_t GetSize(off_t *size) const;
41 status_t GetModificationTime(time_t *mtime) const;
42 status_t SetModificationTime(time_t mtime);
44 status_t GetCreationTime(time_t *ctime) const;
45 status_t SetCreationTime(time_t ctime);
47 status_t GetAccessTime(time_t *atime) const;
48 status_t SetAccessTime(time_t atime);
50 status_t GetVolume(BVolume *vol) const;
52 private:
53 friend class BEntry;
54 friend class BNode;
56 virtual void _OhSoStatable1();
57 virtual void _OhSoStatable2();
58 virtual void _OhSoStatable3();
59 uint32 _reserved[4];
61 virtual status_t set_stat(struct stat &st, uint32 what) = 0;
64 #endif // _STATABLE_H