Neuron®
The Neuron® is the basis for the creation of open and secure federated networks for smart societies.
Loading...
Searching...
No Matches
Waher.Content.Markdown.PlantUml.PlantUmlCodec Class Reference

PlantUML encoder/decoder. More...

Inheritance diagram for Waher.Content.Markdown.PlantUml.PlantUmlCodec:
Waher.Content.IContentDecoder Waher.Content.IContentEncoder Waher.Content.IInternetContent Waher.Content.IInternetContent

Public Member Functions

 PlantUmlCodec ()
 PlantUML encoder/decoder. More...
 
bool Decodes (string ContentType, out Grade Grade)
 If the decoder decodes an object with a given content type. More...
 
Task< object > DecodeAsync (string ContentType, byte[] Data, Encoding Encoding, KeyValuePair< string, string >[] Fields, Uri BaseUri)
 Decodes an object. More...
 
bool TryGetContentType (string FileExtension, out string ContentType)
 Tries to get the content type of an item, given its file extension. More...
 
bool TryGetFileExtension (string ContentType, out string FileExtension)
 Tries to get the file extension of an item, given its Content-Type. More...
 
bool Encodes (object Object, out Grade Grade, params string[] AcceptedContentTypes)
 If the encoder encodes a given object. More...
 
Task< KeyValuePair< byte[], string > > EncodeAsync (object Object, Encoding Encoding, params string[] AcceptedContentTypes)
 Encodes an object. More...
 

Static Public Attributes

const string DefaultContentType = "text/vnd.plantuml"
 text/vnd.graphviz More...
 
static readonly string[] PlantUmlContentTypes
 PlantUml content types. More...
 
static readonly string[] PlantUmlFileExtensions
 Plain text file extensions. More...
 

Properties

string[] ContentTypes [get]
 Supported content types. More...
 
string[] FileExtensions [get]
 Supported file extensions. More...
 

Detailed Description

PlantUML encoder/decoder.

Definition at line 12 of file PlantUmlCodec.cs.

Constructor & Destructor Documentation

◆ PlantUmlCodec()

Waher.Content.Markdown.PlantUml.PlantUmlCodec.PlantUmlCodec ( )

PlantUML encoder/decoder.

Definition at line 17 of file PlantUmlCodec.cs.

Member Function Documentation

◆ DecodeAsync()

Task< object > Waher.Content.Markdown.PlantUml.PlantUmlCodec.DecodeAsync ( string  ContentType,
byte[]  Data,
Encoding  Encoding,
KeyValuePair< string, string >[]  Fields,
Uri  BaseUri 
)

Decodes an object.

Parameters
ContentTypeInternet Content Type.
DataEncoded object.
EncodingAny encoding specified. Can be null if no encoding specified.
FieldsAny content-type related fields and their corresponding values.
BaseUriBase URI, if any. If not available, value is null.
Returns
Decoded object.
Exceptions
ArgumentExceptionIf the object cannot be decoded.

Implements Waher.Content.IContentDecoder.

Definition at line 82 of file PlantUmlCodec.cs.

◆ Decodes()

bool Waher.Content.Markdown.PlantUml.PlantUmlCodec.Decodes ( string  ContentType,
out Grade Grade   
)

If the decoder decodes an object with a given content type.

Parameters
ContentTypeContent type to decode.
GradeHow well the decoder decodes the object.
Returns
If the decoder can decode an object with the given type.

Implements Waher.Content.IContentDecoder.

Definition at line 58 of file PlantUmlCodec.cs.

◆ EncodeAsync()

Task< KeyValuePair< byte[], string > > Waher.Content.Markdown.PlantUml.PlantUmlCodec.EncodeAsync ( object  Object,
Encoding  Encoding,
params string[]  AcceptedContentTypes 
)

Encodes an object.

Parameters
ObjectObject to encode.
EncodingDesired encoding of text. Can be null if no desired encoding is speified.
AcceptedContentTypesOptional array of accepted content types. If array is empty, all content types are accepted.
Returns
Encoded object, as well as Content Type of encoding. Includes information about any text encodings used.
Exceptions
ArgumentExceptionIf the object cannot be encoded.

Implements Waher.Content.IContentEncoder.

Definition at line 158 of file PlantUmlCodec.cs.

◆ Encodes()

bool Waher.Content.Markdown.PlantUml.PlantUmlCodec.Encodes ( object  Object,
out Grade Grade  ,
params string[]  AcceptedContentTypes 
)

If the encoder encodes a given object.

Parameters
ObjectObject to encode.
GradeHow well the encoder encodes the object.
AcceptedContentTypesOptional array of accepted content types. If array is empty, all content types are accepted.
Returns
If the encoder can encode the given object.

Implements Waher.Content.IContentEncoder.

Definition at line 135 of file PlantUmlCodec.cs.

◆ TryGetContentType()

bool Waher.Content.Markdown.PlantUml.PlantUmlCodec.TryGetContentType ( string  FileExtension,
out string  ContentType 
)

Tries to get the content type of an item, given its file extension.

Parameters
FileExtensionFile extension.
ContentTypeContent type.
Returns
If the extension was recognized.

Implements Waher.Content.IInternetContent.

Definition at line 94 of file PlantUmlCodec.cs.

◆ TryGetFileExtension()

bool Waher.Content.Markdown.PlantUml.PlantUmlCodec.TryGetFileExtension ( string  ContentType,
out string  FileExtension 
)

Tries to get the file extension of an item, given its Content-Type.

Parameters
ContentTypeContent type.
FileExtensionFile extension.
Returns
If the Content-Type was recognized.

Implements Waher.Content.IInternetContent.

Definition at line 114 of file PlantUmlCodec.cs.

Member Data Documentation

◆ DefaultContentType

const string Waher.Content.Markdown.PlantUml.PlantUmlCodec.DefaultContentType = "text/vnd.plantuml"
static

text/vnd.graphviz

Definition at line 24 of file PlantUmlCodec.cs.

◆ PlantUmlContentTypes

readonly string [] Waher.Content.Markdown.PlantUml.PlantUmlCodec.PlantUmlContentTypes
static
Initial value:
= new string[]
{
}
const string DefaultContentType
text/vnd.graphviz

PlantUml content types.

Definition at line 29 of file PlantUmlCodec.cs.

◆ PlantUmlFileExtensions

readonly string [] Waher.Content.Markdown.PlantUml.PlantUmlCodec.PlantUmlFileExtensions
static
Initial value:
= new string[]
{
"uml"
}

Plain text file extensions.

Definition at line 37 of file PlantUmlCodec.cs.

Property Documentation

◆ ContentTypes

string [] Waher.Content.Markdown.PlantUml.PlantUmlCodec.ContentTypes
get

Supported content types.

Implements Waher.Content.IInternetContent.

Definition at line 45 of file PlantUmlCodec.cs.

◆ FileExtensions

string [] Waher.Content.Markdown.PlantUml.PlantUmlCodec.FileExtensions
get

Supported file extensions.

Implements Waher.Content.IInternetContent.

Definition at line 50 of file PlantUmlCodec.cs.


The documentation for this class was generated from the following file: