1 /* 2 * Copyright 2011, Ingo Weinhold, ingo_weinhold@gmx.de. 3 * Distributed under the terms of the MIT License. 4 */ 5 #ifndef PACKAGE_LINK_SYMLINK_H 6 #define PACKAGE_LINK_SYMLINK_H 7 8 9 #include "Node.h" 10 11 12 class Package; 13 class PackageLinksListener; 14 15 16 class PackageLinkSymlink : public Node { 17 public: 18 enum Type { 19 TYPE_INSTALLATION_LOCATION, 20 TYPE_SETTINGS, 21 22 TYPE_ENUM_COUNT 23 }; 24 25 public: 26 PackageLinkSymlink(Package* package, 27 Type type); 28 virtual ~PackageLinkSymlink(); 29 30 void Update(Package* package, 31 PackageLinksListener* listener); 32 33 virtual mode_t Mode() const; 34 virtual timespec ModifiedTime() const; 35 virtual off_t FileSize() const; 36 37 virtual status_t Read(off_t offset, void* buffer, 38 size_t* bufferSize); 39 virtual status_t Read(io_request* request); 40 41 virtual status_t ReadSymlink(void* buffer, size_t* bufferSize); 42 43 private: 44 struct OldAttributes; 45 46 private: 47 timespec fModifiedTime; 48 const char* fLinkPath; 49 Type fType; 50 }; 51 52 53 #endif // PACKAGE_LINK_SYMLINK_H 54