Neuron®
The Neuron® is the basis for the creation of open and secure federated networks for smart societies.
Loading...
Searching...
No Matches
Asn1Integer.cs
1using System;
2using System.Collections.Generic;
3using System.Text;
4using System.Threading.Tasks;
6
8{
12 public class Asn1Integer : Asn1Type
13 {
17 public Asn1Integer()
18 : base()
19 {
20 }
21
28 public override Asn1Node Parse(Asn1Document Document, Asn1Macro Macro)
29 {
30 if (Document.ParseValue() is Values.Asn1IntegerValue Value)
31 return Value;
32 else
33 throw Document.SyntaxError("String value expected.");
34 }
35
43 public override Task ExportCSharp(StringBuilder Output, CSharpExportState State, int Indent, CSharpExportPass Pass)
44 {
45 if (Pass == CSharpExportPass.Explicit)
46 {
47 Output.Append("Int64");
48 if (this.Optional.HasValue && this.Optional.Value)
49 Output.Append('?');
50 }
51
52 return Task.CompletedTask;
53 }
54 }
55}
Represents an ASN.1 document.
Definition: Asn1Document.cs:21
Base class for all ASN.1 nodes.
Definition: Asn1Node.cs:38
Abstract base class for ASN.1 types.
Definition: Asn1Type.cs:13
bool? Optional
If the type is optional
Definition: Asn1Type.cs:52
override Asn1Node Parse(Asn1Document Document, Asn1Macro Macro)
Parses the portion of the document at the current position, according to the type.
Definition: Asn1Integer.cs:28
override Task ExportCSharp(StringBuilder Output, CSharpExportState State, int Indent, CSharpExportPass Pass)
Exports to C#
Definition: Asn1Integer.cs:43
CSharpExportPass
Defines different C# export passes.
Definition: Asn1Node.cs:12