2007-10-16 00:13:55 +04:00
|
|
|
/*
|
2014-06-19 03:07:02 +04:00
|
|
|
* Copyright 2002-2007 Haiku, Inc. All rights reserved.
|
2007-10-16 00:13:55 +04:00
|
|
|
* Distributed under the terms of the MIT License.
|
|
|
|
*/
|
2002-08-12 11:24:02 +04:00
|
|
|
#ifndef _SYM_LINK_H
|
|
|
|
#define _SYM_LINK_H
|
2002-07-09 16:24:59 +04:00
|
|
|
|
2007-10-16 00:13:55 +04:00
|
|
|
|
2002-07-09 16:24:59 +04:00
|
|
|
#include <Node.h>
|
|
|
|
#include <StorageDefs.h>
|
|
|
|
|
2013-02-21 01:20:53 +04:00
|
|
|
|
2007-10-16 00:13:55 +04:00
|
|
|
class BDirectory;
|
|
|
|
class BPath;
|
|
|
|
|
2002-07-09 16:24:59 +04:00
|
|
|
class BSymLink : public BNode {
|
|
|
|
public:
|
2013-02-21 01:20:53 +04:00
|
|
|
BSymLink();
|
2014-06-19 03:07:02 +04:00
|
|
|
BSymLink(const BSymLink& other);
|
|
|
|
BSymLink(const entry_ref* ref);
|
|
|
|
BSymLink(const BEntry* entry);
|
|
|
|
BSymLink(const char* path);
|
|
|
|
BSymLink(const BDirectory* dir,
|
|
|
|
const char* path);
|
2013-02-21 01:20:53 +04:00
|
|
|
virtual ~BSymLink();
|
2002-07-09 16:24:59 +04:00
|
|
|
|
2014-06-19 03:07:02 +04:00
|
|
|
ssize_t ReadLink(char* buf, size_t size);
|
2002-07-09 16:24:59 +04:00
|
|
|
|
2014-06-19 03:07:02 +04:00
|
|
|
ssize_t MakeLinkedPath(const char* dirPath,
|
2015-03-03 04:27:26 +03:00
|
|
|
BPath* path);
|
2014-06-19 03:07:02 +04:00
|
|
|
ssize_t MakeLinkedPath(const BDirectory* dir,
|
2015-03-03 04:27:26 +03:00
|
|
|
BPath* path);
|
2002-07-09 16:24:59 +04:00
|
|
|
|
2013-02-21 01:20:53 +04:00
|
|
|
bool IsAbsolute();
|
2002-07-09 16:24:59 +04:00
|
|
|
|
|
|
|
private:
|
2013-02-21 01:20:53 +04:00
|
|
|
virtual void _MissingSymLink1();
|
|
|
|
virtual void _MissingSymLink2();
|
|
|
|
virtual void _MissingSymLink3();
|
|
|
|
virtual void _MissingSymLink4();
|
|
|
|
virtual void _MissingSymLink5();
|
|
|
|
virtual void _MissingSymLink6();
|
2002-07-09 16:24:59 +04:00
|
|
|
|
2013-02-21 01:20:53 +04:00
|
|
|
uint32 _reservedData[4];
|
|
|
|
BEntry* fSecretEntry;
|
2002-07-09 16:24:59 +04:00
|
|
|
|
|
|
|
private:
|
2013-02-21 01:20:53 +04:00
|
|
|
int get_fd() const;
|
2002-07-09 16:24:59 +04:00
|
|
|
};
|
|
|
|
|
2013-02-21 01:20:53 +04:00
|
|
|
|
2002-08-12 11:24:02 +04:00
|
|
|
#endif // _SYM_LINK_H
|