The Pedigree Project  0.1
RawFs.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 RAWFS_H
21 #define RAWFS_H
22 
23 #include "modules/system/vfs/Filesystem.h"
24 #include "pedigree/kernel/processor/types.h"
25 #include "pedigree/kernel/utilities/String.h"
26 
27 class Disk;
28 class File;
29 
32 class RawFs : public Filesystem
33 {
34  public:
35  RawFs();
36  virtual ~RawFs();
37 
38  //
39  // Filesystem interface.
40  //
41  virtual bool initialise(Disk *pDisk)
42  {
43  return false;
44  }
45  static Filesystem *probe(Disk *pDisk)
46  {
47  return 0;
48  }
49  virtual File *getRoot() const;
50  virtual String getVolumeLabel() const
51  {
52  return String("RawFs");
53  }
54  virtual uint64_t read(
55  File *pFile, uint64_t location, uint64_t size, uintptr_t buffer,
56  bool canBlock)
57  {
58  return 0;
59  }
60  virtual uint64_t write(
61  File *pFile, uint64_t location, uint64_t size, uintptr_t buffer,
62  bool canBlock)
63  {
64  return 0;
65  }
66  virtual void truncate(File *pFile)
67  {
68  return;
69  }
70  virtual void fileAttributeChanged(File *pFile)
71  {
72  return;
73  }
74  virtual void cacheDirectoryContents(File *pFile)
75  {
76  return;
77  }
78 
79  protected:
80  virtual bool createFile(File *parent, const String &filename, uint32_t mask)
81  {
82  return false;
83  }
84  virtual bool
85  createDirectory(File *parent, const String &filename, uint32_t mask)
86  {
87  return false;
88  }
89  virtual bool
90  createSymlink(File *parent, const String &filename, const String &value)
91  {
92  return false;
93  }
94  virtual bool remove(File *parent, File *file)
95  {
96  return false;
97  }
98 
99  private:
100  RawFs(const RawFs &);
101  RawFs &operator=(const RawFs &);
102 
103  class RawFsDir *m_pRoot;
104 };
105 
106 #endif
virtual bool createFile(File *parent, const String &filename, uint32_t mask)
Definition: RawFs.h:80
virtual bool createDirectory(File *parent, const String &filename, uint32_t mask)
Definition: RawFs.h:85
virtual bool createSymlink(File *parent, const String &filename, const String &value)
Definition: RawFs.h:90
virtual String getVolumeLabel() const
Definition: RawFs.h:50
Definition: String.h:49
Definition: Disk.h:32
virtual File * getRoot() const
Definition: RawFs.cc:48
virtual bool initialise(Disk *pDisk)
Definition: RawFs.h:41
Definition: RawFs.h:32
Definition: File.h:66