Table of Contents

Class DatabaseFileProvider

Namespace
Stride.Core.IO
Assembly
Stride.Core.Serialization.dll
public sealed class DatabaseFileProvider : VirtualFileProviderBase, IVirtualFileProvider, IDisposable
Inheritance
DatabaseFileProvider
Implements
Inherited Members
Extension Methods

Constructors

DatabaseFileProvider(IContentIndexMap, ObjectDatabase, string)

public DatabaseFileProvider(IContentIndexMap contentIndexMap, ObjectDatabase objectDatabase, string mountPoint = null)

Parameters

contentIndexMap IContentIndexMap
objectDatabase ObjectDatabase
mountPoint string

DatabaseFileProvider(ObjectDatabase, string)

public DatabaseFileProvider(ObjectDatabase objectDatabase, string mountPoint = null)

Parameters

objectDatabase ObjectDatabase
mountPoint string

Fields

ObjectIdUrl

URL prefix for ObjectId references.

public static readonly string ObjectIdUrl

Field Value

string

Properties

ContentIndexMap

public IContentIndexMap ContentIndexMap { get; }

Property Value

IContentIndexMap

ObjectDatabase

public ObjectDatabase ObjectDatabase { get; }

Property Value

ObjectDatabase

Methods

CreateRegexForFileSearch(string, string, VirtualSearchOption)

public static Regex CreateRegexForFileSearch(string url, string searchPattern, VirtualSearchOption searchOption)

Parameters

url string
searchPattern string
searchOption VirtualSearchOption

Returns

Regex

FileExists(string)

Determines whether the specified path points to an existing file.

public override bool FileExists(string url)

Parameters

url string

The path.

Returns

bool

FileSize(string)

Returns the size of the specified file in bytes

public override long FileSize(string url)

Parameters

url string

The file or directory for which to obtain size

Returns

long

A long value representing the file size in bytes

GetAbsolutePath(string)

Gets the absolute path for the specified local path from this provider.

public override string GetAbsolutePath(string url)

Parameters

url string

Returns

string

An absolute path.

ListFiles(string, string, VirtualSearchOption)

Returns the list of files from the specified path.

public override string[] ListFiles(string url, string searchPattern, VirtualSearchOption searchOption)

Parameters

url string

The url (without preceding slash).

searchPattern string

The search string to match against the names of files in path. This parameter can contain a combination of valid literal path and wildcard (* and ?) characters, but it doesn't support regular expressions.

searchOption VirtualSearchOption

One of the enumeration values that specifies whether the search operation should include all subdirectories or only the current directory.

Returns

string[]

A list of files from the specified path

Remarks

Example: to get all files within a directory ListFiles("path/to/folder", "*", VirtualSearchOption.TopDirectoryOnly)

OpenStream(string, VirtualFileMode, VirtualFileAccess, VirtualFileShare, StreamFlags)

Opens a Stream from the specified path.

public override Stream OpenStream(string url, VirtualFileMode mode, VirtualFileAccess access, VirtualFileShare share = VirtualFileShare.Read, StreamFlags streamFlags = StreamFlags.None)

Parameters

url string
mode VirtualFileMode

The mode.

access VirtualFileAccess

The access.

share VirtualFileShare

The process sharing mode.

streamFlags StreamFlags

The type of stream needed

Returns

Stream

The opened stream.

ResolveObjectId(string, out ObjectId)

Resolves the given VFS URL into a ObjectId and its DatabaseFileProvider.

public static DatabaseFileProvider ResolveObjectId(string url, out ObjectId objectId)

Parameters

url string

The URL to resolve.

objectId ObjectId

The object id.

Returns

DatabaseFileProvider

The DatabaseFileProvider containing this object if it could be found; [null] otherwise.