Interface IContentFileManager
Provides access to the file system for reading, writing, creating and deleting content files and directories.
Namespace: Gorgon.Editor.Content
Assembly: Gorgon.Editor.API.dll
Syntax
public interface IContentFileManager
Properties
| Edit this page View SourceCurrentDirectory
Property to return the current directory.
Declaration
string CurrentDirectory { get; }
Property Value
Type | Description |
---|---|
string |
Methods
| Edit this page View SourceCreateDirectory(string)
Function to create a new directory
Declaration
bool CreateDirectory(string directory)
Parameters
Type | Name | Description |
---|---|---|
string | directory | The path to the new directory. |
Returns
Type | Description |
---|---|
bool | true if the directory was created, false if it already existed. |
DeleteDirectory(string)
Function to delete a directory.
Declaration
bool DeleteDirectory(string path)
Parameters
Type | Name | Description |
---|---|---|
string | path | The path to the directory. |
Returns
Type | Description |
---|---|
bool | true if the directory was deleted, false if it wasn't found. |
DeleteFile(string)
Function to delete a file.
Declaration
void DeleteFile(string path)
Parameters
Type | Name | Description |
---|---|---|
string | path | The path to the file to delete. |
DirectoryExists(string)
Function to determine if a directory exists or not.
Declaration
bool DirectoryExists(string path)
Parameters
Type | Name | Description |
---|---|---|
string | path | The path to the directory. |
Returns
Type | Description |
---|---|
bool | true if the directory exists, false if not. |
EnumerateContentFiles(string, string, bool)
Function to retrieve the content files for a given directory path.
Declaration
IEnumerable<IContentFile> EnumerateContentFiles(string directoryPath, string searchMask, bool recursive = false)
Parameters
Type | Name | Description |
---|---|---|
string | directoryPath | The directory path to search under. |
string | searchMask | The search mask to use. |
bool | recursive | [Optional] true to retrieve all files under the path, including those in sub directories, or false to retrieve files in the immediate path. |
Returns
Type | Description |
---|---|
IEnumerable<IContentFile> | An |
Remarks
This will search on the specified directoryPath
for all content files that match the searchMask
.
The searchMask
parameter can be a full file name, or can contain a wildcard character (*) to filter the search. If the searchMask
is set to *, then
all content files under the directory will be returned.
EnumerateDirectories(string, string, bool)
Function to retrieve the content sub directories for a given directory path.
Declaration
IEnumerable<string> EnumerateDirectories(string directoryPath, string searchMask, bool recursive = false)
Parameters
Type | Name | Description |
---|---|---|
string | directoryPath | The directory path to search under. |
string | searchMask | The search mask to use. |
bool | recursive | [Optional] true to retrieve all files under the path, including those in sub directories, or false to retrieve files in the immediate path. |
Returns
Type | Description |
---|---|
IEnumerable<string> | An |
Remarks
This will search on the specified directoryPath
for directories that match the searchMask
.
The searchMask
parameter can be a full directory name, or can contain a wildcard character (*) to filter the search. If the searchMask
is set to *, then
all sub directories under the directory will be returned.
EnumeratePaths(string, string, bool)
Function to retrieve the paths under a given directory.
Declaration
IEnumerable<string> EnumeratePaths(string directoryPath, string searchMask, bool recursive = false)
Parameters
Type | Name | Description |
---|---|---|
string | directoryPath | The directory path to search under. |
string | searchMask | The search mask to use. |
bool | recursive | [Optional] true to retrieve all paths under the directory, including those in sub directories, or false to retrieve paths in the immediate directory path. |
Returns
Type | Description |
---|---|
IEnumerable<string> | An |
Remarks
This will search on the specified directoryPath
for all paths (i.e. both directories and files) that match the searchMask
.
The searchMask
parameter can be a full path part, or can contain a wildcard character (*) to filter the search. If the searchMask
is set to *, then
all paths under the directory will be returned.
FileExists(string)
Function to determine if a file exists or not.
Declaration
bool FileExists(string path)
Parameters
Type | Name | Description |
---|---|---|
string | path | The path to the file. |
Returns
Type | Description |
---|---|
bool | true if the file exists, false if not. |
FlushMetadata()
Function to notify the application that the metadata for the file system should be flushed back to the disk.
Declaration
void FlushMetadata()
GetContentLoader(GorgonTextureCache<GorgonTexture2D>)
Function to create a content loader for loading in content information.
Declaration
IGorgonContentLoader GetContentLoader(GorgonTextureCache<GorgonTexture2D> textureCache)
Parameters
Type | Name | Description |
---|---|---|
GorgonTextureCache<GorgonTexture2D> | textureCache | The cache used to hold texture data. |
Returns
Type | Description |
---|---|
IGorgonContentLoader | A new content loader interface. |
GetFile(string)
Function to retrieve a file based on the path specified.
Declaration
IContentFile GetFile(string path)
Parameters
Type | Name | Description |
---|---|---|
string | path | The path to the file. |
Returns
Type | Description |
---|---|
IContentFile | A IContentFile if found, null if not. |
GetSelectedFiles()
Function to retrieve a list of the file paths that are selected on the file system.
Declaration
IReadOnlyList<string> GetSelectedFiles()
Returns
Type | Description |
---|---|
IReadOnlyList<string> | The list of selected file paths. |
IsDirectoryExcluded(string)
Function to determine if a directory is excluded from a packed file.
Declaration
bool IsDirectoryExcluded(string directory)
Parameters
Type | Name | Description |
---|---|---|
string | directory | Path to the directory to evaluate. |
Returns
Type | Description |
---|---|
bool | true if excluded, false if not. |
OpenStream(string, FileMode)
Function to open a file stream for the specified virtual file.
Declaration
Stream OpenStream(string path, FileMode mode)
Parameters
Type | Name | Description |
---|---|---|
string | path | The path to the virtual file to open. |
FileMode | mode | The operating mode for the file stream. |
Returns
Type | Description |
---|---|
Stream | A file stream for the virtual file. |
ToGorgonFileSystem()
Function to convert the content file manager to a standard read-only Gorgon virtual file system.
Declaration
IGorgonFileSystem ToGorgonFileSystem()
Returns
Type | Description |
---|---|
IGorgonFileSystem | The IGorgonFileSystem for this content manager. |
Events
| Edit this page View SourceSelectedFilesChanged
Event triggered when the selected files change.
Declaration
event EventHandler SelectedFilesChanged
Event Type
Type | Description |
---|---|
EventHandler |