The Pedigree Project  0.1
Iso9660File.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 ISO9660FILE_H
21 #define ISO9660FILE_H
22 
23 #include "Iso9660Filesystem.h"
24 #include "iso9660.h"
25 #include "modules/system/vfs/File.h"
26 #include "pedigree/kernel/processor/types.h"
27 #include "pedigree/kernel/time/Time.h"
28 #include "pedigree/kernel/utilities/String.h"
29 
30 class Iso9660File : public File
31 {
32  friend class Iso9660Directory;
33 
34  private:
36  Iso9660File(const Iso9660File &);
37  Iso9660File &operator=(const File &);
38  Iso9660File &operator=(const Iso9660File &);
39 
40  public:
43  String name, Time::Timestamp accessedTime, Time::Timestamp modifiedTime,
44  Time::Timestamp creationTime, uintptr_t inode,
45  class Iso9660Filesystem *pFs, size_t size, Iso9660DirRecord &record,
46  File *pParent = 0)
47  : File(
48  name, accessedTime, modifiedTime, creationTime, inode, pFs, size,
49  pParent),
50  m_pFs(pFs), m_Dir(record)
51  {
52  }
53  virtual ~Iso9660File()
54  {
55  }
56 
57  inline Iso9660DirRecord &getDirRecord()
58  {
59  return m_Dir;
60  }
61 
62  protected:
63  virtual uintptr_t readBlock(uint64_t location);
64 
65  virtual size_t getBlockSize() const
66  {
67  return 2048;
68  }
69 
70  private:
71  // Filesystem object
72  Iso9660Filesystem *m_pFs;
73 
74  // Our internal directory information (info about *this* directory, not the
75  // child)
76  Iso9660DirRecord m_Dir;
77 };
78 
79 #endif
Iso9660File(const Iso9660File &)
Definition: String.h:49
virtual size_t getBlockSize() const
Definition: Iso9660File.h:65
virtual uintptr_t readBlock(uint64_t location)
Definition: Iso9660File.cc:23
Definition: File.h:66
Iso9660File(String name, Time::Timestamp accessedTime, Time::Timestamp modifiedTime, Time::Timestamp creationTime, uintptr_t inode, class Iso9660Filesystem *pFs, size_t size, Iso9660DirRecord &record, File *pParent=0)
Definition: Iso9660File.h:42