Neuron®
The Neuron® is the basis for the creation of open and secure federated networks for smart societies.
Loading...
Searching...
No Matches
CharEncoder.cs
1using System;
2using System.Text;
4
6{
11 {
15 public CharEncoder()
16 {
17 }
18
25 public void Encode(object Object, int? Indent, StringBuilder Json)
26 {
27 Json.Append('"');
28 Json.Append(JSON.Encode(new string((char)Object, 1)));
29 Json.Append('"');
30 }
31
37 public Grade Supports(Type ObjectType)
38 {
39 return ObjectType == typeof(char) ? Grade.Excellent : Grade.NotAtAll;
40 }
41 }
42}
Helps with common JSON-related tasks.
Definition: JSON.cs:14
static string Encode(string s)
Encodes a string for inclusion in JSON.
Definition: JSON.cs:507
void Encode(object Object, int? Indent, StringBuilder Json)
Encodes the Object to JSON.
Definition: CharEncoder.cs:25
Grade Supports(Type ObjectType)
How well the JSON encoder encodes objects of type ObjectType .
Definition: CharEncoder.cs:37
Interface for encoding objects of certain types to JSON.
Definition: IJsonEncoder.cs:11
Grade
Grade enumeration
Definition: Grade.cs:7