Gorgon
Show / Hide Table of Contents

Class IOExtensions

Extension methods for IO functionality.

Inheritance
object
IOExtensions
Inherited Members
object.ToString()
object.Equals(object)
object.Equals(object, object)
object.ReferenceEquals(object, object)
object.GetHashCode()
object.GetType()
object.MemberwiseClone()
Namespace: Gorgon.IO
Assembly: Gorgon.Editor.API.dll
Syntax
public static class IOExtensions

Methods

| Edit this page View Source

GetContentItems(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.

| Edit this page View Source

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 rootDirectory.

  • Edit this page
  • View Source
In this article
Back to top Copyright 2023 - Licensed under the MIT license by Michael Winsor (Tape_Worm).
Send comments on this topic to the author