xref: /haiku/headers/build/os/storage/SymLink.h (revision a1f8d8a11c9ba7d1697a6270a221693a0c969667)
1 //----------------------------------------------------------------------
2 //  This software is part of the OpenBeOS distribution and is covered
3 //  by the OpenBeOS license.
4 //
5 //  File Name: SymLink.h
6 //---------------------------------------------------------------------
7 /*!
8 	\file SymLink.h
9 	BSymLink interface declaration.
10 */
11 
12 #ifndef _SYM_LINK_H
13 #define _SYM_LINK_H
14 
15 #include <Node.h>
16 #include <StorageDefs.h>
17 
18 #ifdef USE_OPENBEOS_NAMESPACE
19 namespace OpenBeOS {
20 #endif
21 
22 class BPath;
23 
24 /*!
25 	\class BSymLink
26 	\brief A symbolic link in the filesystem
27 
28 	Provides an interface for manipulating symbolic links.
29 
30 	\author <a href='mailto:bonefish@users.sf.net'>Ingo Weinhold</a>
31 
32 	\version 0.0.0
33 */
34 class BSymLink : public BNode {
35 public:
36 	BSymLink();
37 	BSymLink(const BSymLink &link);
38 	BSymLink(const entry_ref *ref);
39 	BSymLink(const BEntry *entry);
40 	BSymLink(const char *path);
41 	BSymLink(const BDirectory *dir, const char *path);
42 	virtual ~BSymLink();
43 
44 	ssize_t ReadLink(char *buf, size_t size);
45 
46 	ssize_t MakeLinkedPath(const char *dirPath, BPath *path);
47 	ssize_t MakeLinkedPath(const BDirectory *dir, BPath *path);
48 
49 	bool IsAbsolute();
50 
51 private:
52 	virtual void _MissingSymLink1();
53 	virtual void _MissingSymLink2();
54 	virtual void _MissingSymLink3();
55 	virtual void _MissingSymLink4();
56 	virtual void _MissingSymLink5();
57 	virtual void _MissingSymLink6();
58 
59 	uint32 _reservedData[4];
60 	BEntry *fSecretEntry;
61 
62 private:
63 	int get_fd() const;
64 };
65 
66 #ifdef USE_OPENBEOS_NAMESPACE
67 };		// namespace OpenBeOS
68 #endif
69 
70 #endif	// _SYM_LINK_H
71