Neuron®
The Neuron® is the basis for the creation of open and secure federated networks for smart societies.
Loading...
Searching...
No Matches
Asn1StringValue.cs
1using System;
2using System.Collections.Generic;
3using System.Text;
4using System.Threading.Tasks;
5
7{
12 {
13 private readonly string value;
14
19 public Asn1StringValue(string Value)
20 {
21 this.value = Value;
22 }
23
27 public string Value => this.value;
28
36 public override Task ExportCSharp(StringBuilder Output, CSharpExportState State,
37 int Indent, CSharpExportPass Pass)
38 {
39 if (Pass == CSharpExportPass.Explicit)
40 {
41 Output.Append('"');
42 Output.Append(this.value.Replace("\\", "\\\\").Replace("\r", "\\r").
43 Replace("\n", "\\n").Replace("\t", "\\t").Replace("\a", "\\a").
44 Replace("\b", "\\b").Replace("\f", "\\f").Replace("\"", "\\\"").
45 Replace("'", "\\'"));
46 Output.Append('"');
47 }
48
49 return Task.CompletedTask;
50 }
51
55 public override string CSharpType => "String";
56 }
57}
Abstract base class for values.
Definition: Asn1Value.cs:11
override Task ExportCSharp(StringBuilder Output, CSharpExportState State, int Indent, CSharpExportPass Pass)
Exports to C#
override string CSharpType
Corresponding C# type.
CSharpExportPass
Defines different C# export passes.
Definition: Asn1Node.cs:12