Class PlatformEnvironment
Supports all classes in the .NET class hierarchy and provides low-level services to derived classes. This is the ultimate base class of all .NET classes; it is the root of the type hierarchy.
public sealed class PlatformEnvironment : IPlatformEnvironment
- Inheritance
-
PlatformEnvironment
- Implements
- Inherited Members
Constructors
PlatformEnvironment(IFileSystem)
Creates a platform environment, deriving Root from RootEnvironmentVariable when set, otherwise from the process base directory.
public PlatformEnvironment(IFileSystem fileSystem)
Parameters
fileSystemIFileSystemThe file system abstraction used to resolve and create paths.
Fields
RootEnvironmentVariable
Name of the environment variable that overrides the derived root. Set on the entry process; inherited by spawned children.
public const string RootEnvironmentVariable = "RDCORE_PLATFORM_ROOT"
Field Value
SymbolsDirectory
Name of the folder of the platform root that holds the descriptions of the libraries a project can reference (DirectoryLibrarySource).
public const string SymbolsDirectory = "Symbols"
Field Value
UserDataEnvironmentVariable
Name of the environment variable that overrides the folder of the platform's user (UserDataDirectory): what a test sets, so that it never reads nor writes the settings of whoever runs it. Inherited by spawned children.
public const string UserDataEnvironmentVariable = "RDCORE_USER_DATA"
Field Value
Properties
Default
A DI-free instance for bootstrap contexts (e.g. logging configuration).
public static IPlatformEnvironment Default { get; }
Property Value
LogsDirectory
Absolute path of the platform logs directory, <Root>/Logs, created if missing.
public string LogsDirectory { get; }
Property Value
ManifestPath
Absolute path of the platform manifest, <Root>/rdcore.json.
public string ManifestPath { get; }
Property Value
Root
The platform root directory.
public string Root { get; }
Property Value
UserDataDirectory
Absolute path of the folder of the platform's user: %USERAPPDATA%/RDCore, where what the user sets for themselves is kept - their settings
(UserSettingsStore). Not created: nothing is kept there until something is.
public string UserDataDirectory { get; }
Property Value
Remarks
It is not under Root: a platform that is deployed again replaces what is there, and what the user set is theirs to keep.
Methods
Resolve(string)
Resolves a root-relative path (either slash style) to an absolute path under Root.
public string Resolve(string rootRelativePath)