C# Class VirtualFileSystem.INode

ファイルを表示 Open project: SummerWish/vfs Class Usage Examples

Public Properties

Property Type Description
data _INode
index System.UInt32

Public Methods

Method Description
Create ( VFSCore vfs, UInt32 index, UInt32 flags, UInt32 owner ) : INode

创建一个新的 inode

GetBlockAtPosition ( UInt32 position, System.Boolean allocate = false ) : Block

查找指定偏移所在的块,若块不存在则返回无效块

GetBlocksToPreserve ( UInt32 nBlock ) : UInt32

返回当该 inode 总计要预留若干数据块时,还需要申请预留多少数据块

GetPosition ( ) : UInt32
GetPosition ( VFSCore vfs, UInt32 index ) : UInt32
INode ( VFSCore vfs, _INode data, UInt32 index = UInt32.MaxValue ) : System
IsDirectory ( ) : System.Boolean

该 inode 是否是一个目录

Load ( VFSCore vfs, UInt32 index ) : INode

从存储介质中获取 inode

PrepareBlockAtPosition ( UInt32 position ) : Block

查找指定偏移所在的块,若块不存在则创建

Read ( ) : byte[]

读取所有数据

Read ( UInt32 position, byte arr, UInt32 count ) : void

读取数据

Resize ( UInt32 newSize ) : void

修改并释放数据占用空间,删除第 newSize 字节开始直到原文件大小的数据块

Save ( ) : void

将 inode 数据写入存储介质

Size ( ) : UInt32

返回 inode 数据区大小

Write ( UInt32 position, byte arr ) : void

写入数据

Write ( byte arr ) : void

写入数据作为 inode 数据,释放未使用的数据块

Method Details

Create() public static method

创建一个新的 inode
public static Create ( VFSCore vfs, UInt32 index, UInt32 flags, UInt32 owner ) : INode
vfs VFSCore
index System.UInt32
flags System.UInt32
owner System.UInt32
return INode

GetBlockAtPosition() public method

查找指定偏移所在的块,若块不存在则返回无效块
public GetBlockAtPosition ( UInt32 position, System.Boolean allocate = false ) : Block
position System.UInt32
allocate System.Boolean
return Block

GetBlocksToPreserve() public method

返回当该 inode 总计要预留若干数据块时,还需要申请预留多少数据块
public GetBlocksToPreserve ( UInt32 nBlock ) : UInt32
nBlock System.UInt32
return System.UInt32

GetPosition() public method

public GetPosition ( ) : UInt32
return System.UInt32

GetPosition() public static method

public static GetPosition ( VFSCore vfs, UInt32 index ) : UInt32
vfs VFSCore
index System.UInt32
return System.UInt32

INode() public method

public INode ( VFSCore vfs, _INode data, UInt32 index = UInt32.MaxValue ) : System
vfs VFSCore
data _INode
index System.UInt32
return System

IsDirectory() public method

该 inode 是否是一个目录
public IsDirectory ( ) : System.Boolean
return System.Boolean

Load() public static method

从存储介质中获取 inode
public static Load ( VFSCore vfs, UInt32 index ) : INode
vfs VFSCore
index System.UInt32
return INode

PrepareBlockAtPosition() public method

查找指定偏移所在的块,若块不存在则创建
public PrepareBlockAtPosition ( UInt32 position ) : Block
position System.UInt32
return Block

Read() public method

读取所有数据
public Read ( ) : byte[]
return byte[]

Read() public method

读取数据
public Read ( UInt32 position, byte arr, UInt32 count ) : void
position System.UInt32
arr byte
count System.UInt32
return void

Resize() public method

修改并释放数据占用空间,删除第 newSize 字节开始直到原文件大小的数据块
public Resize ( UInt32 newSize ) : void
newSize System.UInt32
return void

Save() public method

将 inode 数据写入存储介质
public Save ( ) : void
return void

Size() public method

返回 inode 数据区大小
public Size ( ) : UInt32
return System.UInt32

Write() public method

写入数据
public Write ( UInt32 position, byte arr ) : void
position System.UInt32
arr byte
return void

Write() public method

写入数据作为 inode 数据,释放未使用的数据块
public Write ( byte arr ) : void
arr byte
return void

Property Details

data public_oe property

可持久化数据
public _INode,VirtualFileSystem data
return _INode

index public_oe property

该 inode 编号
public UInt32,System index
return System.UInt32