xref: /haiku/headers/os/storage/SymLink.h (revision ca8ed5ea660fb6275799a3b7f138b201c41a667b)
1 /*
2  * Copyright 2002-2007 Haiku, Inc. All rights reserved.
3  * Distributed under the terms of the MIT License.
4  */
5 #ifndef _SYM_LINK_H
6 #define _SYM_LINK_H
7 
8 
9 #include <Node.h>
10 #include <StorageDefs.h>
11 
12 
13 class BDirectory;
14 class BPath;
15 
16 class BSymLink : public BNode {
17 public:
18 								BSymLink();
19 								BSymLink(const BSymLink& other);
20 								BSymLink(const entry_ref* ref);
21 								BSymLink(const BEntry* entry);
22 								BSymLink(const char* path);
23 								BSymLink(const BDirectory* dir,
24 								         const char* path);
25 	virtual						~BSymLink();
26 
27 			ssize_t				ReadLink(char* buf, size_t size);
28 
29 			ssize_t				MakeLinkedPath(const char* dirPath,
30 									BPath* path);
31 			ssize_t				MakeLinkedPath(const BDirectory* dir,
32 									BPath* path);
33 
34 			bool				IsAbsolute();
35 
36 private:
37 	virtual	void				_MissingSymLink1();
38 	virtual	void				_MissingSymLink2();
39 	virtual	void				_MissingSymLink3();
40 	virtual	void				_MissingSymLink4();
41 	virtual	void				_MissingSymLink5();
42 	virtual	void				_MissingSymLink6();
43 
44 			uint32				_reservedData[4];
45 			BEntry*				fSecretEntry;
46 
47 private:
48 			int					get_fd() const;
49 };
50 
51 
52 #endif	// _SYM_LINK_H
53