1// Entry.h
2
3#ifndef NET_FS_ENTRY_H
4#define NET_FS_ENTRY_H
5
6#include <HashString.h>
7#include <util/DoublyLinkedList.h>
8
9#include "EntryRef.h"
10
11class Directory;
12class Node;
13class Path;
14class Volume;
15
16// Entry
17class Entry : public DoublyLinkedListLinkImpl<Entry> {
18public:
19								Entry(Volume* volume, Directory* directory,
20									const char* name, Node* node);
21								~Entry();
22
23			status_t			InitCheck() const;
24
25			Volume*				GetVolume() const;
26			Directory*			GetDirectory() const;
27			NoAllocEntryRef		GetEntryRef() const;
28			dev_t				GetVolumeID() const;
29			ino_t				GetDirectoryID() const;
30			const char*			GetName() const;
31			Node*				GetNode() const;
32
33			status_t			GetPath(Path* path);
34
35			bool				Exists() const;
36
37			bool				IsActualEntry() const;
38
39private:
40			struct GetDirEntryLink;
41			friend struct GetDirEntryLink;
42			friend class Directory;
43
44			Volume*				fVolume;
45			Directory*			fDirectory;
46			HashString			fName;
47			Node*				fNode;
48			DoublyLinkedListLink<Entry> fDirEntryLink;
49};
50
51// GetDirEntryLink
52struct Entry::GetDirEntryLink {
53	DoublyLinkedListLink<Entry>* operator()(Entry* entry) const
54	{
55		return &entry->fDirEntryLink;
56	}
57
58	const DoublyLinkedListLink<Entry>* operator()(const Entry* entry) const
59	{
60		return &entry->fDirEntryLink;
61	}
62};
63
64#endif	// NET_FS_ENTRY_H
65