Neuron®
The Neuron® is the basis for the creation of open and secure federated networks for smart societies.
Loading...
Searching...
No Matches
StringObject.cs
1using System.Diagnostics.CodeAnalysis;
2using Waher.Content;
3
5{
9 public abstract class StringObject : DataObject
10 {
14 public StringObject()
15 : base([])
16 {
17 }
18
24 public StringObject(byte[] Value, string StringValue)
25 : base(Value)
26 {
27 this.StringValue = StringValue;
28 }
29
33 public string? StringValue { get; }
34
42 public override bool TryParse(byte[] Value, TravelDocumentsClient Client,
43 [NotNullWhen(true)] out IDataObject? Parsed)
44 {
45 string StringValue = InternetContent.ISO_8859_1.GetString(Value);
46
47 Client.Information("String Value: " + StringValue);
48
49 Parsed = this.Create(Value, StringValue);
50 return true;
51 }
52
59 public abstract StringObject Create(byte[] Value, string StringValue);
60 }
61}
Abstract base class for string-valued objects.
Definition: StringObject.cs:10
abstract StringObject Create(byte[] Value, string StringValue)
Creates an instance of the string-valued data object.
override bool TryParse(byte[] Value, TravelDocumentsClient Client, [NotNullWhen(true)] out IDataObject? Parsed)
Tries to parse a binary representation of the data object.
Definition: StringObject.cs:42
StringObject()
Abstract base class for string-valued objects.
Definition: StringObject.cs:14
StringObject(byte[] Value, string StringValue)
Abstract base class for string-valued objects.
Definition: StringObject.cs:24
Static class managing encoding and decoding of internet content.
static readonly Encoding ISO_8859_1
ISO-8859-1 character encoding.