Interface IStoneProvider
Provides Stone platform and controller layout data
Namespace: Snowflake.Services
Assembly: Snowflake.Framework.Primitives.dll
Syntax
public interface IStoneProvider
Properties
Controllers
Gets the list of controllers loaded for this core service
Declaration
IReadOnlyDictionary<ControllerId, IControllerLayout> Controllers { get; }
Property Value
Type | Description |
---|---|
System. |
Platforms
Gets the list of platforms loaded for this core service
Declaration
IReadOnlyDictionary<PlatformId, IPlatformInfo> Platforms { get; }
Property Value
Type | Description |
---|---|
System. |
StoneVersion
Gets the version of stone definitions loaded
Declaration
Version StoneVersion { get; }
Property Value
Type | Description |
---|---|
System. |
Methods
GetFileSignature(String, Stream)
Attempts to get a the filesignature for the given mimetype and ROM stream, preserving the position of the stream.
Declaration
IFileSignature GetFileSignature(string mimetype, Stream romStream)
Parameters
Type | Name | Description |
---|---|---|
System. |
mimetype | The mimetype of the ROM. Use Get |
System. |
romStream | A stream containing the ROM file. |
Returns
Type | Description |
---|---|
IFile |
A IFile |
GetSignatures(String)
If a filesignature is known for a mimetype, returns the filesignature object. Otherwise, returns null.
Declaration
IEnumerable<IFileSignature> GetSignatures(string mimetype)
Parameters
Type | Name | Description |
---|---|---|
System. |
mimetype | A stone mimetype |
Returns
Type | Description |
---|---|
System. |
A list of possible signatures for the mimetype. |
GetStoneMimetype(PlatformId, Stream, String)
Attempts to get a Stone mimetype from a file stream by reading the file headers provided, if the platform is known.
If a mimetype can not be found through the inbuilt file signatures, it will rely on the extension fallback, which may be a filename or the known extension of the file. If extensionFallback is null or empty, or is unable to be found in the platform, then the miemtype is unknown, and will return an empty string.
This method will preserve the stream position.
Declaration
string GetStoneMimetype(PlatformId knownPlatform, Stream romStream, string extensionFallback)
Parameters
Type | Name | Description |
---|---|---|
Platform |
knownPlatform | The platform that the provided ROM is for |
System. |
romStream | A stream containing the ROM file. |
System. |
extensionFallback | A fallback extension to look up for in case the stream analysis fails. |
Returns
Type | Description |
---|---|
System. |
A Stone mimetype if the file format is known, or the empty string otherwise. |
GetStoneMimetype(Stream)
Attempts to discover the mimetype from all known file signatures. No fallback is available for this method, so if the file does not match a known file signature, this method will return the empty string.
This method will preserve the stream position.
Declaration
string GetStoneMimetype(Stream romStream)
Parameters
Type | Name | Description |
---|---|---|
System. |
romStream | A stream containing the ROM file. |
Returns
Type | Description |
---|---|
System. |
A stone mimetype if the file format is known, or the empty string otherwise. |