diff options
author | Jesse Plamondon-Willard <Pathoschild@users.noreply.github.com> | 2021-08-25 20:01:59 -0400 |
---|---|---|
committer | Jesse Plamondon-Willard <Pathoschild@users.noreply.github.com> | 2021-08-25 20:01:59 -0400 |
commit | 0b29eb3bc37553aa2e9776e17727ba07018606ea (patch) | |
tree | bb16cc4f680d04fda9db53ea22b818c2858e616f /src/SMAPI/Framework/ModLoading/Symbols/SymbolWriterProvider.cs | |
parent | e3b38a70f8d710af07732b325a6013ed18aa0fb0 (diff) | |
download | SMAPI-0b29eb3bc37553aa2e9776e17727ba07018606ea.tar.gz SMAPI-0b29eb3bc37553aa2e9776e17727ba07018606ea.tar.bz2 SMAPI-0b29eb3bc37553aa2e9776e17727ba07018606ea.zip |
minor refactoring in new symbol code
Diffstat (limited to 'src/SMAPI/Framework/ModLoading/Symbols/SymbolWriterProvider.cs')
-rw-r--r-- | src/SMAPI/Framework/ModLoading/Symbols/SymbolWriterProvider.cs | 28 |
1 files changed, 23 insertions, 5 deletions
diff --git a/src/SMAPI/Framework/ModLoading/Symbols/SymbolWriterProvider.cs b/src/SMAPI/Framework/ModLoading/Symbols/SymbolWriterProvider.cs index 33e91db0..8f7e05d1 100644 --- a/src/SMAPI/Framework/ModLoading/Symbols/SymbolWriterProvider.cs +++ b/src/SMAPI/Framework/ModLoading/Symbols/SymbolWriterProvider.cs @@ -4,19 +4,37 @@ using Mono.Cecil.Cil; namespace StardewModdingAPI.Framework.ModLoading.Symbols { + /// <summary>Provides assembly symbol writers for Mono.Cecil.</summary> internal class SymbolWriterProvider : ISymbolWriterProvider { - private readonly ISymbolWriterProvider BaseProvider = new DefaultSymbolWriterProvider(); + /********* + ** Fields + *********/ + /// <summary>The default symbol writer provider.</summary> + private readonly ISymbolWriterProvider DefaultProvider = new DefaultSymbolWriterProvider(); - public ISymbolWriter GetSymbolWriter( ModuleDefinition module, string fileName ) + /// <summary>The symbol writer provider for the portable PDB format.</summary> + private readonly ISymbolWriterProvider PortablePdbProvider = new PortablePdbWriterProvider(); + + + /********* + ** Public methods + *********/ + /// <summary>Get a symbol writer for a given module and assembly path.</summary> + /// <param name="module">The loaded assembly module.</param> + /// <param name="fileName">The assembly name.</param> + public ISymbolWriter GetSymbolWriter(ModuleDefinition module, string fileName) { - return this.BaseProvider.GetSymbolWriter( module, fileName ); + return this.DefaultProvider.GetSymbolWriter(module, fileName); } - public ISymbolWriter GetSymbolWriter( ModuleDefinition module, Stream symbolStream ) + /// <summary>Get a symbol writer for a given module and symbol stream.</summary> + /// <param name="module">The loaded assembly module.</param> + /// <param name="symbolStream">The loaded symbol file stream.</param> + public ISymbolWriter GetSymbolWriter(ModuleDefinition module, Stream symbolStream) { // Not implemented in default native pdb writer, so fallback to portable - return new PortablePdbWriterProvider().GetSymbolWriter( module, symbolStream ); + return this.PortablePdbProvider.GetSymbolWriter(module, symbolStream); } } } |