Class IOExtensions
Extension methods for IO functionality.
Inherited Members
Namespace: Gorgon.IO
Assembly: Gorgon.Editor.API.dll
Syntax
public static class IOExtensions
Methods
| Edit this page View SourceGetContentItems(IGorgonFileSystem, string, string, string, bool)
Function to locate specific types of editor content files contained within the file system.
Declaration
public static IReadOnlyList<IGorgonVirtualFile> GetContentItems(this IGorgonFileSystem fileSystem, string path, string contentType, string searchMask = "*", bool recursive = false)
Parameters
Type | Name | Description |
---|---|---|
IGorgonFileSystem | fileSystem | The file system containing the content items. |
string | path | Path to the directory containing the files to evaluate. |
string | contentType | The type of content to locate. |
string | searchMask | [Optional] A mask for filtering the search by file name. |
bool | recursive | [Optional] true to recursively search, false to only search the specified path. |
Returns
Type | Description |
---|---|
IReadOnlyList<IGorgonVirtualFile> | A list of IGorgonVirtualFile items for each content item. |
Remarks
Applications can use this to locate specific types of content files within a file system. If null is passed to the contentType
, then all content files with
no content type associated will be returned.
ToFileSystemPath(FileSystemInfo, DirectoryInfo, char)
Function to convert a file system information object into a relative file system path.
Declaration
public static string ToFileSystemPath(this FileSystemInfo filesystemObject, DirectoryInfo rootDirectory, char pathSeparator = '/')
Parameters
Type | Name | Description |
---|---|---|
FileSystemInfo | filesystemObject | The file system object containing the path to convert. |
DirectoryInfo | rootDirectory | The physical file system directory that is the root of the relative file system. |
char | pathSeparator | [Optional] The desired path separator. |
Returns
Type | Description |
---|---|
string | The path to the file system object, relative to the root of the file system. Or, an empty string if the file system object is not on the path of the |