Add FIGlet text support

Closes #97
This commit is contained in:
Patrik Svensson
2020-11-20 00:15:13 +01:00
committed by Patrik Svensson
parent bde61cc6ff
commit a59e0dcb21
24 changed files with 3718 additions and 15 deletions

View File

@ -0,0 +1,32 @@
using System;
using System.IO;
namespace Spectre.Console.Internal
{
internal static class ResourceReader
{
public static string ReadManifestData(string resourceName)
{
if (resourceName is null)
{
throw new ArgumentNullException(nameof(resourceName));
}
var assembly = typeof(ResourceReader).Assembly;
resourceName = resourceName.ReplaceExact("/", ".");
using (var stream = assembly.GetManifestResourceStream(resourceName))
{
if (stream == null)
{
throw new InvalidOperationException("Could not load manifest resource stream.");
}
using (var reader = new StreamReader(stream))
{
return reader.ReadToEnd().NormalizeLineEndings();
}
}
}
}
}