Neuron®
The Neuron® is the basis for the creation of open and secure federated networks for smart societies.
Loading...
Searching...
No Matches
ToonEncoder.cs
1using System;
4using System.Text;
6
8{
12 public abstract class ToonEncoder : IToonEncoder
13 {
19 public abstract Grade Supports(Type ObjectType);
20
27 public abstract void Encode(object Object, int? Indent, ToonOutput Toon);
28
32 public abstract bool EncodesMultipleRows { get; }
33
37 public abstract bool EncodesAsVector(object Value);
38
42 public abstract bool EncodesAsObject(object Value);
43
52 public virtual bool CanFold(object Object, out string FoldedName, out object FoldedValue)
53 {
54 FoldedName = null;
55 FoldedValue = null;
56 return false;
57 }
58
66 public abstract void Encode(object Object, int? Indent, ToonOutput Toon, BracketsMode Brackets);
67
73 public virtual IEnumerator GetElements(object Object) => null;
74
80 public virtual IEnumerator<KeyValuePair<string, object>> GetParameters(object Object) => null;
81 }
82}
Abstract base class for TOON encoders.
Definition: ToonEncoder.cs:13
abstract bool EncodesAsVector(object Value)
If the encoder encodes a value as a vector.
abstract Grade Supports(Type ObjectType)
How well the TOON encoder encodes objects of type ObjectType .
virtual bool CanFold(object Object, out string FoldedName, out object FoldedValue)
Checks if an object can be folded to a shorter representation, and if so, returns the folded name and...
Definition: ToonEncoder.cs:52
abstract void Encode(object Object, int? Indent, ToonOutput Toon)
Encodes the Object to TOON.
abstract bool EncodesMultipleRows
If the encoder encodes values into multiple rows.
Definition: ToonEncoder.cs:32
virtual IEnumerator< KeyValuePair< string, object > > GetParameters(object Object)
Gets available parameters to encode from an object.
abstract bool EncodesAsObject(object Value)
If the encoder encodes a value as an object.
abstract void Encode(object Object, int? Indent, ToonOutput Toon, BracketsMode Brackets)
Encodes the Object to TOON.
virtual IEnumerator GetElements(object Object)
Gets an enumerator for the child-elements of an object.
TOON Output builder
Definition: ToonOutput.cs:13
Interface for encoding objects of certain types to TOON.
Definition: IToonEncoder.cs:33
BracketsMode
How brackets should be handled when encoding vectors.
Definition: IToonEncoder.cs:12
Grade
Grade enumeration
Definition: Grade.cs:7