C# Class NanoByte.Common.Storage.SlimDX.ContentManager

Provides a virtual file system for combining data from multiple directories and archives (useful for modding).
ファイルを表示 Open project: nano-byte/common

Public Methods

Method Description
DeleteModFile ( [ type, [ id ) : void

Deletes a file in ModDir. Will not touch files in archives or in BaseDir.

FileExists ( [ type, [ id, bool searchArchives = true ) : bool

Checks whether a certain content file exists.

GetFileList ( [ type, [ extension ) : NamedCollection

Gets a list of all files of a certain type

GetFileStream ( [ type, [ id ) : Stream

Gets a reading stream for a content file (searches in archives)

LoadArchives ( ) : void

Loads any ArchiveFileExt archives in BaseDir and ModDir or specified by EnvVarNameBaseArchives or EnvVarNamerModArchives.

Private Methods

Method Description
AddArchivesToList ( NamedCollection files, string type, string extension, ContentArchiveEntry>.IEnumerable archiveData, bool flagAsMod ) : void

Finds all files in archiveData ending with extension and adds them to the files collection

AddDirectoryToList ( NamedCollection files, string type, string extension, DirectoryInfo directory, string prefix, bool flagAsMod ) : void

Recursively finds all files in directory ending with extension and adds them to the files list.

AddEntry ( ContentArchiveEntry>.this dictionary, ZipEntry zipEntry, ZipFile zipFile ) : void
AddFileToList ( NamedCollection files, string type, string name, bool flagAsMod ) : void

Adds a specific file to the files list.

CloseArchives ( ) : void
CreateDirPath ( [ type ) : string
CreateFilePath ( [ type, [ id ) : string
GetFilePath ( [ type, [ id ) : string
LoadArchive ( string path, ContentArchiveEntry>.Dictionary archiveEntries ) : void

Method Details

DeleteModFile() public static method

Deletes a file in ModDir. Will not touch files in archives or in BaseDir.
is not set. The specified file could not be found. The specified file could not be deleted. You have insufficient rights to delete the file.
public static DeleteModFile ( [ type, [ id ) : void
type [ The type of file (e.g. Textures, Sounds, ...).
id [ The file name of the content.
return void

FileExists() public static method

Checks whether a certain content file exists.
public static FileExists ( [ type, [ id, bool searchArchives = true ) : bool
type [ The type of file (e.g. Textures, Sounds, ...).
id [ The file name of the content.
searchArchives bool Whether to search for the file in archives as well.
return bool

GetFileList() public static method

Gets a list of all files of a certain type
public static GetFileList ( [ type, [ extension ) : NamedCollection
type [ The type of files you want (e.g. Textures, Sounds, ...)
extension [ The file extension to so search for
return NamedCollection

GetFileStream() public static method

Gets a reading stream for a content file (searches in archives)
The specified file could not be found. There was an error reading the file. Read access to the file is not permitted.
public static GetFileStream ( [ type, [ id ) : Stream
type [ The type of file (e.g. Textures, Sounds, ...).
id [ The file name of the content.
return Stream

LoadArchives() public static method

Loads any ArchiveFileExt archives in BaseDir and ModDir or specified by EnvVarNameBaseArchives or EnvVarNamerModArchives.
public static LoadArchives ( ) : void
return void