3using System.Threading.Tasks;
54 else if (Object is
bool &&
75 public async Task<ContentResponse>
EncodeAsync(
object Object, Encoding Encoding,
ICodecProgress Progress, params
string[] AcceptedContentTypes)
80 Encoding = Encoding.UTF8;
84 if (Result.BooleanResult.HasValue)
90 await
Renderer.RenderObject(Result.ToMatrix(
true),
true,
new Script.Variables());
99 await
Renderer.RenderObject(M,
true,
new Script.Variables());
103 else if (Object is
bool b)
106 return new ContentResponse(
new ArgumentException(
"Unable to encode object.", nameof(Object)));
108 byte[] Bin = Encoding.GetBytes(Html);
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.
Contains information about a response to a content request.
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 of semantic information from SPARQL queries using HTML.
bool TryGetContentType(string FileExtension, out string ContentType)
Tries to get the content type of content of a given file extension.
string[] FileExtensions
Supported file extensions.
bool Encodes(object Object, out Grade Grade, params string[] AcceptedContentTypes)
If the encoder encodes a specific object.
string[] ContentTypes
Supported Internet Content Types.
SparqlResultSetHtmlEncoder()
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.
async Task< ContentResponse > EncodeAsync(object Object, Encoding Encoding, ICodecProgress Progress, params string[] AcceptedContentTypes)
Encodes an object
bool HasColumnNames
If the matrix has column names defined.
Interface for reporting progress about an encoding or decoding.
Basic interface for Internet Content encoders. A class implementing this interface and having a defau...