Game Framework  2021.05.31
IFileSystem接口 参考

文件系统接口。 更多...

Public 成员函数

FileInfo GetFileInfo (string name)
 获取文件信息。 更多...
 
FileInfo[] GetAllFileInfos ()
 获取所有文件信息。 更多...
 
void GetAllFileInfos (List< FileInfo > results)
 获取所有文件信息。 更多...
 
bool HasFile (string name)
 检查是否存在指定文件。 更多...
 
byte[] ReadFile (string name)
 读取指定文件。 更多...
 
int ReadFile (string name, byte[] buffer)
 读取指定文件。 更多...
 
int ReadFile (string name, byte[] buffer, int startIndex)
 读取指定文件。 更多...
 
int ReadFile (string name, byte[] buffer, int startIndex, int length)
 读取指定文件。 更多...
 
int ReadFile (string name, Stream stream)
 读取指定文件。 更多...
 
byte[] ReadFileSegment (string name, int length)
 读取指定文件的指定片段。 更多...
 
byte[] ReadFileSegment (string name, int offset, int length)
 读取指定文件的指定片段。 更多...
 
int ReadFileSegment (string name, byte[] buffer)
 读取指定文件的指定片段。 更多...
 
int ReadFileSegment (string name, byte[] buffer, int length)
 读取指定文件的指定片段。 更多...
 
int ReadFileSegment (string name, byte[] buffer, int startIndex, int length)
 读取指定文件的指定片段。 更多...
 
int ReadFileSegment (string name, int offset, byte[] buffer)
 读取指定文件的指定片段。 更多...
 
int ReadFileSegment (string name, int offset, byte[] buffer, int length)
 读取指定文件的指定片段。 更多...
 
int ReadFileSegment (string name, int offset, byte[] buffer, int startIndex, int length)
 读取指定文件的指定片段。 更多...
 
int ReadFileSegment (string name, Stream stream, int length)
 读取指定文件的指定片段。 更多...
 
int ReadFileSegment (string name, int offset, Stream stream, int length)
 读取指定文件的指定片段。 更多...
 
bool WriteFile (string name, byte[] buffer)
 写入指定文件。 更多...
 
bool WriteFile (string name, byte[] buffer, int startIndex)
 写入指定文件。 更多...
 
bool WriteFile (string name, byte[] buffer, int startIndex, int length)
 写入指定文件。 更多...
 
bool WriteFile (string name, Stream stream)
 写入指定文件。 更多...
 
bool WriteFile (string name, string filePath)
 写入指定文件。 更多...
 
bool SaveAsFile (string name, string filePath)
 将指定文件另存为物理文件。 更多...
 
bool RenameFile (string oldName, string newName)
 重命名指定文件。 更多...
 
bool DeleteFile (string name)
 删除指定文件。 更多...
 

属性

string FullPath [get]
 获取文件系统完整路径。 更多...
 
FileSystemAccess Access [get]
 获取文件系统访问方式。 更多...
 
int FileCount [get]
 获取文件数量。 更多...
 
int MaxFileCount [get]
 获取最大文件数量。 更多...
 

详细描述

文件系统接口。

成员函数说明

◆ DeleteFile()

bool DeleteFile ( string  name)

删除指定文件。

参数
name要删除的文件名称。
返回
是否删除指定文件成功。

◆ GetAllFileInfos() [1/2]

FileInfo [] GetAllFileInfos ( )

获取所有文件信息。

返回
获取的所有文件信息。

◆ GetAllFileInfos() [2/2]

void GetAllFileInfos ( List< FileInfo results)

获取所有文件信息。

参数
results获取的所有文件信息。

◆ GetFileInfo()

FileInfo GetFileInfo ( string  name)

获取文件信息。

参数
name要获取文件信息的文件名称。
返回
获取的文件信息。

◆ HasFile()

bool HasFile ( string  name)

检查是否存在指定文件。

参数
name要检查的文件名称。
返回
是否存在指定文件。

◆ ReadFile() [1/5]

byte [] ReadFile ( string  name)

读取指定文件。

参数
name要读取的文件名称。
返回
存储读取文件内容的二进制流。

◆ ReadFile() [2/5]

int ReadFile ( string  name,
byte[]  buffer 
)

读取指定文件。

参数
name要读取的文件名称。
buffer存储读取文件内容的二进制流。
返回
实际读取了多少字节。

◆ ReadFile() [3/5]

int ReadFile ( string  name,
byte[]  buffer,
int  startIndex 
)

读取指定文件。

参数
name要读取的文件名称。
buffer存储读取文件内容的二进制流。
startIndex存储读取文件内容的二进制流的起始位置。
返回
实际读取了多少字节。

◆ ReadFile() [4/5]

int ReadFile ( string  name,
byte[]  buffer,
int  startIndex,
int  length 
)

读取指定文件。

参数
name要读取的文件名称。
buffer存储读取文件内容的二进制流。
startIndex存储读取文件内容的二进制流的起始位置。
length存储读取文件内容的二进制流的长度。
返回
实际读取了多少字节。

◆ ReadFile() [5/5]

int ReadFile ( string  name,
Stream  stream 
)

读取指定文件。

参数
name要读取的文件名称。
stream存储读取文件内容的二进制流。
返回
实际读取了多少字节。

◆ ReadFileSegment() [1/10]

int ReadFileSegment ( string  name,
byte[]  buffer 
)

读取指定文件的指定片段。

参数
name要读取片段的文件名称。
buffer存储读取文件片段内容的二进制流。
返回
实际读取了多少字节。

◆ ReadFileSegment() [2/10]

int ReadFileSegment ( string  name,
byte[]  buffer,
int  length 
)

读取指定文件的指定片段。

参数
name要读取片段的文件名称。
buffer存储读取文件片段内容的二进制流。
length要读取片段的长度。
返回
实际读取了多少字节。

◆ ReadFileSegment() [3/10]

int ReadFileSegment ( string  name,
byte[]  buffer,
int  startIndex,
int  length 
)

读取指定文件的指定片段。

参数
name要读取片段的文件名称。
buffer存储读取文件片段内容的二进制流。
startIndex存储读取文件片段内容的二进制流的起始位置。
length要读取片段的长度。
返回
实际读取了多少字节。

◆ ReadFileSegment() [4/10]

byte [] ReadFileSegment ( string  name,
int  length 
)

读取指定文件的指定片段。

参数
name要读取片段的文件名称。
length要读取片段的长度。
返回
存储读取文件片段内容的二进制流。

◆ ReadFileSegment() [5/10]

int ReadFileSegment ( string  name,
int  offset,
byte[]  buffer 
)

读取指定文件的指定片段。

参数
name要读取片段的文件名称。
offset要读取片段的偏移。
buffer存储读取文件片段内容的二进制流。
返回
实际读取了多少字节。

◆ ReadFileSegment() [6/10]

int ReadFileSegment ( string  name,
int  offset,
byte[]  buffer,
int  length 
)

读取指定文件的指定片段。

参数
name要读取片段的文件名称。
offset要读取片段的偏移。
buffer存储读取文件片段内容的二进制流。
length要读取片段的长度。
返回
实际读取了多少字节。

◆ ReadFileSegment() [7/10]

int ReadFileSegment ( string  name,
int  offset,
byte[]  buffer,
int  startIndex,
int  length 
)

读取指定文件的指定片段。

参数
name要读取片段的文件名称。
offset要读取片段的偏移。
buffer存储读取文件片段内容的二进制流。
startIndex存储读取文件片段内容的二进制流的起始位置。
length要读取片段的长度。
返回
实际读取了多少字节。

◆ ReadFileSegment() [8/10]

byte [] ReadFileSegment ( string  name,
int  offset,
int  length 
)

读取指定文件的指定片段。

参数
name要读取片段的文件名称。
offset要读取片段的偏移。
length要读取片段的长度。
返回
存储读取文件片段内容的二进制流。

◆ ReadFileSegment() [9/10]

int ReadFileSegment ( string  name,
int  offset,
Stream  stream,
int  length 
)

读取指定文件的指定片段。

参数
name要读取片段的文件名称。
offset要读取片段的偏移。
stream存储读取文件片段内容的二进制流。
length要读取片段的长度。
返回
实际读取了多少字节。

◆ ReadFileSegment() [10/10]

int ReadFileSegment ( string  name,
Stream  stream,
int  length 
)

读取指定文件的指定片段。

参数
name要读取片段的文件名称。
stream存储读取文件片段内容的二进制流。
length要读取片段的长度。
返回
实际读取了多少字节。

◆ RenameFile()

bool RenameFile ( string  oldName,
string  newName 
)

重命名指定文件。

参数
oldName要重命名的文件名称。
newName重命名后的文件名称。
返回
是否重命名指定文件成功。

◆ SaveAsFile()

bool SaveAsFile ( string  name,
string  filePath 
)

将指定文件另存为物理文件。

参数
name要另存为的文件名称。
filePath存储写入文件内容的文件路径。
返回
是否将指定文件另存为物理文件成功。

◆ WriteFile() [1/5]

bool WriteFile ( string  name,
byte[]  buffer 
)

写入指定文件。

参数
name要写入的文件名称。
buffer存储写入文件内容的二进制流。
返回
是否写入指定文件成功。

◆ WriteFile() [2/5]

bool WriteFile ( string  name,
byte[]  buffer,
int  startIndex 
)

写入指定文件。

参数
name要写入的文件名称。
buffer存储写入文件内容的二进制流。
startIndex存储写入文件内容的二进制流的起始位置。
返回
是否写入指定文件成功。

◆ WriteFile() [3/5]

bool WriteFile ( string  name,
byte[]  buffer,
int  startIndex,
int  length 
)

写入指定文件。

参数
name要写入的文件名称。
buffer存储写入文件内容的二进制流。
startIndex存储写入文件内容的二进制流的起始位置。
length存储写入文件内容的二进制流的长度。
返回
是否写入指定文件成功。

◆ WriteFile() [4/5]

bool WriteFile ( string  name,
Stream  stream 
)

写入指定文件。

参数
name要写入的文件名称。
stream存储写入文件内容的二进制流。
返回
是否写入指定文件成功。

◆ WriteFile() [5/5]

bool WriteFile ( string  name,
string  filePath 
)

写入指定文件。

参数
name要写入的文件名称。
filePath存储写入文件内容的文件路径。
返回
是否写入指定文件成功。

属性说明

◆ Access

FileSystemAccess Access
get

获取文件系统访问方式。

◆ FileCount

int FileCount
get

获取文件数量。

◆ FullPath

string FullPath
get

获取文件系统完整路径。

◆ MaxFileCount

int MaxFileCount
get

获取最大文件数量。