The Pedigree Project  0.1
Ext2Directory.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 EXT2_DIRECTORY_H
21 #define EXT2_DIRECTORY_H
22 
23 #include "Ext2Node.h"
24 #include "modules/system/vfs/Directory.h"
25 #include "pedigree/kernel/processor/types.h"
26 #include "pedigree/kernel/utilities/String.h"
27 
28 class File;
29 struct Inode;
30 
32 class Ext2Directory : public Directory, public Ext2Node
33 {
34  private:
36  Ext2Directory(const Ext2Directory &file);
37  Ext2Directory &operator=(const Ext2Directory &);
38 
39  public:
42  const String &name, uintptr_t inode_num, Inode *inode,
43  class Ext2Filesystem *pFs, File *pParent);
45  virtual ~Ext2Directory();
46 
47  void truncate()
48  {
49  }
50 
52  virtual void cacheDirectoryContents();
53 
55  virtual bool addEntry(String filename, File *pFile, size_t type);
57  virtual bool removeEntry(const String &filename, Ext2Node *pFile);
58 
60  void fileAttributeChanged();
61 
62  private:
63  virtual File *convertToFile(const DirectoryEntryMetadata &meta);
64 };
65 
66 #endif
virtual bool addEntry(String filename, File *pFile, size_t type)
Ext2Directory(const Ext2Directory &file)
virtual ~Ext2Directory()
virtual File * convertToFile(const DirectoryEntryMetadata &meta)
Definition: String.h:49
Definition: ext2.h:152
void fileAttributeChanged()
Definition: File.h:66
virtual bool removeEntry(const String &filename, Ext2Node *pFile)
virtual void cacheDirectoryContents()