2using System.Collections.Generic;
4using System.Threading.Tasks;
55 else if (Object is
bool &&
75 public async Task<KeyValuePair<byte[], string>>
EncodeAsync(
object Object, Encoding Encoding, params
string[] AcceptedContentTypes)
80 Encoding = Encoding.UTF8;
84 if (Result.BooleanResult.HasValue)
90 await
Renderer.RenderObject(Result.ToMatrix(),
true,
new Script.Variables());
99 await
Renderer.RenderObject(M,
true,
new Script.Variables());
103 else if (Object is
bool b)
106 throw new ArgumentException(
"Unable to encode object.", nameof(Object));
108 byte[] Bin = Encoding.GetBytes(Html);
111 return new KeyValuePair<byte[], string>(Bin, ContentType);
134 FileExtension =
null;
Helps with parsing of commong data types.
static string Encode(bool x)
Encodes a Boolean for use in XML and other formats.
static readonly string[] HtmlContentTypes
HTML content types.
Static class managing encoding and decoding of internet content.
static bool IsAccepted(string ContentType, params string[] AcceptedContentTypes)
Checks if a given content type is acceptable.
Renders HTML from a Markdown document.
Contains settings that the HTML export uses to customize HTML output.
Abstract base class for Markdown renderers.
override string ToString()
Returns the renderer output.
Contains the results of a SPARQL query. https://www.w3.org/TR/2023/WD-sparql12-results-xml-20230516/ ...
Encoder and Decoder of semantic information from SPARQL queries using HTML.
bool TryGetFileExtension(string ContentType, out string FileExtension)
Tries to get the file extension of content of a given content type.
bool Encodes(object Object, out Grade Grade, params string[] AcceptedContentTypes)
If the encoder encodes a specific object.
string[] FileExtensions
Supported file extensions.
async Task< KeyValuePair< byte[], string > > EncodeAsync(object Object, Encoding Encoding, params string[] AcceptedContentTypes)
Encodes an object
string[] ContentTypes
Supported Internet Content Types.
bool TryGetContentType(string FileExtension, out string ContentType)
Tries to get the content type of content of a given file extension.
SparqlResultSetHtmlCodec()
Encoder and Decoder of semantic information from SPARQL queries using HTML.
bool HasColumnNames
If the matrix has column names defined.
Basic interface for Internet Content encoders. A class implementing this interface and having a defau...