2002-07-09 16:24:59 +04:00
|
|
|
//----------------------------------------------------------------------
|
|
|
|
// This software is part of the OpenBeOS distribution and is covered
|
|
|
|
// by the OpenBeOS license.
|
|
|
|
//
|
|
|
|
// File Name: SymLink.h
|
|
|
|
//---------------------------------------------------------------------
|
|
|
|
/*!
|
|
|
|
\file SymLink.h
|
|
|
|
BSymLink interface declaration.
|
|
|
|
*/
|
|
|
|
|
2002-08-12 11:24:02 +04:00
|
|
|
#ifndef _SYM_LINK_H
|
|
|
|
#define _SYM_LINK_H
|
2002-07-09 16:24:59 +04:00
|
|
|
|
|
|
|
#include <Node.h>
|
|
|
|
#include <StorageDefs.h>
|
|
|
|
|
|
|
|
#ifdef USE_OPENBEOS_NAMESPACE
|
|
|
|
namespace OpenBeOS {
|
|
|
|
#endif
|
|
|
|
|
|
|
|
/*!
|
|
|
|
\class BSymLink
|
|
|
|
\brief A symbolic link in the filesystem
|
|
|
|
|
|
|
|
Provides an interface for manipulating symbolic links.
|
|
|
|
|
|
|
|
\author <a href='mailto:bonefish@users.sf.net'>Ingo Weinhold</a>
|
|
|
|
|
|
|
|
\version 0.0.0
|
|
|
|
*/
|
|
|
|
class BSymLink : public BNode {
|
|
|
|
public:
|
|
|
|
BSymLink();
|
|
|
|
BSymLink(const BSymLink &link);
|
|
|
|
BSymLink(const entry_ref *ref);
|
|
|
|
BSymLink(const BEntry *entry);
|
|
|
|
BSymLink(const char *path);
|
|
|
|
BSymLink(const BDirectory *dir, const char *path);
|
|
|
|
virtual ~BSymLink();
|
|
|
|
|
|
|
|
// WORKAROUND
|
|
|
|
// SetTo() methods: Part of a work around until someone has an idea how to
|
2002-08-12 12:42:01 +04:00
|
|
|
// get BPrivate::Storage::read_link(FileDescriptor,...) to work.
|
2002-07-09 16:24:59 +04:00
|
|
|
status_t SetTo(const entry_ref *ref);
|
|
|
|
status_t SetTo(const BEntry *entry);
|
|
|
|
status_t SetTo(const char *path);
|
|
|
|
status_t SetTo(const BDirectory *dir, const char *path);
|
|
|
|
void Unset();
|
|
|
|
|
|
|
|
ssize_t ReadLink(char *buf, size_t size);
|
|
|
|
|
|
|
|
ssize_t MakeLinkedPath(const char *dirPath, BPath *path);
|
|
|
|
ssize_t MakeLinkedPath(const BDirectory *dir, BPath *path);
|
|
|
|
|
|
|
|
bool IsAbsolute();
|
|
|
|
|
|
|
|
// WORKAROUND
|
|
|
|
// operator=(): Part of a work around until someone has an idea how to
|
2002-08-12 12:42:01 +04:00
|
|
|
// get BPrivate::Storage::read_link(FileDescriptor,...) to work.
|
2002-07-09 16:24:59 +04:00
|
|
|
BSymLink &operator=(const BSymLink &link);
|
|
|
|
|
|
|
|
private:
|
|
|
|
virtual void _ReservedSymLink1();
|
|
|
|
virtual void _ReservedSymLink2();
|
|
|
|
virtual void _ReservedSymLink3();
|
|
|
|
virtual void _ReservedSymLink4();
|
|
|
|
virtual void _ReservedSymLink5();
|
|
|
|
virtual void _ReservedSymLink6();
|
|
|
|
|
|
|
|
// WORKAROUND
|
|
|
|
// fSecretEntry: Part of a work around until someone has an idea how to
|
2002-08-12 12:42:01 +04:00
|
|
|
// get BPrivate::Storage::read_link(FileDescriptor,...) to work.
|
2002-07-09 16:24:59 +04:00
|
|
|
// uint32 _reservedData[4];
|
|
|
|
uint32 _reservedData[3];
|
|
|
|
BEntry *fSecretEntry;
|
|
|
|
|
|
|
|
private:
|
2002-08-12 12:42:01 +04:00
|
|
|
BPrivate::Storage::FileDescriptor get_fd() const;
|
2002-07-09 16:24:59 +04:00
|
|
|
};
|
|
|
|
|
|
|
|
#ifdef USE_OPENBEOS_NAMESPACE
|
|
|
|
}; // namespace OpenBeOS
|
|
|
|
#endif
|
|
|
|
|
2002-08-12 11:24:02 +04:00
|
|
|
#endif // _SYM_LINK_H
|
2002-08-12 12:42:01 +04:00
|
|
|
|
|
|
|
|