The Pedigree Project 0.1
FatSymlink.h
1/*
2 * Copyright (c) 2008-2014, Pedigree Developers
3 *
4 * Please see the CONTRIB file in the root of the source tree for a full
5 * list of contributors.
6 *
7 * Permission to use, copy, modify, and distribute this software for any
8 * purpose with or without fee is hereby granted, provided that the above
9 * copyright notice and this permission notice appear in all copies.
10 *
11 * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
12 * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
13 * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
14 * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
15 * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
16 * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
17 * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
18 */
19
20#ifndef FAT_SYMLINK_H
21#define FAT_SYMLINK_H
22
23#include "pedigree/kernel/processor/types.h"
24#include "pedigree/kernel/time/Time.h"
25#include "pedigree/kernel/utilities/String.h"
26
27#include "modules/system/vfs/Symlink.h"
28
29class File;
30
38class FatSymlink : public Symlink {
39 friend class FatFilesystem;
40
41 public:
42 FatSymlink(String name, Time::Timestamp accessedTime, Time::Timestamp modifiedTime,
43 Time::Timestamp creationTime, uintptr_t inode, class Filesystem* pFs, size_t size,
44 uint32_t dirClus = 0, uint32_t dirOffset = 0, File* pParent = 0);
45 ~FatSymlink() override;
46 void fileAttributeChanged() override;
47 bool sync() override;
48 bool sync(size_t, bool) override {
49 return sync();
50 }
51 Attributes getAttributes() const override;
52 uint32_t getDirCluster() {
53 return m_DirClus;
54 }
55 void setDirCluster(uint32_t custom) {
56 m_DirClus = custom;
57 }
58 uint32_t getDirOffset() {
59 return m_DirOffset;
60 }
61 void setDirOffset(uint32_t custom) {
62 m_DirOffset = custom;
63 }
64
70 uint64_t readBytewise(uint64_t location, uint64_t size, uintptr_t buffer,
71 bool bCanBlock = true) override;
75 uint64_t writeBytewise(uint64_t location, uint64_t size, uintptr_t buffer,
76 bool bCanBlock = true) override;
77
78 private:
79 bool m_Unlinked = false;
80 uint32_t m_DirClus;
81 uint32_t m_DirOffset;
82};
83
84#endif
Definition File.h:75