BadScript 2
Loading...
Searching...
No Matches
BadIOApiExtensions.cs
Go to the documentation of this file.
1using BadScript2.IO;
2
4
8public static class BadIOApiExtensions
9{
16 public static BadRuntime UseFileSystemApi(this BadRuntime runtime, IFileSystem? fileSystem = null)
17 {
18 if (fileSystem != null)
19 {
20 return runtime.UseApi(new BadIOApi(fileSystem), true);
21 }
22
23 return runtime.UseApi(new BadIOApi(BadFileSystem.Instance), true);
24 }
25}
Exposes the BadScript Runtime Functionality to Consumers.
Definition BadRuntime.cs:28
BadRuntime UseApi(BadInteropApi api, bool replace=false)
Adds or Replaces a specified API.
Public interface for the filesystem abstraction of the BadScript Engine.
static IFileSystem Instance
File System implementation.
static BadRuntime UseFileSystemApi(this BadRuntime runtime, IFileSystem? fileSystem=null)
Configures the Runtime to use the IO API.
Implements the "IO" Api.
Definition BadIOApi.cs:15
Defines the interface for a file system.
Definition IFileSystem.cs:7
Contains IO Implementation for the BadScript2 Runtime.
Contains IO Extensions and APIs for the BadScript2 Runtime.