C# Class Mosa.FileSystem.VFS.DirectoryEntry

Exibir arquivo Open project: tgiphil/MOSA-Project Class Usage Examples

Public Methods

Method Description
Allocate ( DirectoryEntry parent, string name, IVfsNode node ) : DirectoryEntry

Allocates a new DirectoryEntry object for the given settings.

This method is used to control the DirectoryEntry allocation and maintain a cache of them. Also used to prevent infinite name allocations.

AllocateRoot ( IVfsNode node ) : DirectoryEntry

Allocates a vfs root directory entry.

This method creates a directory entry, which has some special properties. The first one is, that its parent is itself. This provides for the ability to cd .. on the root to stay on the root. The next ability is to create specialized root directories to isolate processes from the remainder of the file system. Setting a root directory created using this method effectively limits the process to access inside of the newly created namespace.

DirectoryEntry ( )

Lookup ( string name ) : DirectoryEntry

Release ( ) : void

Releases the DirectoryEntry from the parent DirectoryEntry. This is *not* a delete operation.

This function is used to remove a DirectoryEntry from the cache. Some (networked) file systems may want to use this function to remove "known" directories from the lookup cache when they loose server connection.

Private Methods

Method Description
InsertChild ( DirectoryEntry child ) : void

RemoveChild ( DirectoryEntry child ) : void

Setup ( DirectoryEntry parent, string name, IVfsNode node ) : void

Method Details

Allocate() public static method

Allocates a new DirectoryEntry object for the given settings.
This method is used to control the DirectoryEntry allocation and maintain a cache of them. Also used to prevent infinite name allocations.
If any one of the parameters is null. If the name is zero-length.
public static Allocate ( DirectoryEntry parent, string name, IVfsNode node ) : DirectoryEntry
parent DirectoryEntry The parent directory entry.
name string The name of the entry to create.
node IVfsNode The vfs node referenced by the directory entry.
return DirectoryEntry

AllocateRoot() public static method

Allocates a vfs root directory entry.
This method creates a directory entry, which has some special properties. The first one is, that its parent is itself. This provides for the ability to cd .. on the root to stay on the root. The next ability is to create specialized root directories to isolate processes from the remainder of the file system. Setting a root directory created using this method effectively limits the process to access inside of the newly created namespace.
The specified node is invalid.
public static AllocateRoot ( IVfsNode node ) : DirectoryEntry
node IVfsNode The vfs node, which corresponds to the root directory.
return DirectoryEntry

DirectoryEntry() public method

public DirectoryEntry ( )

Lookup() public method

public Lookup ( string name ) : DirectoryEntry
name string
return DirectoryEntry

Release() public method

Releases the DirectoryEntry from the parent DirectoryEntry. This is *not* a delete operation.
This function is used to remove a DirectoryEntry from the cache. Some (networked) file systems may want to use this function to remove "known" directories from the lookup cache when they loose server connection.
public Release ( ) : void
return void